Space-padded strings via DDE
(SS##) indicates a special specifier used only with the Allen-Bradley Integer (N) or ASCII (A) PLC data types for Space-padded strings.
Strings stored in this manner always use all of the registers that are allocated. If a string is shorter than the allocated number of registers it is padded to the end with space characters (ASCII 20Hex).
The first 'S' indicates string, the second 'S' indicates Space-padded and the ## indicates the length of the string in elements. Data is read up to the requested length of the string.
You may specify multiple strings with the length (block size) specifier (L##). However, the maximum combination of individual string lengths and the block size must not exceed the maximum size of a packet. For Allen-Bradley this maximum packet size is 100 elements, with the exception of the Allen-Bradley Ethernet driver where the maximum is 1000 elements.
Example:
One string with a length of 10 elements would be 20 bytes (2 bytes/element). The item for Allen-Bradley would be: N7:0,L1,C1,SS10. The string is space-padded and would appear as SSAMPLE
in the data table.Register (Element) | High byte (Hex) | Low byte (Hex) | High byte (ASCII) | Low byte (ASCII) |
---|---|---|---|---|
N7:0 | 83 | 83 | S | S |
N7:1 | 65 | 77 | A | M |
N7:2 | 80 | 76 | P | L |
N7:3 | 69 | 20 | E | " " |
N7:4 | 20 | 20 | " " | " " |
N7:5 | 20 | 20 | " " | " " |
N7:6 | 20 | 20 | " " | " " |
N7:7 | 20 | 20 | " " | " " |
N7:8 | 20 | 20 | " " | " " |
N7:9 | 20 | 20 | " " | " " |
The string is padded to the end of the register block with spaces, (ASCII 20 Hex).
Provide Feedback