Applies To:
  • CitectSCADA 1.00, 1.01, 1.10, 1.11, 1.20, 2.00, 2.01

Summary:
Question: What is the maximum size of a string in Citect? 

Solution:
The maximum size of a string will depend on where that string is declared. There are various string types: (1) strings read from a PLC, (2) strings on the Cicode stack (local to a function) and (3) strings declared in a Cicode file.

1). The maximum size of a string read from the PLC is limited by the maximum read size that PLC will support. The protocol description in the online help specifies the maximum read size (in bits) for each protocol. For example, Modbus has a maximum read size of 2000 bits, or 240 bytes. Therefore, the maximum string you can read from a modbus PLC is 240 bytes. Be aware that if you use the PLC string in an expression, or store it in another string, the following limitations will apply:

2). Strings declared in Cicode Functions are limited to 256 bytes in size.

3). Strings declared in Cicode files, (ie global to all functions in that file) are limited to 128 bytes in size.

Also note that Citect uses a register size of 256 bytes while evaluating strings. Therefore, during a string calculation, a string that is longer than 256 bytes will be truncated. For example:

okString = StrRight(BigString + BigString, 250);

If BigString is 200 chars, then when Citect first adds them together, the temp string will be 400 bytes in size, and will be truncated to 256 characters. StrRight will then get the right characters of the truncated string. 


Keywords:
 

Attachments