Example Program
The ladder program to use these Receive and Send instructions are easy. You just need one NO
(Normally Open) contact instruction to check if the com port is ready to receive or send data.
When Com Port 2 is ready, the
Receive instruction is executed.
Interlocking
If you are going to use more than one Receive and/or Send instruction with a serial
communication port, you need to be sure only one of the instructions is enabled at any point
during the operation. The technique to execute more than one Receive and/or Send instructions
in order is called 'Interlocking'. When the Interlocking sample program below is executed, the
two Receive instructions and two Send instructions are executed one by one.
Example Program: Interlocking with Two Slaves
In this example, Port 3 on the CLICK PLC unit communicates with two MODBUS slaves. The
slave IDs (node numbers) are 1 and 2. The CLICK PLC unit executes one Receive instruction
and one Send instruction with each MODBUS slave.
Port 3
CLICK PLC Hardware User Manual, 6th Edition, Rev. F – C0-USER-M
This also applies to the Send
instruction.
RS-485 Network
MODBUS Slave #1
1. Execute the Receive instruction.
2. Execute the Send instruction.
Continue this cycle.
Chapter 4: PLC Communications
MODBUS Slave #2
3. Execute the Receive instruction.
4. Execute the Send instruction.
4–31
Need help?
Do you have a question about the C0-USER-M and is the answer not in the manual?