11-04-2004 02:10 PM
11-05-2004 01:34 PM
11-05-2004 04:07 PM
11-08-2004 12:47 PM
04-14-2009 10:49 AM
Hi,
FYI I'm currently running NI Vision 8.6 and IMAQ 4.1.
I'd like to create a vi capable to acquire single images in order to process them later on. Thus, I have two sequence steps, one for the acquisition and the second one for saving and/or processing.
The error is located in the first step of the sequence so no need to pay attention to the second step.
When i launch the vi, i enter into a loop waiting for the user to press an "acquire" switch. If pressed, its value becomes TRUE and it acquires a single snap image and this works just fine. While the switch's value is FALSE, i'd like the vi to grab automatically images in order to allow the user to rotate/focus the camera on live. pressing the STOP button takes us out of the grab loop and enables to snap an image.
That's where the problem is: when i launch the very same VI step by step and highlighting every step, it works just fine. However, when the VI works by itself, pressing the STOP button returns to me the error 1074397163 about a wrong interface or session at the IMAQ grab acquire Old Style...
Can someone help me out on this one pls?
here's the VI i'm working on. Thanks for any help 😃
04-15-2009 03:46 AM
I managed to work out my problem:
In my previous vi, when launching the vi, one entered a while loop checking whether the user pressed "acquire an image".
If TRUE, the vi acquired an image and passed to the next sequence, no pb.
If FALSE, the vi entered a while loop, grabbing images in order to enable focus of the camera. The pb was when i pressed STOP button, i exit the while loop, then exit the condition structure, then asked again if user pressed "acquire an image" which was most probably still FALSE since i don't have time to press STOP and ACQUIRE so fast.... Therefore, the vi entered once again into the condition structure, then the while loop, and did all the grabbing job again but with an invalid session/interface name since pressing STOP button tells IMAQ close.vi to close the session.
The solution i came up with is to include a condition structure:
Let us enter the while loop asking "acquire an image T/F?"
If TRUE, same thing.
If FALSE, i added a condition structure with a First Call T/F? module. The first launch gives access to the while loop and the grabbing part. When pressed STOP, i exit every loop and ask again "acquire an image T/F?" surely FALSE but this time, it won't be the first call so i won't access the grab loop again with an invalid session name. I would simply highlight the "acquire an image" button, forcing the user to press the button and pass to the next sequence.
I've attached the corresponding vi so you can see by yourselves 😃 i'm aware explaining things like this must be a bit awkward but i'm not a NI engineer so i'm doing my best 😃
04-15-2009 03:48 AM