Fanuc communication with Keyence vision controller

  • Hello,

    I am using a Fanuc SCARA that is connected to a vision controller from Keyence (CVX 320A). There are 2 stationary cameras connected to the vision controller in order to pick 2 different parts from 2 different surfaces.


    I received a couple of Karel programs from keyence to communicate with the vision controller. But whenever I trigger the cameras, only one camera is actually triggered and sends the coordination of a part (works quite well actually). But the other one is never triggered. I know that there is something missing, I just don’t know what it is. Probably another argument that I have to send to the camera...


    Code is:


    12: !Opens the connection.

    13: CALL KEY_CONNECT

    15: !Issues the trigger.

    16: CALL KEY_SEND_CMD('TA')

    17: !Waits for the reply and

    18: !sets the reply to R20.

    19: CALL KEY_WAIT_CMD('TA',20)

    20: IF R[20]<>0,JMP LBL[999]

    21:

    22: !Receives the values and

    23: !sets received values to R30,31,.

    24: CALL KEY_RECV_VAL(30)

    25:

    26: !Moves to the detected position.

    27: IF R[36]<>0,JMP LBL[1]

    28: PR[10,1]=R[30]

    29: PR[10,2]=R[31]

    30: PR[10,3]=R[32]

    31: PR[10,4]=R[33]

    32: PR[10,5]=R[34]

    33: PR[10,6]=R[35]

    34:L PR[10] 400mm/sec FINE

    35: LBL[1:MOVE END]

    36:

    37: LBL[999:END]

    38: !Closes the connection.

    39: CALL KEY_CLOSE



    I’d really appreciate any help :smiling_face:

  • Did Keyence tell you the expected behavior for this setup?

    Does CALL KEY_SEND_CMD('TA') send a trigger to both cameras?

    Should CALL KEY_RECV_VAL return the detected position for both cameras?


    I guess that Keyence gave you the the compiled Karel file (.pc) and not the source file (.kl)?

    If you have the source files then you could check the Karel code to see the commands they are using.

  • So I figured it out now, thank you for your reply.


    TA does trigger all of the cameras connected to the controller. The KEY_REC_VAL returns the detected position for both cameras and saves them in the register and the following of the argument.

    T1 / T2 does either trigger camera 1 OR 2. To do so, you have to set the trigger in the camera setup on the vision controller to "asynchronous trigger" ("camera configuration" -> "extended settings"). Then it is possible to trigger the cameras independently and to set the detected position to different registers.

Advertising from our partners