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

Beside the user defined variable types also the elementary data types (BOOLEAN, ..., REAL64) and the character strings of type STRING can 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 for the use of string variables with more than 20 characters the parameter use_extended_string_var has to be set TRUE. 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 Byte (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 variable in the parameter P-EXTV-00008. The default size of the data type VSTRING is 128 bytes.

Attention

attention

Later configuration to 128 byte string variables

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

The definition of the variable types is done in the same configuration list like the definition of the external variables.

Comments can be whole-lined 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 ... 29 (Maximum number of data sets for the definition of external variable types)