A variable of the MATRIX data type encapsulates a
two dimensional matrix of 32-bit floating-point values (corresponding to
the IEC 61131-3 data type REAL) in [row][column] format.
Literal values of MATRIX variables are expressed as
follows, using the syntactic conventions defined in Annex A of IEC
61131-3:
matrix_literal ::=
'[' [vector_literal {',' vector_literal}] ']'
vector_literal ::=
'[' [float_value {',' float_value}] ']'
The syntax of float_value is any string accepted by
the java.lang.Float.valueOf(String)
method.
Each vector_literal element represents a row
of the matrix; for instance, the literal [[1,2],[3,4]]
represents the matrix
1.0 2.0
3.0 4.0
Missing elements are assigned zero values; for instance, the
literal [[],[1,2],[3,4,5]] represents the matrix
0.0 0.0 0.0
1.0 2.0 0.0
3.0 4.0 5.0
For examples of the use of MATRIX literals, see the
TEST_MATRIX system
configuration and the TEST_MATRIX
application of the CODEC_TEST2 system
configuration, as well as the IN_MATRIX and OUT_MATRIX FB types.
MATRIX data is transferred according to the following modified ASN.1 syntax:
ARRAY ::= [APPLICATION 23]
IMPLICIT SEQUENCE {
rows IMPLICIT USINT,
cols IMPLICIT USINT,
IMPLICIT SEQUENCE OF IMPLICIT REAL}
The encoding of MATRIX elements is constructed in the sense of ISO/IEC 8825, with the following extensions to the COMPACT encoding described in Annex E of IEC 61499-1:
rows and cols, representing the
number of rows and columns in the matrix respectively, are encoded as
values of the USINT type without identifier or length octets,
i.e., as two successive 8-bit unsigned integers.
0.0 0.0 0.0
1.0 2.0 0.0
3.0 4.0 5.0
would be encoded in the order (0.0,1.0,3.0,0.0,2.0,4.0,0.0,0.0,5.0).For an example of the application of these encoding rules, see
the TEST_MATRIX
application of the CODEC_TEST2 system
configuration.
Last updated: 2011-01-19.
©2011 Holobloc
Inc.
Licensed under the Academic
Free License version 3.0.