I need to check that the current angles of axis joints 2,3,4,5 & 6 match the angles defined in Jointtarget_1. As a test I have positioned the robot so that only the angle of joint 1 differs from the angles defined in Jointtarget_1.
Here is my code:
CONST jointtarget Jointtarget_1 :=[[54,-36,24,0,-26,45],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR jointtarget Jointtarget_2;
PROC aTest()
!Copy current joint angles to Jointtarget_2 …
Jointtarget_2 := CJointT();!Copy Joint #1 angle from Jointtarget_1 to Jointtarget_2 …
Jointtarget_2.robax.rax_1:=Jointtarget_1.robax.rax_1;!Now Jointtarget_1 and Jointtarget_2 are equal …
IF Jointtarget_1 <> Jointtarget_2 THEN
!Targets not equal
ErrWrite “Targets not equal”,“”;
ENDIF
ENDPROC
When the code executes the error message is displayed although the joint angles viewed in the Watch window and FlexPendant are identical:
Jointtarget_1 [[54,-36,24,0,-26,45],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]
Jointtarget_2 [[54,-36,24,0,-26,45],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]
If I substitute the conditional test with ‘IF Jointtarget_1 <> Jointtarget_1 THEN’ the test works correctly and the error message is not displayed.
Can anyone replicate this behaviour or explain what is going wrong?
Thanks,
Kevin