Hi,
I am trying to catch movement errors before they happen so that I can avoid the system crashing. Currently I have found that I should be able to use CalcJointT to detect if the target position is outside of reach. There is a \ErrorNumber parameter that expects a persistent variable, but I cant get it to work. It has no syntax errors if I pass any num value in, but doesnt trigger the error, and ERRNO doesnt change. I cant seen to pass an errnum such as ERROR_OUTSIDE_REACH without syntax errors. Does anybody have a suggestion of how to use this function to raise an error?
FUNC string Test(robtarget rPos, num vector{*})
LOCAL robtarget tPos;
tPos := CRobT(\Tool:=cTool, \WObj:=cObj);
tPos.trans := [vector{1},vector{2},vector{3}];
jointpos := CalcJointT(tPos, cTool, \WObj:=cOb, \ErrorNumber:= ERROR_OUTSIDE_REACH);
RETURN "Success";
ERROR
RETURN "Failed,"+ValToStr(ERRNO);
ENDFUNC