Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i auto detect the target using VBAI Trigger mode

Solved!
Go to solution

Hi everyone, 

 

I got a machine vision system ready to take pictuers using VBAI 2013 sp1.  Also, i am using a sensor switch to trigger the camera to taking pictures. 

 

When i hit the running loop, it just keep taking pictures no matther the sensor switch triggering the camera or not.  I think it is the step i used to logging the image, in the image logging step, i used log image always, but i don't want use this other option which is only when inspection status fails

 

So how can i let the camera wait until it got the trigger signal from the sensor switch, then take a picture, and save the picture?

 

the inspection step for acquire image, i used trigger mode and everything worked fine, except the time error settting up, i used 5000ms, and if i set bigger like 50000ms, VBAI turned really slow and showed time out error. 

 

So can anyone help me on this deal?

 

Thanks

0 Kudos
Message 1 of 5
(3,844 Views)

Hello Rex,

 

How are you configuring your trigger?

 

Information on the Smart Camera's External Trigger feature can be found on page 6-2 of the following document.

http://www.ni.com/pdf/manuals/372429c.pdf

 

If the trigger does not occur, I recommend handling the Timeout appropriately. Please see the following article on trigger Timeouts.

http://digital.ni.com/public.nsf/allkb/6EB535613F30F53B8625727600746345?OpenDocument

 

You could implement it so that when a 5000ms Timeout occurs, it repeats the acquisition step. If the Timeout occurs 10 times, end the process.

 

Regards,

Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,811 Views)

Thomas,

 

Thanks for the reply. And i uploaded my trigger setting picture to let you see. Right now the problem is,

 

The trigger works fine and even i was not triggering, the system still logging and save the picture automatically every 5 secs (time out set in trigger mode). 

 

I am trying build a automatic machine vision system here using external trigger so we don't have to manually hit the button to take and save the picture. 

 

So any advise? 

 

 

1.JPG2.JPG

0 Kudos
Message 3 of 5
(3,783 Views)
Solution
Accepted by topic author rex678805

You can use the state diagram to only go in a state based on the result produced by some steps.

First, remove the image logging step from the Inspect state from you acquire the image

Hit Ctrl+E to toggle the main view to the state diagram.

Right Click and create a new state.

Right Click on the Inspect state and create a new transition towards that new state.

Double click on the transition to edit it.

Choose for Acquire Image - Timeout, and set the condition to False, to transition to that state only when there is no timeout.

Move the default transition of that state to the end state.

Click on the new state to select it, then add the image logging step to it.

 

By using such a state diagram, you programmed an inspection that will log the image only when there is no timeout.

The state diagram is a powerful tool to add logic, branching and looping to your inspection.

Open Tutorial 5 - State Diagram Branching.vbai and Tutorial 6 - State Diagram Looping.vbai for examples on how to use it.

 

Hope this helps.

 

Christophe

 

0 Kudos
Message 4 of 5
(3,778 Views)

That was amazing!

 Learn so much 

Thanks Christophe, you are the best!

0 Kudos
Message 5 of 5
(3,776 Views)