01-07-2010 12:57 PM
I am doing high speed measurements with multiple channels simultaneously and am wishing to be able to store both the raw data and the scaled version of the data at once in single tdms file. However, I am wishing to be able to apply properties to the scaled and un-scaled versions separately, mainly to keep the data clean and usable, along with ensuring that in 6 months when we are looking at old data to make reports nothing gets confused. I know that multiple virtual channels can be set per a physical channel, but then they have to be read sequentially. Is there any way of simulating this process, or giving another data stream separate properties to be written to the tdms file?
Solved! Go to Solution.
01-07-2010 01:19 PM - edited 01-07-2010 01:24 PM
When you are referring to virtual channels, are you talking about DAQmx? If so, are you familiar with the DAQmx 9.0 feature to log data to a TDMS file designed for high speed?
http://zone.ni.com/devzone/cda/tut/p/id/9574
As well, can you describe a bit more detail about what you are currently doing? That is, if you're using DAQmx, are you calling DAQmx Read Raw and DAQmx Read (for scaled data)?
If you're not using DAQmx, what do you meanby "apply properties the scaled and unscaled versions separately"? Are you storing these as separate TDMS channels?
01-07-2010 04:41 PM
From the top, yes i am refering to DAQmx, and I only have LabView 8.5 so i don't think i can use DAQmx 9.0 though the feature would be usefull. I am using DAQmx Read, and don't have read raw unless thats something one can download and i didn't find in a quick search. As far as applying properties seperately, even though i am using DAQmx, i wish to speicfy within the tdms file that one has been scaled and one has not, and keep both in the same file with sensor, test, and opperator info. This is in part becaus we have multiple people working on a couple projects part time and with scaling values of 1.0xxx it isn't always apparent which one is the right data stream, along with the people who did the test might not be able to work on the project next time the data is looked at.
Here is a simplified verson of what we are currently doing to recored both the unscaled and scaled data as two seperate files. Sorry for the poor organization and multiple criscrossing wires. At least it's a small one.
01-07-2010 05:04 PM
I think the only way you will be able to do this is to read the data unscaled and then apply the calibration yourself. You can query the device scaling coefficients through Channels>Analog Input>General Properties>Advanced>Device Scaling Coeffieints. Those are the values DAQmx uses to convert the unscaled readings to voltages. You can apply them by either a Polynomial Evaluation or, just mx+b. You will need to split your data wire to make a copy and then you can save the unscaled and scaled data in your TDMS file. You can also save the scaling coefficients in the TDMS file too, so you know how you got from unscaled to volts.
I'm curious though, why you don't save the unscaled data and the conversion factors rather than two copies of your data. At 2.5MS/s, you will be using a lot of disk space. We record lots of high speed data as unscaled integers with their conversion values. If we saved everything as two doubles, we'd never be able to keep up with the data, and our hard drives would scream at us too.
01-07-2010 05:12 PM - edited 01-07-2010 05:14 PM
First of all, DAQmx 9.0 supports LabVIEW 8.2 and later, so you would be able to use the new feature. That being said, for your application, it wouldn't work that well since you are wanting to store the original DAQ signal as well a further scaled signal. This feature stores the data as you would see it in DAQmx Read. The scaling information that you are applying could be performed by using a custom scale in DAQmx, but you would "lose" the original (raw) data. However, if you store the scaling factor in properties (as explained below), you could get back to the original data at a later point (by dividing by the appropriate scaling factor). If you are acquiring data at 2.5 MS/s, you might consider this solution in the interest of performance.
That being said, if you need separate signals for raw and scaled, this feature might not do what you're wanting.
Therefore, in answer to your immediate question, if you want these signals to be in the same TDMS file, that's very possible. Here's the feedback looking at your VI to make that possible:
1. On the TDMS Write call, wire in a "Group Name" such as "scaled" or "raw". That will split off the data appropriately to make it obvious what's what.
2. If you want some additional information to be stored with the group (like the scaling factor), wire in your group name into the TDMS Set Properties VI that you currently have and set "property names" and "property values" appropriately.
3. Of course, wire in the same TDMS refnum to all of the TDMS functions.
Let me know if you have more questions on this.
01-08-2010 12:44 PM
Thanks a lot for the help. Andrews solution seams like it will work great, i'll just wait till i get back to that lab monday and can test it.
Thanks for your time!