LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem replacing a While loop in a Camera

Hi,

 

Let me explain a little the problem, this program works good when using in an flat sequence structure divided in 4 parts and in the third part there is a while loop. I was going to change it to set everything but the start camera and the parameters outside a while loop as i did with others drivers, however when using that, the first call library function node just liberates two numbers, zero and later 1 and it can not be changed those parameters. So, the only easy way to make it work was in this flat sequence but i am not that confortable, always that i use stop i have to close the labview and open it again because it does not work well when i stop and i try to initialize it again.

The second problem are suggestions just to change the While Loop in the third block of the flat sequence structure, i was thinking that that possibility could work well, but i tried changing it by others structures and is not working well.

 

Thanks for any help you can give me

0 Kudos
Message 1 of 3
(2,628 Views)

If you remove the flat sequence, you neet to fix all the race conditions due to the blatant overuse of local variables.

0 Kudos
Message 2 of 3
(2,586 Views)

I will buy a keyboard where I have three extra buttons, one for the words "State Machine", the other for this link: http://www.ni.com/newsletter/51735/en/ , and the third for the free LV learning options ( https://decibel.ni.com/content/docs/DOC-40451 "Looking For Free Training") 🙂

 

If you have to deal with a DAQ, and you want to change parameters time by time, and restart the acquisition after that, the answer is State Machine.

Using a State Machine you can have certain states to execute different tasks in a proper manner:

  1. Idle (LabVIEW app (exe!) started, application is waiting for user interactions)
  2. Init (DAQ reasources are initialized based on parameters given by user at step 1)
  3. DAQ running
  4. Stop DAQ (Go back to Idle)

These steps are for example, of course you can have different setup or more steps, like File recording, etc...

0 Kudos
Message 3 of 3
(2,573 Views)