Download GuardPLC Controller Systems, User Manual

Transcript
Chapter 21
Communicate with ASCII Devices
The offset in the ASCII output section is numbered based on bytes. In the example, the first signal uses
bytes 0, 1, 2, and 3. The second signal uses bytes 4 and 5. However, when you request these signals in
the command string (see ASCII Master - Request below), the first signal is always 0, the second signal
is always 1, the third signal is always 2, and so forth.
TIP
The output section automatically sorts the name field based on alphanumerical order. This does not
automatically change the offsets, but if you renumber after sorting, the offsets will change and there is
no undo feature. This changes the order in which the signals are sent out the serial port.
Because names are used only in printouts, you may want to enter these names in alphanumeric order
to begin with. (For example signal 101, signal 102, signal 103, signal 104, and so forth.)
ASCII Protocol
The controller is a slave ASCII device and expects this protocol from
the master device.
ASCII Master - Request
If the ASCII master sends a request, the slave can send a response.
The master request has this format (each character is one byte).
Start Sign
Destination
Source
Function Code
Start Address
Number of
Variables
End Sign
1 char
2 char
2 char
1 char
5 char
3 char
1 char
270
Component
Description
Start Sign
identifies the start of a message
^ character
Destination
unique slave address (GuardPLC controller)
01…99
Source
unique master address (requester)
01…99
Function Code
read data
R character
Start Address
data start address for characters to read (offset)
00000…65535
Number of Variables
number of variables to read and send back to master
000…999
End Sign
identifies the end of a message
& character
Publication 1753-UM001C-EN-P - March 2010