From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save from 2 While loops to a file

Hello everyone,
 
for a measurement application I use a analog Input Modul (USB-6210, 250kS/s) and a CDAQ-9171 with a 9211 thermocouple Modul.
In the *vi you can see both DAQ Assistants, each in one while loop. For the 6210 i use a much higher frequenzy than for the thermocouple.

The while loop i saved in, is the faster one. 

 

Now my problem ist that i want to generate one file with the data from both loops. For exampel the file should look like this:

 

 

analog Input1     analog Input2    thermocouple1    thermocouple2    thermocouple3    thermocouple4

analog Input1     analog Input2

analog Input1     analog Input2

analog Input1     analog Input2

analog Input1     analog Input2

analog Input1     analog Input2


analog Input1     analog Input2     thermocouple1       thermocouple2       thermocouple3     thermocouple4

 

I tried a lot but Nothing worked well. 

0 Kudos
Message 1 of 6
(2,135 Views)

Hi Sven,

 

I tried a lot

What did you try?

(Did you try to go over those "Training resources" offered in the header of the LabVIEW board?)

 

but Nothing worked well.

So it worked. Why don't you attach your "working" solution?

What was "not well"?

 

Why do most frontpanel elements in your tiny VI miss their label?

Why do you need 3 loops, stacked into each other?

 

Now my problem ist that i want to generate one file with the data from both loops.

When you want to stick with ExpressVIs (where most people will advise not to) you could use one more ExpressVI: MergeSignals…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,114 Views)

Your code seems as basic level stuff and to acquire datum from a hardware, it doesn't need these many loops. First of all go though this link to get know idea about basic LV design patterns,

https://forums.ni.com/t5/Developer-Center-Resources/Scalable-Design-Patterns-in-LabVIEW/ta-p/3534309... 

0 Kudos
Message 3 of 6
(2,106 Views)

You are using Express VIs, which are usually designed for beginners who want to do one basic simple thing.  They tend to be "simple-minded", designed to "trick" people into thinking LabVIEW doesn't require "learning" ("It's so simple, it's all pictures, you don't need to study ...").

 

Think about the problem of having two different Data Streams, at two different time intervals and with possibly two different starting times.  You would need a somewhat-sophisticated file system to write them both to the same file.  It can be done, but is often messy.

 

Why not two "simple" files, one for each stream?  You can probably do it right in the Express VI (but do, as soon as you can, learn about DAQmx for doing Data Acquisition ...).

 

Bob Schor

0 Kudos
Message 4 of 6
(2,064 Views)
Hello Gerd,
thank you for your questions. I have tried different variations of connections.
The best was to draw a connection between the two loops in the existing VI. I placed the output of the Temperature Assistant directly on the writing input.
However, the speed of the VI or the memory rate was far too slow.
 
If i worked with less loops i got the same Problem with the memory rate.
 
0 Kudos
Message 5 of 6
(2,037 Views)

Hi Sven,

 

I placed the output of the Temperature Assistant directly on the writing input. However, the speed of the VI or the memory rate was far too slow. If i worked with less loops i got the same Problem with the memory rate.
You don't "draw connections", you wire the dataflow. (Did you take the Training resources offered for LabVIEW beginners?)
The "speed of the VI" surely is ok. I don't know which "memory rate is too low"…
 
Iteration speed is determined by the speed of the DAQmx read operations. Thermocouples usually are very slow…
 
 
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,024 Views)