RobotStudio event

CamGetResult turns up results in RobotStudio but not while running on FlexPendant

Hi All,
I've tried running the default code for Integrated Vision - Move to detected Object, by programming it to pass when it sees a particular sample (PatMax Pattern). It takes the picture, and even shows up as "Pass" on RobotStudio, but it gives no results when actually running through the FlexPendant. Any comments on what I might be missing? My dice so far is:
MODULE CamTest
!Change the job name
    CONST string myjob := "DemoJob.job";
    VAR cameratarget mycameratarget;
    
    !Declare robtarget, workobject, tooldata and, in case the camera is
    !mounted on a moving part of the robot, the imaging position.
    CONST robtarget myrobtarget:=[[100,200,300],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
    CONST robtarget myimagepos:=[[42.13,289.74,111.51],[0.504858,-0.521207,0.486813,-0.486287],[0,0,1,4],[106.613,9E+09,9E+09,9E+09,9E+09,9E+09]];
    PERS tooldata mytool:=[TRUE,[[0,0,1],[1,0,0,0]],[1,[0,0,0],[1,0,0,0],0,0,0]];
TASK PERS wobjdata mywobj:=[FALSE,TRUE,"",[[33.9546,283.018,-45.5154],[0.998702,0.0370576,0.0176448,0.030155]],[[0,0,0],[0,0,0,0]]];
    
    PROC MoveToDetectedObject()
        !Change the camera name
        CamSetProgramMode CameraL;
        CamSetExposure CameraL \ExposureTime:=1;
        CamLoadJob CameraL, myjob;
        CamSetRunMode CameraL;
        
        !If the camera is mounted on the robot, store this position during setup
        !so that the robot may always return to this position before requesting an image.
        MoveL myimagepos, v100, fine, tool0;
        
        CamReqImage CameraL;
        CamGetResult CameraL, mycameratarget;
        mywobj.oframe := mycameratarget.cframe;
        
        !During the first cycle, run the program until this point,
        !then jog the tool to the desired grip position and modpos myrobtarget.
        MoveL myrobtarget, v100, fine, mytool \WObj:=mywobj;
    ENDPROC
    

ENDMODULE

Any Help would be much appreciated!

Answers

  • Check your output to rapid settings
  • Yep, I tried that. It was all set to the right Pattern in the group settings. Unfortunately, I never got to the bottom of it in that instance. I redid the thing from scratch and it suddenly worked. Dunno what I did wrong the first time around, but thank you for the help!