LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save data to one file instead of multiple

Solved!
Go to solution

Hi everyone

 

I have made a VI where the intention was that the user would be able to chose what channel to log from but this way the data is stored in seperate log files. If I choose for example to activate logging on temperature and pressure I want it to save to one file instead of two seperate. How can I accomplish this?

 

Greetings 

DP

0 Kudos
Message 1 of 27
(3,602 Views)

Some hints:

  • Learn how to decouple DAQ and data logging: Producer/consumer design
  • Learn low level File functions, do not use Express VIs for this. TDMS is very nice option

 

0 Kudos
Message 2 of 27
(3,565 Views)

Hey Blokk

 

I am looking at this example:https://decibel.ni.com/content/docs/DOC-2431

Are you thinking something like this? 

 

Greetings 

DP

0 Kudos
Message 3 of 27
(3,561 Views)

@DP123 wrote:

Hey Blokk

 

I am looking at this example:https://decibel.ni.com/content/docs/DOC-2431

Are you thinking something like this? 

 

Greetings 

DP


Yes. Of course you need to modify it. 

0 Kudos
Message 4 of 27
(3,558 Views)

Ah great will try to work out how it exactly works. I just do not see how I will be able to have the same options when it comes to choosing which channels I want to log on and which channels I do not want to log. Could you give me a bit more clues :D?

 

Greetings

DP 

0 Kudos
Message 5 of 27
(3,553 Views)

You can pre specify the channels you want to log, and store their "index" in an array. In the logging loop you just use a for loop to get the required indexes. Then you can chose the channel index of a tdms file. Try to put together something, I can help tomorrow or others will also give hints...

0 Kudos
Message 6 of 27
(3,551 Views)

I will try to make something till tomorrow and then we can take it from there:).

 

If somebody else got some hints / tips you are more than welcome to share your thoughts. Thanks! 

 

Greetings 

DP

0 Kudos
Message 7 of 27
(3,541 Views)

Unless you need to save the file in a format other than TDMS, I suggest that you use the built in DAQmx functions for logging. No separate loops are needed and much easier to program.

 

See modified example attached.

 

Cheers,

mcduff

 

 

0 Kudos
Message 8 of 27
(3,516 Views)

@mcduff wrote:

Unless you need to save the file in a format other than TDMS, I suggest that you use the built in DAQmx functions for logging. No separate loops are needed and much easier to program.

 

See modified example attached.

 

Cheers,

mcduff

 

 


As I understood, the OP wants different rates for the channels, so the built in tdms is not a go. Hmm, or could it work? I have to see tomorrow, whether a tdms will record with the different rates...?

0 Kudos
Message 9 of 27
(3,510 Views)

Maybe I should have read the post more carefully, sorry, but I think it will record the incoming task as it is defined. Not sure about the number of samples per file, if they have different rates.

 

mcduff

0 Kudos
Message 10 of 27
(3,506 Views)