ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using same DAQ for two events

Solved!
Go to solution

Hi everyone!

I created an event structure for two events which use the same hardware for voltage acquisition. I click the boolean for the first event and after a few minutes, I click the boolean for the second event. I have kept the DAQ task inside the event structure separately for each case. Can I know if this would work or if anything else is to be done? I have attached the image and VI with this. Thanks in advance for the help! 🙂

Download All
0 Kudos
Message 1 of 6
(3,105 Views)

Hi everyone!

I created an event structure for two events which use the same hardware for voltage acquisition. I click the boolean for the first event and after a few minutes, I click the boolean for the second event. I have kept the DAQ task inside the event structure separately for each case. Can I know if this would work or if anything else is to be done? I have attached the image and VI with this. Thanks in advance for the help! 🙂

Download All
0 Kudos
Message 2 of 6
(3,103 Views)

Are the two cases supposed to read the same channels?

 

I typically do not like having DAQ inside of an event structure.  I prefer keeping the DAQ in a separate loop, continuously running, and use a Queue, Notifier, or Global Variable to pass the values to other loops.



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 3 of 6
(3,091 Views)

Hi!

Yes, they're from the same channel. I'm using the same hardware so there's only one connection to the board. But I need to read a specific number of samples and after a few minutes, take the reading again. So I placed the DAQ inside the structures separately and ran the program.

So according to your suggestion, if the DAQ is placed separately, how can I separately get the readings? 😞 Is it possible with the global variable? Please help! Also, thank you very much for the suggestion.

0 Kudos
Message 4 of 6
(3,062 Views)
Solution
Accepted by topic author raghav06

If you only care about the latest value, then just use a Global Variable or a Notifier.  Let the DAQ loop capture X data points, calculate the mean, and write to the global.  And have it doing this constantly.  Then you just read the global when you need a data point.  Alternatively, you could use a Notifier just to get a "more up to date" reading.



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
Message 5 of 6
(3,048 Views)

Hi! Thanks a lot for the help! It works fine now with global variable but as said I just get a bit delayed reading. I'll look upon the notifier! 🙂 Cheers! 😄

0 Kudos
Message 6 of 6
(3,036 Views)