07-14-2015 12:55 PM
Hi all,
I am currently using daqmx read and writing the data to a tdms fiile. I would like to change the precision of the data if possible.
Any advice?
Thanks,
Matt
Solved! Go to Solution.
07-14-2015 01:57 PM - edited 07-14-2015 02:01 PM
More information is needed here. What device are you using? Can you share your code? Your question could be pertaining to three different things.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-14-2015 02:02 PM
Hi James,
Im using an NI 9213 in my cDAQ0-9184. Thermocouple themselves are only accurate within about 1 degree so i wanted to reduce the number of significant digits. I was able to do this by getting the waveform data component and going from DBL to fractional string and then fractional string to DBL then building the waveform again. I would assume there might be a cleaner way of doing this?
Thanks,
Matt
07-14-2015 02:06 PM - edited 07-14-2015 02:07 PM
You want to avoid string operations most of the time because they're slow. Are you doing this just for display purposes? You want to see 98.1 degrees instead of 98.0845847?
If it's display purposes, then just change the way your numeric indicators display by editing the properties of the indicator.
If you're trying to save space on file, then there's not much you can do except for convert the data type. You could convert to a single precision float (SGL), which is half the size of a DBL.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-14-2015 03:58 PM
James,
I was simply doing it for display purposes. Its a little bit of false advertising to have 10 digits of precision in the file. HAHA.
I think ill just leave it as it. It is a thermocouple measurement program so the sampling time is going to be around 30 seconds, time isnt a huge concern. I also have it in the consumer loop. But i dont want to be adding additional stress to the computer for really no reason.
Thanks again James,
Matt
07-14-2015 04:10 PM
James,
I did however have another question. If i log data to a table indicator on my front panel, using a shift register to fill the table every data point, will this eventually become a burden on the CPU, and if so whats the largest table i should have on my front panel?
Thanks,
Matt
07-14-2015 04:13 PM
Conveying the right information in the data file is important. It's not a whole lot of overhead to limit your data to a specific precision if you do it as an array operation.
I'm not sure which is faster, the string precision method or this:
This took 1-2ms per 1 million iterations.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-14-2015 04:46 PM
@matt198717 wrote:
James,
I did however have another question. If i log data to a table indicator on my front panel, using a shift register to fill the table every data point, will this eventually become a burden on the CPU, and if so whats the largest table i should have on my front panel?
Thanks,
Matt
Just saw that you asked another question. Yeah, your table will get bigger and bigger and is what we like to call a "memory leak". You can go pretty big and be fine, but it's really just a play-it-by-ear type of thing. Think about how your end user is going to need to see the data. If they onlyy need the last hour of data on the table, then cut it off at an hour of history. If they need the last day, maybe it can handle it, but you might want to look in to limiting what's displayed or something like that.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-14-2015 05:00 PM
James,
The rounding example works perfect, thats a creative way to take care of that problem. I will also look into minimizing my data on the table.
Thanks again for the help,
Matt