LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling and reading from DAQ

Solved!
Go to solution

So I'm pretty new to LabView in general and I was looking for some guidance on a state machine that I'm building. The idea of it is as follows.

 

Loop until stop(

Output 1 goes high (t=0)

Input read (t=0.5)

Output 1 goes low (t=1)

Output 2 goes high (t=1)

Input read (t=1.5)

Output 2 goes low (t=2)
)End loop

 

I'm looking for help on the best way to set this up from people with more experience. Should I include this all in one big while loop and set up timers and booleans or would it make more sense to set up a separate loop for each component, output1, output2 and input, and time it with a signal? Also looking for advice on how to take a single measurement in this situation. I'm guessing some sort of edge triggered signal would work best?

0 Kudos
Message 1 of 5
(2,450 Views)

What inputs are you reading?  I am assuming the outputs are digital lines.  How exact does your timing need to be?



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(2,427 Views)

I'm reading from the analog input of a USB6003 and creating the signals on the digital outputs. Timing doesn't need to be exact, just needs to be close. The exact spec of the project I'm working on is setting an LED to be on, waiting 0.5s and then taking a reading. After another 0.5 seconds turn the first LED off and another one on. Wait another 0.5s and then take a second reading. So on and so forth.

 

I found the sequential operator and figured that might be a more straightforward way to solve my problem. Thoughts?

0 Kudos
Message 3 of 5
(2,415 Views)
Solution
Accepted by topic author Jaythri

I don't know what a "sequential operator" is.  But if you are talking about a sequence structure where you separate the frames into digital outputs with waits input between, that should work okay for you.

0 Kudos
Message 4 of 5
(2,410 Views)

You might want to consider something more like the JKI State Machine.  It allows you to add several states into a "queue".  This can act as your sequencer.  I would recommend this since it better breaks up your code and becomes easier to add new requirements down the line.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(2,391 Views)