08-12-2008 01:05 PM
08-13-2008 09:03 AM
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.
08-13-2008 09:40 AM
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.
08-14-2008 11:08 AM
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.
08-14-2008 11:13 AM
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.
08-14-2008 11:22 AM
08-14-2008 02:23 PM - edited 08-14-2008 02:26 PM
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?
08-14-2008 04:07 PM
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.
08-14-2008 04:09 PM