A vector data type is a floating point array with a maximum of 8 elements. The operators __vc<operator name> are available for this data type. This allows vector operations to be implemented without additional function calls:
Determine optimal vector size
The optimum vector size can be queried at runtime using the constants Constants.vcOptimalREAL for vectors with REAL elements and Constants.vcOptimalLREAL for vectors with LREAL elements. The constants have the data type INT. If a constant returns the value 1 as the optimum size, this means that the target system does not have accelerated vector processing available.
Operator __VCADD
The operator calculates the sum of two vectors.
Operator __VCSUB
The operator calculates the difference between two vectors.
Operator __VCMUL
The operator calculates the product of two vectors or a scalar (floating point number) with a vector.
Operator __VCDIV
The operator calculates the quotient of two vectors or a vector and a scalar.
Operator __VCDOT
The operator calculates the point product (scalar product) of two vectors.
Operator __VCSQRT
The operator calculates the square root for each element of the vector.
Operator __VCMAX
The operator calculates the maximum vector of two vectors. The maximum is determined element by element.
Operator __VCMIN
The operator calculates the minimum vector of two vectors. The minimum is determined element by element.
Operator __VCSET_REAL
The operator sets all elements of a vector in a statement. The elements have the data type REAL.
Operator __VCSET_LREAL
The operator sets all elements of a vector at once in a statement. The elements have the data type LREAL.
Operator __VCLOAD_REAL
The operator interprets any memory area as a vector. The operator needs 2 parameters. The first parameter specifies the number of vector elements. The second parameter is a pointer to the REAL data.
Operator __VCLOAD_LREAL
The operator interprets any memory area as a vector. The operator needs 2 parameters. The first parameter specifies the number of vector elements. The second parameter is a pointer to the LREAL data.
Operator __VCSTORE
The operator saves/copies the contents of the vector to the specified memory address.
Included in which products?
PLC Designer V3.20
Automatic Translation