Port 3
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.
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.
RS-485 Network
MODBUS Slave #1
MODBUS Slave #2
1. Execute the Receive instruction.
2. Execute the Send instruction.
3. Execute the Receive instruction.
4. Execute the Send instruction.
Continue this cycle.
When Com Port 2 is ready, the
Receive instruction is executed.
This also applies to the Send
instruction.
CLICK PLUS PLC Hardware User Manual, 1st Edition, Rev. B – C2-USER-M
4-33
Chapter 4: PLC Communications