GUIDE: Emulate a virtual camera on a VC, RS 6.05

OskarHenrikssonOskarHenriksson Cyberspace mod
edited July 2017 in RobotStudio
RobotStudio 6.05 can emulate a integrated vision camera, this is how you get started:
  • Start RobotStudio(integrated vision is 32 bit only)
  • Create a system with the integrated vision option
  • Edit the file ctrl-name/IV/vc_network_definition.xml and make sure the service port has the following
<VC_NETWORK_DEF>
<PORT name="SERVICE">
<IPaddress>IP_OF_YOUR_COMPUTER(127.0.0.1 does not work)</IPaddress>
<SubnetMask>255.255.255.0</SubnetMask>
</PORT>
</VC_NETWORK_DEF>
  • Warmstart the VC, an unconfigured camera should show up
  • Connect to the camera and rename it(useful if you want to communicate with it in RAPID)
  • Warmstart the VC, the camera shall have the new name, connect to it.
SIMPLE RAPID COMMUNICATION(There are more snippets inside RS):
CONST string myjob := "myjob.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:=[[100,200,300],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
TASK PERS wobjdata mywobj:=[FALSE,TRUE,"",[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
PERS tooldata mytool:=[TRUE,[[0,0,1],[1,0,0,0]],[1,[0,0,0],[1,0,0,0],0,0,0]];
PROC main()
MoveToDetectedObject;
ENDPROC
PROC MoveToDetectedObject()
!Change the camera name
CamSetProgramMode VIRCAM;
CamLoadJob VIRCAM, myjob;
CamSetRunMode VIRCAM;
!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 VIRCAM;
CamGetResult VIRCAM, 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


Further reading: Application Manual - Integrated vision
http://cdn.robotstudio.com/documentation/17.1/en/page8-3.html 

Have Fun!  :)
Post edited by OskarHenriksson on

Comments

  • WillemWillem BE
    Hi Oskar,

    We have used this before, with success.
    Is it correct that you can only emulate a 800x600px camera?
    Our customers often send us pictures from integrated vision when they have a problem.
    When are running a 1280x1024px camera, the images cannot be used in the emulated camera.
    Is there a way to overcome this problem and to emulate a 1280x1024px camera?

    Thanks,
    Willem
  • OskarHenrikssonOskarHenriksson Cyberspace mod
    Willem said:
    Hi Oskar,

    We have used this before, with success.
    Is it correct that you can only emulate a 800x600px camera?
    Our customers often send us pictures from integrated vision when they have a problem.
    When are running a 1280x1024px camera, the images cannot be used in the emulated camera.
    Is there a way to overcome this problem and to emulate a 1280x1024px camera?

    Thanks,
    Willem

    Hi Willem
    You can select camera emulator in RS options(all your systems will be affected):
    Options -> Integrated vision -> Camera emulator -> Camera Model

    Loading and saving images to the camera will be done in the highest resolution that camera supports.

    For an example: ism 1402 has a resolution of 1280 x 1024:
    http://www.cognex.com/products/machine-vision/in-sight-micro-vision-systems/specifications/ 

    Does that work for you?

    Best Regards
    Oskar

  • WillemWillem BE
    Hi Oskar,
    I wasn't aware that more options would appear when Integrated Vision was activated.
    That should do the trick for us.
    Thanks a lot,
    Willem
  • IzaRIzaR Poland
    edited July 2017
    Do you know if there is possible to use camera emulator with virtual controller? I want to send solution from camera emulator to rapid by Output to RAPID. At this moment my code stops at CamGetResult.
  • OskarHenrikssonOskarHenriksson Cyberspace mod
    IzaR said:
    Do you know if there is possible to use camera emulator with virtual controller? I want to send solution from camera emulator to rapid by Output to RAPID. At this moment my code stops at CamGetResult.
    Hi IzaR
    When you get a stop(forever loop) at CamGetResult you have the wrong firmware and camera combination.
    Not all cameras with all types of firmware are supported, it is easy to make an invalid setup (and harder to create a working one). This will be eased in the next big release of RobotStudio.

    In the meantime there is a workaround:
    NOTE: RobotStudio must be connected to the virtual camera.
    RobotStudio Options-> Integrated vision -> Camera Emulator -> Change version and camera model.

    WORKING COMBINATIONS:
    CAMERA                                     FIRMWARE
    ism1100                                       4.10.2


    Please write here if you find another combination that works.

    I hope this solves your problem!
    /Oskar

  • veritasveritas Mullsjö, Sweden
    I have done as the guide suggests and it worked fine for a time. Today, when opening my solution, I couldn't connect to the virtual cam. I turned my firewall off, but it didn't help. I have tried both with RS 6.07 and 6.08 (32-bit). I even tried to remove the integrated option and added it again and redid the whole process, but nothing have worked. On occasion I have had this problem in the past, but it always worked fine after restarting RS. Anyone have any suggestions what might have gone wrong and how I can fix it?
Sign In or Register to comment.