02-05-2016 10:10 AM
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
Solved! Go to Solution.
02-08-2016 10:34 AM
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,
02-10-2016 04:33 PM - edited 02-10-2016 04:34 PM
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?
02-10-2016 04:50 PM
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
02-10-2016 05:01 PM
That was amazing!
Learn so much
Thanks Christophe, you are the best!