Recent Posts

Pages: [1] 2 3 ... 10
Frequently Asked Questions / Re:can we send sms?
« Last post by lanaroady on August 19, 2019, 08:16:49 AM »

On is a document ' Send, Receive and Read SMS with Terminal Program and Nokia 6210 Phone '  which contains all the relevant commands for controlling a Nokia 6210 phone (and Siemens SMS modem) over a serial port. The 6210 is still available very cheaply on ebay. It is special in that it has a genuine serial port and cable available so ideal for Tri plcs. Have fun. William redadair

It was just a things which was some time not available because of that serial port.
News / New Internet PLC Forum Format
« Last post by Forum Admin on August 08, 2019, 07:00:03 PM »
Greetings to all Internet PLC Forum members:

We have just migrated our Yabbse-based forum to the more modern "simple machines forum" platform. Besides better security, the new forum also allows members to select their own theme, to replace the default theme (e.g. you can change back to the old YaBB theme).

We have carried out a number of tests to ensure that all previous valuable posts, covering a wide range of topics on our PLC products, are still accessible to our users.

Should you encounter any problem using the new forum, please report to the webmaster via email and we will do our best to resolve the issues as soon as possible.

Thank you for your continued interest and support,  we hope you will enjoy using the new forum!

Best Regards,
The Webmaster
Technical support / Re:User written Modbus RTU example code
« Last post by garysdickinson on June 19, 2019, 05:45:06 PM »

I try to periodically post PLC software that illustrates an approach to PLC programming that solves a complicated problem without a lot of programming.

As always, I invite people to use this or any other examples that I have posted.

Best regards,

Gary D*ckinson
Technical support / Re:User written Modbus RTU example code
« Last post by support on June 19, 2019, 03:14:39 PM »
Thanks for the great contribution to the community!
Technical support / Documentation
« Last post by garysdickinson on June 12, 2019, 12:32:47 AM »
This is the PDF version of the documentation.
Technical support / Slave PLC code for test
« Last post by garysdickinson on June 12, 2019, 12:28:35 AM »
Variations of this Modbus RTU code is currently running 24/7 on over 40 PLCs.  Some of these installations date back 5 years.  This is why I am convinced that the code is reliable.

I extracted the Modbus RTU code out of running production code. I simplified this code for use as a demo.

I needed to test the demo code against a real Modbus RTU slave device. I decided to use a spare TRI PLC as the slave.  This choice solved my my need to test the code and provided an opportunity to explain how the low-level TRI handles Modbus RTU requests.

This posting is the PLC program that I am running on the slave PLC.  This code initializes the serial port on the slave and writes data patterns into DM[] and some of the PLC RELAYS.

The data patterns are used to help me verify that my code running on the master PLC is reading/writing the correct registers in the slave.

The slave PLC responds to the Modbus RTU requests using the TRI written firmware. My software on the slave PLC is NOT handling the Modbus requests.

Have fun,

Gary D*ckinson
Technical support / User written Modbus RTU example code
« Last post by garysdickinson on June 12, 2019, 12:22:29 AM »
I am presenting the code that I have been using for the last 5 years as an alternative to the TBASIC ReadModbus, ReadMB2, WriteModbus and WriteMB2.

This code is supports all possible Modbus function codes.

This code is non-blocking. The PLC does not lock up waiting for a response from the slave device.

This code is an example of a user written communication protocol

This code allows you to see both the Modbus response packet and every byte received from the Modbus slave.  This allows you tremendous debug capability that is not available with the TBASIC Modbus support.

I will post the PLC code and the documentation in pieces to keep them under 200KB


Gary Dickinson
Technical support / Re:FX2424 Modbus RTU
« Last post by garysdickinson on May 26, 2019, 06:35:36 PM »
I am not answering the question that you asked. You cannot get 4 values from the READMODBUS function, just one.

Your code:

Z = READMODBUS (13,1,3104)

The READMODBUS function returns a single 16-bit value. You assigned this value to the 32-bit variable Z.  Where are the other 3 values that you said that you were getting?

The 3rd argument to READMODBUS should have been &h3104 (hexadecimal not 3104 (decimal).  It is a good bet that your Modbus device rejected this modbus query. Your Modbus device probably returned an error status and not the value of some register.

You must check the value from Status(2) to determine if the READMODBUS function completed without error and the value that was returned has any meaning.  

Your test code uses the Modbus function code of 4.  The READMODBUS function uses the Modbus function code of 3.  These two function codes are different and your Modbus may return values from different registers based on the function code that you  used.

You can force READMODBUS to use the function code 4 instead of 3 with this statement:

   Setsystem 6,4

Gary D*ckinson
Technical support / FX2424 Modbus RTU
« Last post by jurg1505 on May 26, 2019, 09:38:05 AM »
I want to read data from a Epever solar charger the Tracer2210AN.

The Tracer2210AN modbus settings are;
Code: [Select]
controller supports RTU mode only.
16bit MODBUS addresses (per the spec)
The serial communication parameters are
ï‚ž ï‚  BPS:115200 baud
ï‚ž ï‚  Parity: None
ï‚ž ï‚  Data bits: 8
ï‚ž ï‚  Stop bits:1
ï‚ž ï‚  Flow control: None

Example code from Epever
Code: [Select]
Read real-time battery voltage
Device ID:0x01
Function code: 0x04
Register Address: 0x3104
Register count: 0x0001
Send command: 01 04 31 04 00 01 7E F7
Receive command: 01 04 02 04 CE 3A 64
Read Holding Register Value: 0x04CE
0x04CE (hex) = 1230 (dec)
1230 / 100 = 12.3 volt

Code: [Select]
Z = READMODBUS (13,1,3104)i get 4 values one after the other
How can i put the first value in DM[51], second in DM[52] ....
Technical support / Re:FMD88-10 PLC's MODBUS TCP client malfunctioning
« Last post by support on May 11, 2019, 07:20:05 AM »
Each time when you make a Modbus TCP connection to the (3rd party) Modbus TCP server you have to wait for the connection to be made before you can run the READMODBUS or WRITEMODBUS command successfully.

Since you have two Modbus TCP server devices and there is only one client port on the FMD PLC, you have to make a connection, check that the connection is successful, the perform the READMODBUS or WRITEMODBUS command, then check STATUS(2) to ensure that you get a good result. Finally close the connection. You then connect to the second device and you must do the same by checking that the connection is made then READ or WRITEMODBUS command, check the communication status, then close the port.

It can be done on the fly reasonably fast especially the the devices are all on a LAN.

Pages: [1] 2 3 ... 10