8
955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA
+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM
APPLICATION INFORMATION
296186-AN
MCO-0000910
TPPLCalculate
Dictionary<string, uint> TPPLCalculate(object Position1, object Position2, double desiredPosition1,
double desiredPosition2, Dictionary<string, object> options, ProgressDone calculationProgress)
This method takes the position information, the desired positions, and the options and calculates the values. If
desired, these values are written to the device. There are six input parameters, Position1, Position2, desiredPosi-
tion1, desiresPosition2, options, and calculationProgress.
• Position1 – the data returned from the TPPLGetPosition1Information method.
• Position2 – the data returned from the TPPLGetPosition2Information method.
• desiredPosition1 – the desired value for position 1. The units and value will depend on “Output Units”.
• desiresPosition2 – the desired value for position 2. The units and value will depend on “Output Units”.
• options –
□ Rotation Direction – String; when “cw” the field is increasing clockwise and PO will be set to 0; when “ccw”
the field is increasing counterclockwise and PO will be set to 1. Default is “cw”.
□ Minimum Input Angle – Double; the units and value will depend on “Input Units”. Default is 0.
□ Maximum Input Angle – Double; the units and value will depend on “Input Units”. Default is maximum value.
□ Low Clamp Value – Double; the units and value will depend on “Output Units”. Default is 0.
□ High Clamp Value – Double; the units and value will depend on “Output Units”. Default is maximum value.
□ Post Gain Offset Value – Double; the units and value will depend on “Input Units”. Default is 0.
□ Clamp Enable – Boolean; when true, the field “CE” will be set. Default is false.
□ Rollover Enable – Boolean; when true, the field “ROE” will be set. Default is false.
□ Write to Chip – Boolean; false disables writing the calculated values to the device, default is true.
□ Input Units – String; default is “degrees”.
◦ “degrees” – all of the values are in degrees (0 to 360).
◦ “percentage” – all of the values are in percentage (0 to 100).
◦ “bams” – all of the values are between 0 and 4095 inclusively.
□ Output Units – String; default is “degrees”.
◦ “degrees” – all of the values are in degrees (0 to 360).
◦ “volts” – all of the values are in volts (0 to 5.0).
◦ “duty cycle” – all of the values are in percentage (0 to 100).
◦ “percentage” – all of the values are in percentage (0 to 100).
◦ “bams” – all of the values are between 0 and 4095 inclusively.
□ Diagnostics – when this option is present, the internal diagnostics are enabled and returned as a string in
this option.
• calculationProgress – ProgressDone; a routine that updates a progress bar and can be null if not needed.
Figure 11: Calculate two-point parameters and write them to A1330.