Vision inspection Auto reset code.

  • Anyone experienced with using Cognex vision Inspection & constantly dealing with wait Conditions.

    44: DO[86:OFF:Part1Insp2Trig]=ON ;

    45: WAIT DI[88:OFF:Part1Insp2Comp]=ON ;

    46: DO[86:OFF:Part1Insp2Trig]=OFF ;


    Researching Code for the robot to automatically trigger the camera trigger if in a wait condition.

    Such As:

    IF (WAIT DI[88:OFF:Part1Insp2Comp]=: ON ) THEN DO[86:OFF:Part1Insp2Trig]=ON

    46: DO[86:OFF:Part1Insp2Trig]=OFF ;

    Any New Ideas are appreciated.

    SRT_ Automation

  • AD
    • Helpful

    The first example you gave is the standard way of triggering a camera.

    1. Turn camera trigger signal ON.

    2. Wait for camera to turn ON "inspection complete" or "exposure complete"

    3. Turn camera trigger signal OFF.

    It looks like you want to combine this into 1 line such as:

    1. Turn camera trigger signal ON until "Inspection complete" is ON, then turn camera trigger signal OFF.

    I don't think there is any Teach Pendant Program command to combine those steps.

    There is the option to PULSE the DO which will turn it on for an amount of time and then turn it off. You could maybe PULSE the camera trigger signal if that seems more efficient to you.

  • What are you trying to accomplish? Is the robot stuck just waiting for the input to come on? If so, you can use the WAIT DI[88]=ON, TIMEOUT,LBL[x] instruction to jump to a label if the input does not come on within a specified time.

    The timeout period can be adjusted with $WAITTMOUT=XXX where XXX is in hundredths of a second.

  • pdl,

    This is to auto reset the robot & retrigger the camera signal if the Robot is froze at the wait for DI[ ].

    The pulse DO [ ] worked this morning but the image was too dark causing 100% reject rate so I had to revert back to the original code.

    WAIT DI[88]=ON, TIMEOUT,LBL[x] instruction will work I just have to implement when there is scheduled downtime to test.

    Thank you for the feedback.


  • I'm confused, from your previous post, it sounds like you got it to trigger exactly how you needed it, but due to bad lighting, you had to revert back to old code? Why not just keep the same code, but find a solution to your lighting? Or maybe I didn't understand your post correctly.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now