Get error or warning in positioning unit
This FP instruction reads the error and warning codes from buffer 1 of the positioning unit in the slot specified by s1_Slot and for the axis specified by s2_Axis if the trigger EN is TRUE. The error code is stored in d1_Error and the warning code is stored in d2_Warning.
Input
Slot number
Axis number
Values: 1–4, 8 (virtual axis)
Output
Error code
Warning code
if the area specified using the index modifier exceeds the limit.
if the slot and/or axis number is out of range
if d1_Error or d2_Warning is out of range
if the area specified using the index modifier exceeds the limit.
if the slot and/or axis number is out of range
if d1_Error or d2_Warning is out of range
In the global variable list you define variables that can be accessed by all POUs in the project.
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
IF g_dutPositioningInputs.b60_ErrorAxis1 OR g_dutPositioningInputs.b68_WarningAxis1 then
FP_POS_UNIT_GET_ERROR(s1_Slot := g_iPositioningUnitSlotNumber,
s2_Axis := g_iPositioningUnitAxisNumber,
d1_Error => wErrorCodeAxis1,
d2_Warning => wWarningCodeAxis1);
END_IF;