LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

which structure to use?

Hi all,

 I am  a new user and a beginner with labview. I have a pulsed laser which controls the  ICDD camera shutter . I am given the task to control the laser and the camera using labview software. I have written two separate programs. Now to combine these to should I use a stacked sequence or a flat sequence structure. The flow of my task is to set the laser first to pulse with specific frequency and when it starts to function ,the camera to be ON.Can I add these as two tasks using a stack or flat sequence structure.

Thanks in advance

0 Kudos
Message 1 of 9
(4,006 Views)

If you are using any drivers, then there will be error in and error out terminals which will help in controlling the program flow. Post your findings.

 

Mathan

0 Kudos
Message 2 of 9
(4,000 Views)
Generally it is good practice to use a flat sequence to code with. You may not need to have a sequence at all if you use error handling through your code as stated above. The thought here is that it is much easier to trouble shoot your code and watch exicution if the code is all visible.
Tim
GHSP
0 Kudos
Message 3 of 9
(3,989 Views)

I would probably use a State Diagram with the following states :

  1. Set Laser Frequency
  2. Start Laser
  3. Wait for Laser ON
    1. If Laser ON then Start Camera
  4. Start Camera
  5. Shutdown properly

This has the following advantages:

  • If necessary, Initialization can be done before State 1
  • Shutdown can be more organised
  • Someone is going to ask you to do something else while the system is running, so you can perform other functions from State 3 (Wait).

 

 

 

Message 4 of 9
(3,980 Views)
I would second the recommendation to use a state machine rather than any type of sequence structure. State machines are much more flexible and far easier to modify. LabVIEW is a data flow language and in general sequence structures are used to make LabVIEW behave more like traditional text based languages. Start thinking in terms of data flow and architectures like state machines. In the long run they will work much better for you.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 9
(3,963 Views)

 


set the laser first to pulse with specific frequency and when it starts to function ,the camera to be ON.Can I add these as two tasks using a stack or flat sequence structure.

 

 

USe a while loop. Exit the loop  when you get laser pulses. then have our camera functions. 

0 Kudos
Message 6 of 9
(3,930 Views)

 

***************Double post****************

Message Edited by muks on 10-29-2009 10:34 AM
0 Kudos
Message 7 of 9
(3,928 Views)

While loop+event structure is ok for your program

Message 8 of 9
(3,912 Views)

While loop+event structure is ok for your program
Yes. Did you try the suggestions twink?
0 Kudos
Message 9 of 9
(3,907 Views)