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,348 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,311 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,307 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,304 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,299 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,297 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,287 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,262 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,256 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,252 Views)