z1 device motor soft_motor "" "" 0 0 -1000 1000 0 -1 -1 0.01 0 mm 10 0 5
The format of this record may be found by running the command
mxdriverinfo -f soft_motor
This results in the output
name MXFT_STRING F:1 F:16 mx_superclass MXFT_RECORDTYPE F:0 mx_class MXFT_RECORDTYPE F:0 mx_type MXFT_RECORDTYPE F:0 label MXFT_STRING F:1 F:40 acl_description MXFT_STRING F:1 F:40 raw_position MXFT_LONG F:0 raw_backlash_correction MXFT_LONG F:0 raw_negative_limit MXFT_LONG F:0 raw_positive_limit MXFT_LONG F:0 deadband MXFT_LONG F:0 raw_minimum_speed_limit MXFT_DOUBLE F:0 raw_maximum_speed_limit MXFT_DOUBLE F:0 scale MXFT_DOUBLE F:0 offset MXFT_DOUBLE F:0 units MXFT_STRING F:1 F:16 default_speed MXFT_DOUBLE F:0 default_base_speed MXFT_DOUBLE F:0 default_acceleration MXFT_DOUBLE F:0
Each line in the output of mxdriverinfo -f ... describes a single record field in the record description.
The first item in the line of output is the name of the record field.
The second item is the field type such as MXFT_STRING, MXFT_LONG, and so forth.
The third item is the number of dimensions for this record field.
The items beyond the third item is the size of each dimension in the record field.
If we compare the output of mxdriverinfo -f soft_motor to the database entry itself, we find the following correspondence:
name = "z1" mx_superclass = "device" mx_class = "motor" mx_type = "soft_motor" label = "" acl_description = "" raw_position = 0 raw_backlash_correction = 0 raw_negative_limit = -1000 raw_positive_limit = 1000 deadband = 0 raw_minimum_speed_limit = -1 raw_maximum_speed_limit = -1 scale = 0.01 offset = 0 units = "mm" default_speed = 10 default_base_speed = 0 default_acceleration = 5
The third item on each line is the dimension description of the number of dimensions of this record field. For example, F:0 means that the record field is a scalar variable, while F:1 means that it is a one-dimensional array, and F:2 means that it is a two-dimensional array.
For items after the third item, the dimension description describes the number of elements in that dimension of the array. As an example, a two-dimensional record field of type MXFT_DOUBLE with 3 rows and 5 columns would be represented in the output of mxdriverinfo as
value MXFT_DOUBLE F:2 F:3 F:5
If this field appeared in an inline double MX variable, the corresponding record description might look like:
myvar variable inline double "" "" 2 3 5 1.1 1.2 1.3 1.4 1.5 2.1 2.2 2.3 2.4 2.5 3.1 3.2 3.3 3.4 3.5
where 1.1 through 3.5 are the individual array element values. The array element values in an MX record field appear in row rank order which is the same arrangement as for C arrays. In row rank order, the last dimension varies the fastest.
Varying length dimension descriptions such as V:other_field_name,0 describe record fields whose values depend on other record fields belonging to this record. This is most easily explained by way of an example. Let us use the linear_function record type for our example. In this case, the output of mxdriverinfo is:
$ mxdriverinfo -f linear_function name MXFT_STRING F:1 F:16 mx_superclass MXFT_RECORDTYPE F:0 mx_class MXFT_RECORDTYPE F:0 mx_type MXFT_RECORDTYPE F:0 label MXFT_STRING F:1 F:40 acl_description MXFT_STRING F:1 F:40 raw_position MXFT_DOUBLE F:0 raw_backlash_correction MXFT_DOUBLE F:0 raw_negative_limit MXFT_DOUBLE F:0 raw_positive_limit MXFT_DOUBLE F:0 deadband MXFT_DOUBLE F:0 raw_minimum_speed_limit MXFT_DOUBLE F:0 raw_maximum_speed_limit MXFT_DOUBLE F:0 scale MXFT_DOUBLE F:0 offset MXFT_DOUBLE F:0 units MXFT_STRING F:1 F:16 num_records MXFT_LONG F:0 record_array MXFT_RECORD F:1 V:num_records,0 real_scale MXFT_DOUBLE F:1 V:num_records,0 real_offset MXFT_DOUBLE F:1 V:num_records,0 move_fraction MXFT_DOUBLE F:1 V:num_records,0
In this result, the last four fields in the record, namely record_array, real_scale, real_offset, and move_fraction are varying length record fields. In each of the four fields, the leading F:1 token means that these fields are one-dimensional arrays. The last token V:num_records,0 means that the number of elements in each of these one-dimensional arrays depends on the value of the field num_records.
A real life example of use of this record type looks like
z_pitch device motor linear_function "" "" 1 0 -100000 100000 0 -1 -1 1 0 mm 3 z1 z2 z3 -1 0.5 0.5 0 0 0 0.5 0.25 0.25
where
num_records = 3 record_array = z1 z2 z3 real_scale = -1 0.5 0.5 real_offset = 0 0 0 move_fraction = 0.5 0.25 0.25
In most cases, the field referred to will be a scalar variable field such as num_records which is represented as F:0. In this case, the trailing part of the varying dimension description will be ,0 as in the examples above. However, if num_records was a one-dimensional three element array, such as
num_records MXFT_LONG F:1 F:3
then it would be possible to have one-dimensional varying length fields that depended on individual elements of the num_records field. For example,
field1 MXFT_DOUBLE F:1 V:num_records,0 field2 MXFT_DOUBLE F:1 V:num_records,1 field3 MXFT_DOUBLE F:1 V:num_records,2
Alternately, one could have a multidimensional varying length field such as
varfield MXFT_DOUBLE F:3 V:num_records,0 V:num_records,1 V:num_records,2
The MX variable superclass makes extensive use of this feature. In fact, for variable records, even the number of dimensions for the value field is of varying length.