04-05-2017 05:15 PM
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
04-05-2017 08:20 PM
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.
04-05-2017 08:21 PM
I'm not completely certain that I understand what you want to do, but the following things seem (to me) to be true:
I strongly recommend avoiding the Dreaded Dynamic Wire. You have a 1D array with two elements -- extract them and subtract them!
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
04-06-2017 02:13 AM
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.
04-06-2017 06:39 AM
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