User`s manual
Western Reserve Controls, Inc. 1782-JDC User’s Manual
22
The selection of Pad Mode is valid only for the ASCII receive and DeviceNet I/O Response
operation. It has no effect on DeviceNet I/O Command strings and ASCII transmit data to your
ASCII device.
These values can be set and retrieved by using the standard set and get services on class 15
(F
hex
), instance 8, attribute 1 (See Table 5-1).
5.1.8 Setting up the Pad Character
The JDC allows you to specify the character that pad mode uses to pad the received serial
data with. This can be set to any valid ASCII value (0-127 in 7 bit modes, 0-255 in 8 bit
modes).
These values can be set and retrieved by using the standard set and get services on class 15
(F
hex
), instance 9, attribute 1 (See Table 5-1).
5.1.9 Using the Swap Bytes Mode
This mode is used if it is necessary to communicate through DeviceNet to an Allen Bradley
PLC, such as the SLC500. When a serial message is to be transmitted or received, the bytes
of the message will be reversed on the word boundary. Thus the message “ABCD” will be in
memory like “BADC”. This may cause problems in some cases. By setting Parameter 10
(class F
hex
, instance 10, attribute 1) to 1, the bytes will be swapped by the JDC for both
transmit and receive. This means that all messages retain their left to right byte sequence in
memory.
For this to work, you must specify an even length for parameters 5 and 6. Messages
may be any length (odd or even) that are equal to or less than parameters 5 or 6. When
transmitting out from the PLC, the size of the string transmitted should be an even number.
When transmitting an odd size, round up the size to the next even number.
By setting Parameter 10 to 2, the bytes will be swapped in 4 byte blocks (32-bits) for both
transmit and receive, achieving the same left to right sequence as above in the 32 bit
memory. This mode is intended for use with AB 32-bit PLC’s.
For this to work, you must specify a length that is evenly divisible by 4 for parameters
5 and 6. Messages may be any length (odd or even) that are equal to or less than parameters
5 or 6. When transmitting out from the PLC, the size of the string transmitted should be an
even number. When transmitting an odd size, round up the size to the next divisible by 4
number. Example: The length of the message is 16 bytes. Add 2 since we are using carriage
return / linefeed terminators. Since 4 doesn’t divide into 18 evenly, the length should be
specified as 20.
Note: When mapping the JDC into a PLC and using byte swapping, be sure the message
body starts on a 16 or 32 bit boundary or the results may be erroneous. It usually means
mapping the record number, error (if receiving), and length bytes to the discrete input or
output file or another suitable data file. This is also helpful, since the values of these numbers
are available for use without a copy file command, such as needed when dealing with M0 and
M1 files. The body of the ASCII string can be mapped to the M0 and M1 files.
Note: This feature is only valid for non-zero length strings (non-character-terminated data). It
will not work with character-terminated strings when the length byte is left at 0.
Note: Termination characters are counted as part of the length of the non-zero length strings.
Note: The Pad mode should be used when operating a JDC with a PLC master.