11-05-2021 06:10 PM
I set up an NI-DAQmx Task in NI Max reading voltage, and then use that in a simple vi with a while loop. It works fine, but I'd like to reduce the data to SGL precision (DBL seems to be default). There's no "data" line in it (since it's all taken care of in NI Max). Is there a way to change logging from DBL to SGL?
11-07-2021 09:39 AM
MAX can create a Task for you, but except when you are running Test Panels, MAX doesn't save data for you -- you do that with DAQmx (or, shudder, the Dreaded DAQ Assistant).
It is too bad you didn't attach your LabVIEW code showing what you are doing. Yes, the DAQmx Read gives you Analog Data as a Dbl (either as a Dbl Array, or as a Waveform, which contains a component, Y, that is a Dbl Array). There are functions on the Numeric "Conversion" sub-Palette that will convert a Dbl to a Sgl, but in the modern PC era when disk I/O is very fast, and disk storage space is relatively plentiful (and, the Chips that handle Floats inside the PC are probably comparable in speed of processing between Sgl and Dbl), why bother with Sgl?
Bob Schor
11-08-2021 09:49 AM
You could always get the data in RAW format, 16 or 32 bit integers depending on the DAQ card. Once you get the raw data, you could then do the scaling in single precision.
mcduff
11-08-2021 10:44 AM
If you're using the built-in DAQmx logging, I don't think there's a way to change the data type while it logs. You could do it after the logging is complete though.
Mind if I ask why you're worried about it? As others have said, disk space is cheap, and unless you're logging at 1 MS/s for days on end I can't imagine you'd have to worry about disk space.
11-08-2021 11:48 AM
Some people asked to see the VI. Attached are two versions. They're both SUPER simple. The 1st the logging is set-up by NI Max. Of course NI Max doesn't log, so here's the bare-bones VI that will work. The 2nd uses NI Max but sets up it's own TDMS data taking (which I can set to SGL). Weirdly the files are larger when I set up the TDMS logging in the VI (even at SGL) than the NI Max (at DBL). No clue why that is.
The reason I want to limit data size I'm taking 40 channels of data at 100 KHz. It will run for 30 minutes continuously. This DAQ CAN handle it, and seems to work fine, but the files get big fairly quickly.
11-08-2021 12:06 PM
Nothing Attached.
If you are using the built in TDMS logging feature, then the raw data is saved along scaling factors.
I will assume your data is 16 bit, then 40 Channels at 100 kHz is a 8MBy/s data stream. 30 minutes of recording raw data is 14.4 GBytes. You can set up the logging to break up the files such that you don't have one huge file.
11-08-2021 12:08 PM
11-08-2021 12:22 PM
I would not use MAX, something similar to below.