LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

General advice on first DAQmx labview application for data acquisition.

Hello LabView professionals,

 

I just made my first LabVIEW application for a project at work. I still have a lot to learn and therefore wanted to ask some general advice on how I could improve this program.  

The program is dedicated to a test facility where pressure, temperature and flow measurements are conducted.

 

I need to acquire:

At 50Hz: 4 Validyne sensors (pressure), 4 RTD sensors (Temperature), and two flow meters (Coriolis meter)

At 3Hz: 3 thermocouples at certain locations in the test circuit, 15 thermocouples that are quite close together in a specific section of the facility to measure the wall temperature of an object.

At 10kHz: 2 Kulites (pressure)

 

The program runs continuously, and recordings can be made at some points.

 

I know my biggest mistakes are in how I handle the data from the daqmx read, in the subVI's display and alarms. I save all acquired data in an array of waveforms in a cluster (read subvi), then extract one by one the Y values from certain indexes in the big array to manipulate them. I do this because I convert to XY graphs as I want to keep the history of the graphs, always with 0sec at the origin. And, with the array of data, I can easily multiply or add the calibration parameters, given that they are in the same order. 

 

My question is thus mainly, how can I avoid all the individual waveform Y component manipulation, or how can I put this in a for loop (I have trouble with the for loops combined with clusters). But if you have other recommendations to make my code better, I'd be more than happy to hear them! 

With my best regards!

Mikel

 

0 Kudos
Message 1 of 5
(1,119 Views)

DAQmx Channels can have Scales.  Yup, apply the Scale to the Channel while creating the Tasks and you simplified all that silly repetitive work. 

 

And if you read the tasks as 1D waveform Arrays t0 and dt align the individual task data perfectly. 

 

Also known as an "Hey, this roundish gizmo I worked hard to make looks like a WHEEL!" coding problem. (We've all been there) 😀


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 5
(1,094 Views)

Thank you very much for the reply.

I could indeed set the scales to the task of the channel. But I want to save the raw data in the tdms file. Is there a way to still differentiate between raw and scaled signals when the scale is applied to the task?

 

What do you mean by the waveform reading? I do read in 1D wfms, but I extract the Y values to save them in an array and display all data on XY graphs (full signal history on the screen). I struggled a lot to get this with a waveform chart or graph...

I do use the t0 to get the elapsed time starting from 0sec, and save it like that.

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

Ah Ha

A TDMS log file!  Have you enabled DAQmx Logging?  The scales will be added to the TDMS log so, of course you could recalculate the useless raw values that the user probably never wanted to see anyway. 

 

Get the user to tell you a "Story."  You'd be surprised how vastly different the User's Story is from the programmer's assumptions in most cases.  I can't tell you how many wasted coding kilohours it takes to learn that tidbit on your own. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(1,063 Views)

Next, I'd love to see how the DAQmx stuff is configured in your project.

 

Assuming you created the Tasks and Scales in the lvproj file (if you didn't, shame on you! Go back and do that)

 

Just open the. Lvproj file with notepad or any text editor and copy the <DAQmx> to </DAQmx> node inline in your reply.

 

Yes, I'm working without a LabVIEW viewer on my phone. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(1,060 Views)