08-27-2018 02:20 AM
Hello,
I am trying to develop an application using IMAQdx to communicate with my camera connected via USB. This application is supposed to set certain parameters such as image height, width, X-offset and Y-offset at run time, then capture the images. On start up of the vi I can set the parameters as I want them, but when I go back to the settings page to put in new settings, the new settings don't seem to take.
I have checked and know that the height and width settings can only be set when the camera is not grabbing. But I can seem to find any thing to stop the grab. I tried using the "stop acquisition" but that too does not seem to work.
I have attached my Vi.
Help would be greatly appreciated.
Thank you,.
Solved! Go to Solution.
08-27-2018 08:50 AM
The problem is (I think) an improper use of the Event Structure + a failure to understand how Boolean Controls work with the Event Structure. Let's examine your code and what might be happening (I don't know the order you "push your buttons").
I now think the problem is you might be trying to push Save Settings while Grab was in force, thinking it would override the Acquisition, but as I argue above, it cannot. I also thought that having Save Settings outside its Event Case was going to cause problems, but in your situation, it (luckily) doesn't.
What you probably really want is a State Machine, with a parallel Event Loop able to change the "Next State" (possibly via a Notifier or a Tag). Ordinarily, if doing a Grab, the Next State would, again, be Grab. If the User "turned off" Grab, the Event Loop would change Next State to "Stop Acquisition". If the User pushed "Save Settings", the Event Loop would change Next State to "Save Settings".
Bob Schor
08-27-2018 10:09 PM
Hi Bob,
Thanks for your reply. I'm still learning Labview while at the same time trying to develop an application using VAS, so any input it welcome. I appreciate your step by step analysis as it allowed me to pick up somethings regarding how the data flow is happening in my application.
I have implemented your suggestion by having a local variable monitor my "Grab" button, and on false I had the case statement stop the acquisition. Now I can properly set my camera settings.
Thank you very much.