Skip to main content

Variable

A variable used on labels. Variables hold text.

PropertyValue
Data typesSTRING, UINT16, INT16, UINT32, INT32
AccessR, or RW if the mapping is writable
  • As a STRING, the text is read and written as it is. See Strings for the encoding.
  • As a numeric type, the variable's text must be a decimal number. Reading a variable that is not a number returns 0. Writing stores the decimal text of the written value, for example 42.

If the variable does not exist, it reads as 0, and a write returns exception 04.

Example​

The variable Lot at 2–9 (STRING, 8 registers) in the example mapping list:

RequestResult
Write 2–4 = 0x4C30 0x3034 0x3200 (function 16)Sets Lot to L0042.
Read 2–90x4C30 0x3034 0x3200 0x0000 0x0000 0x0000 0x0000 0x0000
Write 2 = 0x4142 (function 06)Sets Lot to AB.

See also Setting a lot number.