Hi,
I have a situation whereby I need to know the robot position relative to robroot continuously. Currently when $ACT_BASE is set to an assigned base the $POS_ACT position is relative to the origin of the base.
I have the below code in the SPS, but occasionally the SPS stops. This is due to the fact that $POS_ACT, $ACT_TOOL or $ACT_BASE can have a state where they are uninitialised (i.e. null) and also the SPS and Robot Program run with different interpolations.
IF ((VARSTATE("$POS_ACT") == #INITIALIZED) AND ($ACT_TOOL>0) AND ($ACT_BASE>0)) THEN
TCP_ACT=BASE_DATA[$ACT_BASE]:$POS_ACT
ENDIF
IF ((VARSTATE("$POS_ACT") == #INITIALIZED) AND ($ACT_BASE==0) AND ($ACT_TOOL>=0)) THEN
TCP_ACT=$POS_ACT
ENDIF
I have looked at doing this via an interrupt but as stated previously I need it to run continuously.
I need to try reading the variables into local SPS variables, and perform my checks on the local variables, this may improve things?
I was thinking about getting a handle on the variable $ACT_BASE and performing the calculation in my plugin?
Does anyone know of a different approach to this?
Cheers.