OPC server has Unicode strings
The structure of process values in the PLC is individual for each PLC type. This means that individual data types may be structured differently. When exchanging individual process variable values, the adaptation for visualisation is usually carried out by the communication component.
If a structure is used to access PLC data block by block (via a process variable that has the data type of a structure) as a byte stream ( structure access parameter (OPC)), the communication component can no longer carry out this adaptation as it is not informed about the structure of the byte block. This adaptation must therefore be carried out in the variable server.
The OPC server parameter has Unicode strings causes structure elements of data type VT_BSTR that are transferred within a byte block to be interpreted as Unicode strings and transferred to the internal process variable cache. Unicode strings essentially differ from ASCII strings in their character structure. While one character is represented by one byte in an ASCII string, two bytes are used per character in a Unicode string. In a structure element of data type VT_BSTR, the length of the string is specified by the field sizeparameter. The specification OPC server has Unicode strings therefore significantly determines the size of the entire byte block if a structure element has the data type VT_BSTR.
|
Setting |
Description of the |
|---|---|
|
|
Before reading from the PLC, the system checks whether a structure element has the data type VT_BSTR. The block size is automatically adjusted. Only then is the data block requested. Once the block has been received, the internal process variable cache is filled with the bytes of the received block in accordance with the structure. As the variable server works internally with Unicode strings, no further adjustment is necessary when transferring BSTR data. When writing, a byte block is compiled from the internal process variable cache according to the structure specifications. The block is then transferred to the PLC. |
|
|
When reading from the PLC, a byte block is requested from the variable server via the communication component. The internal process variable cache is filled with the bytes of the received block in accordance with the structure. The received ASCII strings are converted into Unicode strings. When writing, a byte block is compiled from the internal process variable cache according to the structure specifications. The Unicode strings held in the internal process variable cache are converted to ASCII strings. This block is then transferred directly to the PLC. ASCII↔Unicode is converted using the ACP (ANSI code page). |
The use of this parameter depends on the PLC used and only makes sense if:
-
the parameter Structure access is set to As byte stream and
-
structures can be used as data types for process variables.
Further customisation options for this type of access:
Parameters for module: