Values for the length and precision attributes are different for different data types.
The following table lists each data type with a description of the possible values for length and precision.
Data type | Length | Precision |
---|---|---|
type="char" | The number of bytes of data for this element, which is not necessarily the number of characters. You must specify either a literal number or a data-name. | Not applicable |
type="int" | The number of bytes of data for this element: 2, 4, or 8. You must specify a literal number. | Indicates the number of bits of precision and whether the integer is signed or unsigned:
|
type="packed" or "zoned" | The number of numeric digits of data for this element. You must specify a literal number. | The number of decimal digits for the element. This number must be greater than or equal to zero and less than or equal to the total number of digits specified on the length attribute. |
type="float" | The number of bytes, 4 or 8, of data for this element. You must specify a literal number. | Not applicable |
type="byte" | The number of bytes of data for this element. You must specify either a literal number or data-name. | Not applicable |
type="struct" | Not allowed. | Not applicable |
Several attributes allow you to specify the name of another element, or tag, within the document as the attribute value. The name specified can be a name that is relative to the current tag.
Names are resolved by seeing if the name can be resolved as a child or descendent of the tag containing the current tag. If the name cannot be resolved at this level, the search continues with the next highest containing tag. This resolution must eventually result in a match of a tag that is contained by either the <pcml> tag or the <rfml> tag, in which case the name is considered to be an absolute name, not a relative name.
Here is an example using PCML:
<pcml version="1.0"> <program name="polytest" path="/QSYS.lib/MYLIB.lib/POLYTEST.pgm"> <!-- Parameter 1 contains a count of polygons along with an array of polygons --> <struct name="parm1" usage="inputoutput"> <data name="nbrPolygons" type="int" length="4" init="5" /> <!-- Each polygon contains a count of the number of points along with an array of points --> <struct name="polygon" count="nbrPolygons"> <data name="nbrPoints" type="int" length="4" init="3" /> <struct name="point" count="nbrPoints" > <data name="x" type="int" length="4" init="100" /> <data name="y" type="int" length="4" init="200" /> </struct> </struct> </struct> </program> </pcml>
Here is an example using RFML:
<rfml version="4.0"> <struct name="polygon"> <!-- Each polygon contains a count of the number of points along with an array of points. --> <data name="nbrPoints" type="int" length="4" init="3" /> <data name="point" type="struct" struct="point" count="nbrPoints" /> </struct> <struct name="point" > <data name="x" type="int" length="4" init="100" /> <data name="y" type="int" length="4" init="200" /> </struct> <recordformat name="polytest"> <!-- This format contains a count of polygons along with an array of polygons --> <data name="nbrPolygons" type="int" length="4" init="5" /> <data name="polygon" type="struct" struct="polygon" count="nbrPolygons" /> </recordformat> </rfml>