FP_POS_UNIT_GET_ERROR

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.

Parameters

Input

s1_Slot (WORD, INT, UINT)

Slot number

s2_Axis (WORD, INT, UINT)

Axis number

Values: 1–4, 8 (virtual axis)

Output

d1_Error (WORD, INT, UINT)

Error code

d2_Warning (WORD, INT, UINT)

Warning code

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • 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

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • 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

Example

Global variables

In the global variable list you define variables that can be accessed by all POUs in the project.

POU header

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.

ST body

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;

Modified on: 2022-05-13Feedback on this pagePanasonic hotline