Applies To: |
|
Summary: |
I am reading two strings from a device, with Variable Tag addresses 40100[5] and 40110[5]. What appears to be happening is Citect is reading the entire range 40100 - 40115 and the first string appears on my Citect page as length 15 and the second as length 5. What is happening? |
Solution: |
Citect will allow string Tag lengths to be
defined using the array syntax, however it will also still block
requests. What may then happen is if the string is not NULL
delimitered (which is an assumption for all strings in Citect) then
it will display the entire string either up to the first NULL
character or up to the end of the request.
The easiest way to display only what is required is to modify your Citect page to display the string using the StrLeft() Cicode function, with the length of the string set to match the variable tag definition. If the string is shorter, it will still display correctly and if it is longer, you will still only see the part of the string defined in the variable tag. Further Tips - * Valid string data in Citect is considered to be a continuous block of ASCII characters delimitered by the first NULL (0x00) data address found. * If there are gaps in your string, then you should use a SPACE character (0x20) to fill these. * Most Citect drivers can read strings up to 255 characters in length, however only 128 may be displayed by a text object on a Citect graphics page. Multiple text objects and the use of the StrLeft() and StrRight() functions is required, if you wish to display longer strings. * Some PLCs have special string registers which are fixed length - in general the above rules sill apply to these addresses. |
Keywords: |
Related Links
Attachments