Handshaking
Chapter 5
53
Handshaking in a read operation requires the module to toggle bit 15 in
status word one, SW1(15), when the module transfers a change in module
status and/or new data to the processor. When it transfers new data to the
processor, the module also sets in status word two, SW2, the number of
data words per string that it is transferring.
After the processor receives and processes new status and/or data, your
program must toggle bit 15 in command word one, CW1(15), and return
the toggled status to the module to acknowledge receipt (Figure 4.1 and
Table 5.A).
Figure 4.1
Read Handshaking
The ASCII Module
Data Transfer
The Ladder Program
Toggles SW1(15) when it receives new data
from the ASCII device and/or detects a
change in module status
Sets the number of transferred words per
string in SW2 when new data is transferred
>
SW1(15),BTR(07,17), and SW2>0 for new
data. SW1(15) for change in status
Detects that SW1(15) has been toggled
Acts on the change in module status
according to program logic
When it also detects SW2>0 and BTR(07,17)
it acts on new data according to program logic
Toggles CW1(15) and returns its new status to
acknowledge receipt.
CW1(15)=SW1(15)
<
Repeats the cycle when it detects a change in
CW1(15), and when new data is received from
the ASCII device, and/or when module detects
a change in its status
NOTE:
A read block transfer of data can occur every scan. Your program should process new data only when it detects that SW1(15) has
been toggled and that SW2>0.
Reading Status and/or Data from
the Module
StockCheck.com