Two-Point Scaling Examples
This topic provides numerous useful examples of the various ways you can use reference methods in your device template files to perform conversions with constant values and/or reference data group element values. A sample device template file using each example is available upon request; it can be loaded to a DDS and used to test your reference methods. It is called ReferenceTester.dtf. The original, non-scaled input value must be preserved in a different data group element.
See the following subsections for details:
- Two-Point Scaling by Constants (A)
- Two-Point Scaling by Constants (B)
- Two-Point Scaling by Data Group Elements (A)
- Two-Point Scaling by Data Group Elements (B)
For information about example data group elements and values used below, see Example Values.
Two-Point Scaling by Constants (A)
The following example references the data group element raw61 and applies two constant-value scales to it. The result is 1220 because the raw scale divides 61 by 5, then the engineering scale multiplies 12.2 by 100.
|
<ScaleTpA desc="Two-Point Scale by Constants Method A" readOnly="true" type="ui2" ref="raw61" scaleLoRaw="0" scaleHiRaw="5" scaleLoEng="0" scaleHiEng="100"/> |
Useful attributes to know are ref, scaleLoRaw, scaleHiRaw, scaleLoEng, and scaleHiEng.
Two-Point Scaling by Constants (B)
The following example uses two child elements to compute a scaled value. The first child element references the operation opAssignId and the data group element raw61 to assign the current value of raw61 as the initial value for ScaleTpB. The second child element references the operation opTwoPointScale to apply two scales with constant values to the value assigned by the first child element. The result is 1220 because the raw scale divides 61 by 5, then the engineering scale multiplies 12.2 by 100.
|
<ScaleTpB desc="Two-Point Scale by Constants Method B" readOnly="true" type="ui2" isRef="1"> <ref prec="0" refOp="opAssignId" deid="raw61"/> <ref prec="1" refOp="opTwoPointScale" scaleLoRaw="0" scaleHiRaw="5" scaleLoEng="0" scaleHiEng="100"/> </ScaleTpB> |
Useful attributes to know are isRef, prec, refOp, deid, scaleLoRaw, scaleHiRaw, scaleLoEng, and scaleHiEng. A useful element to know is ref.
Two-Point Scaling by Data Group Elements (A)
The following example references the data group element raw61 and applies two reference data group element scales to it. The raw scale derives its values from two data group elements: raw0 and raw5. The engineering scale derives its values from two data group elements: raw0 and raw100. The result is 1220 because the raw scale divides 61 by 5, then the engineering scale multiplies 12.2 by 100.
|
<ScaleTpIdA desc="Two-Point Scale by DEIDs Method A" readOnly="true" type="ui2" ref="raw61" scaleLoRawId="raw0" scaleHiRawId="raw5" scaleLoEngId="raw0" scaleHiEngId="raw100"/> |
Useful attributes to know are ref, scaleLoRawId, scaleHiRawId, scaleLoEngId, and scaleHiEngId.
Two-Point Scaling by Data Group Elements (B)
The following example uses two child elements to compute a scaled value. The first child element references the operation opAssignId and the data group element raw61 to assign the current value of raw61 as the initial value for ScaleTpIdB. The second child element references the operation opTwoPointScaleId to apply two scales with reference data group element values to the value assigned by the first child element. The raw scale derives its values from two data group elements: raw0 and raw5. The engineering scale derives its values from two data group elements: raw0 and raw100. The result is 1220 because the raw scale divides 61 by 5, then the engineering scale multiplies 12.2 by 100.
|
<ScaleTpIdB desc="Two-Point Scale by IDs Method B" readOnly="true" type="ui2" isRef="1"> <ref prec="0" refOp="opAssignId" deid="raw61"/> <ref prec="1" refOp="opTwoPointScaleId" scaleLoRawId="raw0" scaleHiRawId="raw5" scaleLoEngId="raw0" scaleHiEngId="raw100"/> </ScaleTpIdB> |
Useful attributes to know are isRef, prec, refOp, deid, scaleLoRawId, scaleHiRawId, scaleLoEngId, and scaleHiEngId. A useful element to know is ref.


