LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Sample Rates

Solved!
Go to solution

Hello all,

New member of the Community but have used this resource extensively to get my VI to where it is, so thank you all in advance for your expertise and guidance!

 

I have two questions regarding the attached VI:

 

1. How can I increase the data acquisition rate for the MIFS task without increasing the rate of the other measurements?

Background:

The MIFS sends a pulse signal proportional to the volumetric flow rate measured, this pulse signal will then be converted to a frequency measurement, then to a flow velocity via a transfer function. Data is measured using an NI9213 analog card. Thermocouples, pump voltage, liquid level sensors, and PMEMFM voltage are measured using a different NI9213 card. 

I have researched/attempted:

Separate while Loops, one for the MIFS acquisition, one for Thermocouples et. al., and one for writing data to file. When using this method a few issues persist. First, the acquisition loop takes priority and neither of the other loops will execute until the program is stopped. I have researched and attempted several different recommendations from other posts to synchronize multiple loops to no avail. Second, the use of local variables between the loops makes everything very slow, and often makes the data saved in the file "out of sync" with itself (thermal waves that happen at a known and recorded time show up at different times on different thermocouples). Finally, multiple while loops require multiple stop buttons, and the program is unable to be stopped without them being pressed simultaneously. I have researched multiple ways to synchronize stop buttons to keep only one on my front panel, but none of those methods were helpful. I have several iterations of this VI saved, so if any of them are deemed necessary to understand the evolution of the VI I can certainly post them.

 

2. How Can I synchronize the 5 waveform charts to show the same time stamps for the X axis?

Background:

The chart for the thermocouples shows todays date/time and scales properly, as desired, while the others show LabVIEW's absolute zero date/time. 

I have researched/attempted:

Set the Offset & Multiplier, X-Scale.Min, and X-Scale.Max to the same values for each chart. When I do this, the charts show no data as that data is 120 some years in the past.

 

My apologies for the novel, hopefully it is thorough enough to get some direction as to where I can improve. If you know of a previous post that answers either question, please post it as I have been unable to find any that I can apply to my VI. 

Thanks again Everyone!

 

0 Kudos
Message 1 of 4
(248 Views)
Solution
Accepted by topic author Narwhal_Jackson

@Narwhal_Jackson wrote:

I have two questions regarding the attached VI:

Oops, I attached the VI using Invisible Ink -- I'll try again ...


You can have multiple labs running concurrently -- you just cannot have a "wire" (not a Channel Wire) run from the "output side" of a Structure (Loop, Case, etc) to the "input side" of a Structure you want to operate in parallel.

 

To help you understand how to synchronize your 5 loops, it would really help to see those loops (and perhaps the entire Project).

 

Charts can show X axis as either "Absolute Time" (where time is in seconds from 1 Jan 1904 UTC, I think) or "Relative Time" (where 0 is seconds since the Program starts).  I think Charts (by default) start out as "Absolute Time", so try right-clicking a Chart, going to Input Format, and see if X Axis is Absolute Time.

 

Note the X axis doesn't need to be Time.  It could be Volts, kilograms, etc., but would then be of type Float or Integer, probably (also chosen here).

 

Bob Schor

 

Message 2 of 4
(211 Views)

Sorry about that! Here is the VI

0 Kudos
Message 3 of 4
(178 Views)
Solution
Accepted by topic author Narwhal_Jackson

You need to scrap this entire mess and start over with a proper program architecture. I know when you are going through the tutorials and making those little demo programs it appears that One Big Loop is how things are done, but as you can see OBL can't be scaled up or changed without affecting everything in the loop.

 

You need to learn State Machine and then Producer/Consumer architectures.

 

IMHO: those two or subtle variants are the most used and program architectures. 

 

Learn the State Machine first as most of the complex architectures like Producer/Consumer and Queued Message Handler use a State Machine at their core.

The Producer/Consumer will teach you about Queues and Channel Wires, that you will need to know to pass data between loops and to handle high speed data collection.

========================
=== Engineer Ambiguously ===
========================
Message 4 of 4
(155 Views)