Description
Attached project is a Modbus RTU Master sample program for VersaMax Serial Communications Module - IC200CMM020.
Resolution
In this sample program, once the CMM020 module has issued a status value of “COMMAND_READY”( %AQ2 = 2 ), the logic initializes the Master Serial Port Command Program Block, then the Send RTU Preset Query Command (08002) is sent to the Serial Communications module by placing the values into the module’s configured %AQ memory references.
There are four Read/Write steps in the sample program:
- Read 10 Output bits from a RTU Slave.
- Read 20 Registers from a RTU Slave.
- Write 5 Output bits to a RTU Slave.
- Write 10 Registers to a RTU Slave.
The sample project can be modified to fit specific applications. In this example, IC200CMM020 is used in a VersaMax PNS NIU Node, but it also can be used in a VersaMax GBI NIU node.
Notes: If you require only one Read/Writer operation in application, you must use two same steps to ensure that the sequence number is continuously changing in the process of communication.
Reference:
(1)GFK-2423, VersaMax Serial Communications Module IC200CMM020 datasheet
IC200CMM020 - VersaMax Serial Communications Module
(2)GFK-2220, Modbus RTU Master Communications for Series 90 and VersaMax PLCs User's Manual
Addendum to GFK-0582D: Modbus RTU Master Communication