Standalone Logtool for MPE/iX
printed as numeric data as indicated in the
FIELD`FORMAT
command.
Examples:
VALUE`LABELS [ 2 ] (1, "one"; 2, "two"; 3, "three")
[ 3 ] (-1, "Unlimited"; 1/14 "Half power")
[ 8 ] (-32768/-1, "Negative";
0/32767, "Positive")
VARIANT
This command must be provided for a TAG`ID definition. This command indicates which field of the RECORD`ID or
TAG`ID the current TAG`ID definition is to be used. The RECORD`ID definition must contain a field declared as a
tag. For example, a RECORD`ID must have a field similar to the following:
FIELD`FORMAT (8,INT,10,TAG,64)
In this example, we have an 8-bit tag field (to be printed in decimal) followed by 64 bits of variant data. The VARIANT
command will identify the RECORD`ID that the current TAG`ID is to be used with by a field number and value
range. The VARIANT command will identify the TAG`ID containing a tag data type by a list of field number and value
range pairs, which will specify the path to the current TAG`ID.
Error checking is performed to ensure that only TAG data types have variants. The value associated with a tag is not
limited to a single value, but a range of values may be specified for a tag. All ranges must be unique and may not
overlap with any other value or range.
Syntax:
VARIANT <variant def>
<variant def> ::= <label index> ( <variant list> ) <variant def> | <nil>
<label index> ::= [ <field#> ]
<variant list> ::= <value range>
<value range> ::= <value> | <value>/<value>
<value> ::= an integer
<field#> ::= an integer
Examples:
VARIANT [ 1 ] (1/100)
[ 3 ] (-5 ) {This example is for a TAG`ID which
has a variant field}
Tag Usage Example
The system log file is expected to contain data structures as defined in PASCAL. In order to handle Pascal case variant
records, the notion of TAGs has been provided. In the following example, a record definition file will be written for
the PASCAL record "MY_RECORD."
TYPE
some_other_type = integer; { 32 bits }
yet_another_type = RECORD
count : integer; { 32 bits }
name : string[4]; { (4 " 8 bits) + 64 bit overhead }
CASE stuff : integer OF { 32 bits }
0 : ( f1 : integer ); { 32 bits }
1 : ( f2 : bit8 ); { 8 bits }
END; { SIZEOF = 192 bits }
YET_ANOTHER_TYPE MAX RECORD SIZE = x18 BYTES
COUNT x0.0 @ 4.0