Data sets for definition of variable types (struct[i].*)

Besides user-defined variable types, the elementary data types (BOOLEAN, ..., REAL64) and the character strings of the STRING type can also be used.

Size of default variable types

Variable type

Size

BOOLEAN, UNS08, SGN08

1 byte

UNS16, SGN16

2 bytes

UNS32, SGN32

4 bytes

REAL64

8 bytes

STRING

128 bytes

As of CNC Build V2.10.1025.00 and higher, string variables may contain up to 128 characters including the termination mark.

For downgrade compatibility reasons, the parameter use_extended_string_var must be set to TRUE in order to use string variables with more than 20 characters the parameter (P-EXTV-00022). Depending on the parameter use_extended_string_var, string variables are limited to the following length (including the termination mark):

  • use_extended_string_var = FALSE: 21 bytes (default)
  • use_extended_string_var = TRUE: 128 Byte

VSTRING

String with variable size between 1 and 800 bytes.

From CNC version V.3.1.3039.00 onwards the CNC supports the data type VSTRING which can be used for the definition of string variables with individual size. The required size of the character string including zero termination is specified for structure elements in the parameter P-EXTV-00021 or for variables in the parameter P-EXTV-00008. The default size of the VSTRING data type is 128 bytes.

Attention

attention

Later configuration to 128 byte string variables

If there is a later change to 128 byte size string variables (use_extended_string_var = TRUE) within an existing configuration, the addresses of the external variables in the memory (index, byte offset) and in the PLC must be adapted to avoid overwriting the following variables.

The variable types are defined in the same configuration list as the definition of an instance of an external variable.

In the configuration file, comments can be whole lines or can be added at the end of a line. With a comment spanning an entire line, the comment character "'#" must be placed at the start of the line followed by a blank.

If a comment is to be inserted at the end of a line, there only needs to be a blank before the comment. However, if a string was defined in the line, the comment must be preceded by the comment character "(".

Blank lines are also possible.

The key word 'struct' replaces the common token 'type' used in older CNC versions. However, due to downward compatibility, the token 'type' continues to be supported.

Structure name

Index

struct[i]

i = 0 ... 49 (Maximum number of data sets for the definition of external variable types)