LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

daqmx tdms, add external value to log file

Solved!
Go to solution

Hello,

 

I would like to know, if it is possible to continously add an external double value to the TDMS file which is created by the DAQmx Configure logging (TDMS) VI?

So for example, I collect double data from 8 DAQmx channels, with 1 Hz speed (Analogue 1D double). I get these 8 values with the corresponding time stamps nicely in the created TDMS file. Is there a way to "tunnel" an external double value to the same TDMS file?

 

If there is no such a option, I will just configure the TDMS logging explicitly not via the DAQmx driver.

Thanks!

0 Kudos
Message 1 of 8
(2,653 Views)

Hello, I just decided to log the data externally to a TDMS file, so I have more flexibility.

 

I have a task where I have to measure some voltage levels from a module of a cDAQ, and some current levels from another module (same cDAQ device).

I need to do scaling differently for every channel. Please comment my example VI which I have attached. Recently I do not have the hardware, so I use a simulated device, and with this VI right now, I only get 0 values out from the channels (i guess i should get some simulated sinus wave?).

Moreover, when I stop the VI, I get a TDMS reference invalid error msg from the Close TDMS.

If someone could help me, how to do this task properly...?

thanks very much!

 

edit: by mistake I swapped module1 and module2 channels for the ActiveChannels propnode in the FOR loop. I fixed it, but I have the same TDMs error...

0 Kudos
Message 2 of 8
(2,635 Views)

replace file reference in for loop with shift registers rather than tunnel.

0 Kudos
Message 3 of 8
(2,622 Views)

hm, i can only test tomorrow, but why should I use shift register? I think the TDMS file ref should not change during the while loop iterations...?

anyway, I will check it tomorrow, and the DAQmx scaling is also still an open question...

0 Kudos
Message 4 of 8
(2,620 Views)
Solution
Accepted by topic author Blokk

with any possibility of foor loop iterating zero time will give you default value of reference so your reference will not be valid in that case.

Message 5 of 8
(2,614 Views)

the for loop is iterating, it runs, led blinks...

Error msg appears when I click on Stop button, and i stop the for loop.

 

Edit: actually it is a while loop 🙂

0 Kudos
Message 6 of 8
(2,611 Views)

sorry Neos 🙂

Actually you are just right, I forgot about the small for loop inside the while loop. Since the DAQmx read does not give data (still something wrong with my DAQmx config or the simulated card), the double array size is zero. Therefore the FOR loop does not iterate, so the TDMs file ref goes invalid.

Thanks! 🙂

 

ps.: So the problem is my DAQmx configuration. Please someone "DAQmx expert", could you help me with this scaled DAQmx example? 🙂 thanks!

ps2.: when I only try to take the first module's two channels, I can read data from the simulated device. If I also try to read the 4 current channels, I do not get data, neither any error msg...only an empty double array comes from the DAQmx Read VI..... 😞

0 Kudos
Message 7 of 8
(2,570 Views)

i close this post, and I accept the solution for the TDMS problem. I open a new post with my DAQmx problem.

0 Kudos
Message 8 of 8
(2,563 Views)