“Write variable value by name” function

IndexGroup: IdxGrp = 0x122300 + Channel ID

Index offset: IdxOffs = 0x4A

Write via
Name

This function changes the value of a variable by its name. With axis-specific variables the axis name must contain the instance identifier (e.g. axis name V.A.ACT_POS.X).

Transfer parameter (here with stream offset specified):

0

1...256

Variable name with zero termination

variable value

where

Contents

Type

Size

Variable name (with instance identifier for axis-specific variables)

String

variable, max. 256 bytes

variable value

String, REAL64, SGN32, REAL64[ ], SGN32[ ][ ], ...

variable, max. 2047 bytes

=> stream length max. 2048 bytes

This function has no return value.

With an array variable, a single value as well as the complete field in which no indices are specified in the variable name can be written.

Example of variable V.G.array[0 .. 9]:

Variable name

variable value

V.G.array[4]

Value of 5th element V.G.array[4]

V.G.array

Value or array elements 0 - 9

Application examples

1. Example of writing an array element of a unidimensional array:

Transfer parameters:

V.E.test[4]

0

123

V.E.Testvar[4] Variable name

0 zero termination

123 new value of 5th element of the variable

Return value: -

2nd Example of writing a complete array with 5 elements:

V.E.test

0

123

234

345

456

567

V.E.Testvar[4] Variable name

0 zero termination

123 new value of 1st element of the variable

234 new value of 2nd element of the variable

345 new value of 3rd element of the variable

456 new value of 4th element of the variable

567 new value of 5th element of the variable

Return values: -