LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Data out of while loops

Was wondering if there is a way to pass data out of multiple while loops and into a single simulation loop. I have tried shift registers but I am not very experienced with labview so any insight is appreciated.

0 Kudos
Message 1 of 5
(3,209 Views)

1.  What hardware are you using?  For most DAQs, you could combine all three of those DAQ Assistants into a single one and get all three sensors with a single read.

2.  I am not seeing the purpose of the simulation loop.  I do not have the simulation toolkit installed, but it looks to me like you are just displaying the data.

 

So my point here is that it looks like you could do everything in a single loop that is just a single DAQ Assistant and a chart.


GCentral
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
(3,192 Views)

As Crossrulz mentioned, the three DAQ loops, which will run in parallel but will not be otherwise synchronized (and might be "competing" for a single piece of hardware) are probably all addressing the same hardware and would be better configured as three simultaneous channels of a single hardware device.

 

If you are serious about learning some LabVIEW and taking advantages of its ease of use and sophistication, you might want to read Learn 10 Functions in NI-DAQmx and Handle 80 Percent of your Data Acquisition Applications.  I pointed you to the Article, but there is also a Video you can find with a Web Search.

 

Finally, a common way to handle simultaneous processing of incoming Acquired Data is with another "simultaneous" construct called the Producer-Consumer Design Pattern.  If you open LabVIEW, go to File, New ... (the dots are important), and look at the Templates, there's a Producer/Consumer Design template for Data that you can examine that will illustrate this principle.

 

Study all these suggestions, try implementing them, and come back with an "improved" VI if you need more help.

 

Bob Schor

 

P.S. -- thank you for attaching a "real VI" instead of a (mostly useless) "picture".

Message 3 of 5
(3,175 Views)

I tried to run the Vi with a singular loop and one daq (6008-usb) but I would get an error that the daq could not keep up. I tried adjusting the sampling rates but could not find a combination that would work so that is the reasoning behind the 3 separate loops.

As for the simulation loop I accidentally  attached an older Vi (sorry). The purpose of the simulation loop was to simulate an ECG circuit constructed in multisim as our facility is unable to obtain the components to physically construct one.

Ideally the system would beheave like a 3 Lead system which I could attach to myself and get a reading somewhat similar to an ecg QRS waveform.

Download All
0 Kudos
Message 4 of 5
(3,158 Views)

Are you really reading ECGs (electrocardiograms)?  Your sampling rate is much too high, and you are taking far too many samples at a time.  You may also be getting "blocked" by the behavior of the Dreaded DAQ Assistant.  My students have implemented multi-channel data acquisition of a three-channel accelerometer using continuous sampling at 1KHz, taking either 10 samples at a time if they want to create a smoothly-scrolling Chart display or 1000 samples at a time if they want to see graphs of signal + noise.  No problem at all -- it takes three DAQmx functions (Start Task, Read, and Stop Task) plus defining a Task with MAX.  The White Paper I cited in my earlier response will show you how to do this.  It should take you 10 minutes, maximum (not counting the reading and thinking about it).

 

Bob Schor

0 Kudos
Message 5 of 5
(3,134 Views)