LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Manipulating Daq AI Read Data

Is this possible?
 
I am acquiring data through a 6040E communicating to an scxi with 110x cards acquiring multiple channles at 1 kS/s using LV 8.2.1 and windows. I create global virtuals in MAX with the appropriate map ranges or scalars. I then output the data from a Daq Read N channel N sample 1-D waveform . I perform calculations on the data and display it to a screen while I am saving it during testing.
 
So here's a "for instance" of what I would like to do. I have a pito tube being monitored by two Pressure Transducers. I save the output of the PT's straight to a .tdms file, as well as extract this data from the waveform, perfom calculations to determine an air velocity, and then add this new number back into the waveform before saving it.
 
But the calculated air velocity only exists at about 19 - 20 samples per second (wait ms is set to 50), not the 1000 that I am sampling at. Is there a way to perform the calculation on every data point and save it to the .tdms file, or is my only recourse to convert to excel and perform the calculations there?
0 Kudos
Message 1 of 9
(3,032 Views)

deskpilot,

 

It should be no problem at all to do the calculation on your data.  You can use the functin "Get waveform components" to access the data in the waveform and then use the "build waveform" function to put the modified data back into the waveform. 

 

Another option (depending on your needs) is to create a new channel of data that has the modified value, and write that to the TDMS file along with the raw data.

SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 2 of 9
(3,015 Views)

 You can use the functin "Get waveform components" to access the data in the waveform and then use the "build waveform" function to put the modified data back into the waveform. 


This is basically what I do, except that I "index array" to get the channel out and "build waveform" to put it back in. I will try your way to see if it makes a difference. As I said, the waveform I put back in is now only one point every .05 or so seconds instead of .001 like the rest of the data. Also, the .05 is dependednt on windows execution speed, so the time between points is not exactly uniform throughout the calculated data


Another option (depending on your needs) is to create a new channel of data that has the modified value, and write that to the TDMS file along with the raw data.


 

I think you mean create a second global virtual channel with a scalar that gives me my calculated value. Since my calculation is non linear, I don't think this is feasible, but I will look into custom scales in MAX to make sure. Also, in the case of the pito tube, it is dependent upon two channels, although I am in the process of switching to a single psid PT.

0 Kudos
Message 3 of 9
(3,011 Views)

I was thinking that you would create a new data set rather than tring to modify the exisiting.  The waveform data type is not really well suited to data with varing delta t values.  You may want to create a 2 D array, one that holds the timing value, and one that holds your Y data.  This way you could plot your Y data vs time and it would be accurate.  The waveform data type only allows a constant delta t.

 

SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 4 of 9
(2,995 Views)

I don't want varying dt values, that is just what happens when I perform calculations on it. The program does the calcultion on about every 50th data point. Sometimes it goes 48, sometimes 52 or 53. I want it to do the calculation on every one.

 

 So I guess the only way to do the calculation on every point is to open up the file post test and not use the numbers being calculated during the test for anything besides viewing.

0 Kudos
Message 5 of 9
(2,992 Views)
I guess I'm not understanding your application.  Is there a reason you can't do your calculation on every point?  Can you post an example of what you are trying to do?
SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 6 of 9
(2,989 Views)

Is there a reason you can't do your calculation on every point? 

 

That's the question I'm asking you! Why can't I do a calculation on every point. Here is a sketch of what I am doing. I can give you a screenshot of my real program tomorrow, but its in a different building at the moment. I put the calculated data back in as channel n+1 (acquiring n channels), and I only get about 1/50th the number of data points on that channel.

 

Edit: I just realized my sketch does not show where I add the dt and channel names to the calculated channel, but that has no affect on how many data points I get.

 

Here is my take: the AI read outputs about 50 data points per iteration of the loop, but Labview only performs the multiplication on one of those points per iteration. How do I get it to perform the multiplication on all fifty?

Message Edited by deskpilot on 08-14-2008 02:26 PM
0 Kudos
Message 7 of 9
(2,974 Views)

I have attached an example.  The code you sent me should work the way you want.  The waveform multiply operation will do a point by point multiplication. The two waveforms should be the same size.  The result waveform will already have the same dt of the two waveforms you are multiplying so you should not need to modifiy it.  Another thing to check is to put an indicator on your error output terminal of the multiply function to make sure your not seeing any errors.

SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 8 of 9
(2,967 Views)
I just noticed your using LV 8.2, here is the example in 8.2
SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 9 of 9
(2,966 Views)