LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ signal recording

Solved!
Go to solution

Dear all,

 

I am a new Labview user.

I would like to know whether it is possible to build a simple VI to record a signal at a certain sample rate, without specifying a priori the number of samples to be acquired. In other words, I would like to build a program that records a signal for an undetermined period of time, between the moment I start it and the moment I manually stop the acquisition. To stop the acquisition I would like to use a stop button (perhaps putting everything in a whil loop? )

Could you please tell me if there is an easy way to do it with the DAQ assistant? or do I need to convert it and program the subVI to achieve this?

 

Thank you, I tried to look whether anyone else already posted this questions, but I didn' t find it.

Bye

 

Emanuele

0 Kudos
Message 1 of 17
(3,729 Views)

You will have to get away from DAQ Assistant in order to do this.  If you look in the DAQmx pallet, you will see a DAQmx Start Task.vi and a DAQmx Stop Task.vi.  These are your friends.  I would recommend creating the tasks in MAX (Measurement and Automation Explorer) as a beginner.  Set the Acquisition Mode to Continuous Samples.  Then the question is how do you want to save your logged data.  TDMS file?  ASCII file?  Raw Binary?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 17
(3,716 Views)

Well, the DAQ Assistant does not necessarily have to go. You can simply wire the output to a Write LabVIEW Measurement File though you might have a problem keeping up with the acquisition depending on your sample rate, number of samples, file format, etc.

0 Kudos
Message 3 of 17
(3,714 Views)

Hi crossrulz,

 

thank you very much for your answer. I thought about autamically generating a VI through DAQ assistant and then modifying it after converting it to a standard subVI... I don't know if this is the best solution to do so.

As you guessed, I'm a baginner, so i really apreciate if you could please make other suggestions on how to tackle the problem.

 

Actually the task I have to build doesn't seem particularly difficult, but as a beginner, I don't know how to achieve it ...

 

Thank you again.

 

Reagarding your question, if possible I would like to save data to a LVM file, using the Write to Measurement File assistant routine.

 

Emanuele

0 Kudos
Message 4 of 17
(3,706 Views)

I would personally recommend the TDMS format.  Why?  Because DAQmx does it all for you.  There's a DAQmx Advanced Task Options pallet.  Inside that pallet is the DAQmx Configure Logging (TDMS).vi.  You tell this guy where to create the log, start your task, and let it do all of the work.  Here's a quick example of how I would set it all up.

DAQ Logger.png


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 17
(3,696 Views)

LabVIEW ships with a lot of good examples that you can refer to.  I would direct you towards this one:

 

Click on "Help...Find Examples...Hardware Input and Output...DAQmx...Analog Measurements...Voltage...TDMS Logging -- Cont Log Data Only.vi".

 

This VI will show you how to continuously acquire analog data and log it to a TDMS file.  You can then modify it to log to a .lvm file instead.

 

You could also take the approach in this thread.  Of course, you will again need to modify it slightly such that it writes to a .lvm file instead of a TDMS file.

0 Kudos
Message 6 of 17
(3,695 Views)

Thank you,

 

after logging my data I usually process them in MATLAB, so if there is a way to import data from a TDMS file into MATLAB, also this format is ok with me.

I will try to work on the topics you all suggested, if you know other examples I can refer to, please let me know.

Thank you again.

 

Emanuele

0 Kudos
Message 7 of 17
(3,674 Views)

The program looks good to me, but as I told you, I don't know a priori the number of samples to read, I would like to start/stop the acquisition manually.... how can I modify this program to achive this?

0 Kudos
Message 8 of 17
(3,671 Views)

can you send me please this VI?

0 Kudos
Message 9 of 17
(3,667 Views)

This is not a service for doing someone's homework. Take the LabVIEW basics tutorial and you will learn about elementary structures such as while loops and case statements. After that, you should be able to modify one of the shipping examples in a manner of minutes.

0 Kudos
Message 10 of 17
(3,657 Views)