Get axis status of positioning unit
This FP instruction reads the status data from 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 result is stored in d1_Status.
Input
Slot number
Axis number
Values: 1–4, 8 (virtual axis)
Output
Status information
Types of axis status information
Bit |
Status information |
TRUE |
---|---|---|
0 |
Tool operation |
during tool operation of any axis configured with Configurator PM |
1 |
Error |
if an error occurred on the specified axis |
2 |
Warning |
if a warning was issued for the specified axis |
3 |
Busy |
if the specified axis is operating |
4 |
Operation done |
if operation is completed on the specified axis |
5 |
Home return done |
if home return is completed on the specified axis |
if the area specified using the index modifier exceeds the limit.
if the slot and/or axis number 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
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.
VAR
bStart: BOOL:=FALSE;
iSlotNumberPositioningUnit: INT:=0;
(*slot unit where the positioning unit is assigned 1- 64*)
iPositioningUnit_Axis: INT:=0;
(*Axis of the positioning unit to obtain status for (1-4: axis; 8: virtual axis)*)
dutPositioningUnitAxisStatus: BOOL16_OVERLAPPING_DUT;
(*Status of the positioning unit axis:
b0: Tool operation
b1: Error annunciation
b2: warning annunciation
b3: busy
b4: operation done
b5: home return done*)
END_VAR
When the variable bStart is set to TRUE, the function is carried out.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_F,FP_POS_UNIT_GET_STATUS!,,17,1,31,6,,?DEN?Ds1_Slot?Ds2_Axis?AENO?Cd1_Status);
B(B_VARIN,,iSlotNumberPositioningUnit,15,3,17,5,);
B(B_VARIN,,iPositioningUnit_Axis,15,4,17,6,);
B(B_VAROUT,,dutPositioningUnitAxisStatus.w0,31,3,33,5,);
B(B_CONTACT,,bStart,3,2,5,4,);
L(5,3,17,3);
L(1,3,3,3);
L(1,0,1,6);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF bStart then
FP_POS_UNIT_GET_STATUS(s1_Slot := iSlotNumberPositioningUnit,
s2_Axis := iPositioningUnit_Axis,
d1_Status => dutPositioningUnitAxisStatus.w0);
END_IF;