LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real Time Data Acquisition and Mathematical Operation s

Hi,

I'm still pretty new to labview, but I was wondering if it is possible to collect sensor data and conduct mathematical operations, from the acquired sensor data, simultaneously.

 

Currently, I'm reading the temperature data from 2 RTDs and I would like to know the temperature difference between the two of them to use as the input value for a different VI. Basically, I want to get a scalar value each time the waveform chart updates (in a while loop) and use that as the input value.

 

I've been using the 'convert from dynamic data' command, but nothing seems to be working for me.

 

Code for reference and image showing what I mean.

 

Thanks

Download All
0 Kudos
Message 1 of 5
(3,343 Views)

On mobile, so can't look at your VI.  But it sounds like you are using the DAQ Assistant.  So use the Convert From Dynamic configured to output an array of waveforms (assuming multiple points per read).  Then you can use Index Array to get your two waveforms.  Subtract these.


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,299 Views)

I'm not completely certain that I understand what you want to do, but the following things seem (to me) to be true:

  • You are sampling from two channels.
  • You are sampling at 1KHz continuously with a sample size of 1000.
  • The above means that every second, you get two channel's worth of 1000 points.
  • You have chosen to output your samples as a 1D array of Waveform -- this means that your DAQ output is two waveforms, 1000 points at a time.

I strongly recommend avoiding the Dreaded Dynamic Wire.  You have a 1D array with two elements -- extract them and subtract them!

Subtract Waveforms.png

Now, with a waveform (basically an array) of 1000 points representing the difference between your 2 channels coming in every second, what do you want to do with this difference?  Do you want to average these 1000 differences?  Do something else with them?

 

Bob Schor

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

Hi,

 

Thanks for the reply.

 

Just wantef to add that the sampling rates and no. of samples is completely variable and can be changed by the user. What my intention with the program is that while the while loop is running, each time labVIEW acquires temperature data from the 2 RTDs (at what ever rate settings the user wants), it would subtract the two values and convert it to a floating point number. 

 

This floating point number would then be used as an input for PI controller (and compared to a set point) to control a heater.

 

Thanks, 

I hope this clarified somethings and I will try out what you've said soon.

0 Kudos
Message 4 of 5
(3,262 Views)

I think I understood that (and my code does just exactly what you said, whenever you get data, it provides the difference between Channel 1 and Channel 2).  You say that every time LabVIEW acquires temperature data, it converts it to a floating point number (singular).  My question is what do you do when you get 1000 points each time "LabVIEW acquires temperature data"?  Do you want 1000 numbers or 1 number?  And, if the latter, how do you want to compute it?  Maximum, minimum, mean, median, something else?  [It really doesn't matter to me, and you don't need to actually answer this, but my concern was that you might not have thought of this point].

 

Bob Schor

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