Chapter 9. Configuring the I/O Driver with the Power Tool 137
See Also
Adding and Modifying Datablocks
Reading and Writing Text Strings
The SI7 driver requires you to use the ASCII or STRING data type when accessing
text values. When reading an ASCII datablock, the following guidelines also apply:
• The text must be null terminated. It is your responsibility to ensure the text is
terminated properly.
• The whole string is copied into the Text database block associated with the
ASCII datablock. If the text is too big in the Text block, the string is truncated
and the last byte of the text is set to zero.
• Each byte in a datablock is assumed to be one ASCII character.
• You can write ASCII data over multiple Text blocks. For example, if you
define the length of an ASCII datablock to be 100 bytes, you can store the data
in two 50-character Text blocks.
• The driver pads zeroes at the end of ASCII data.
ASCII Data Type Examples
The length of the datablock is 10 bytes and the length of the associated Text block is 6 bytes.
The following text shows the values read and written by the SI7 driver.
Value Read by Driver... Text Read by iFIX...
Fred\0 Fred\00 (terminated with a null character and padded
with a zero)
Alarms Alarms
ABCDEFGHI\0 ABCDE\0
NOTE: Database Manager does not prompt you to add nonexistent datablocks referenced by
Text blocks.
Komentarze do niniejszej Instrukcji