LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquire data for an indefinite period of time

Hello,

 

I would like to write a VI that starts taking data when I push a button, and then stops taking data when I press another button.  Ultimately, I would like to write this data to a file (*.csv) so I can analyze it later.

 

I know how to acquire a finite (pre-determined) number of samples at the push of a button and also I know how to write this data to a CSV file. The piece I am missing is the ability to record as long as I wish, and stop when I press a button.

 

Can LabVIEW do something like this?  If so, can someone please point me in the right direction?

 

thanks!

0 Kudos
Message 1 of 8
(3,835 Views)

Have a look at the example VI named "TDMS Logging - Cont Log Data Only.vi".

Help > Find Examples: Search for "TDMS Cont Log".

 

TDMS is a very good way to stream data to the harddrive.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 2 of 8
(3,816 Views)

What you're looking to do is very similar to what I asked in one of my first questions to the forum. Apok gave me a starting point for a VI that does exactly what you seek.  Check out this thread.

Jeff

 


@souperman1985 wrote:

Hello,

 

I would like to write a VI that starts taking data when I push a button, and then stops taking data when I press another button.  Ultimately, I would like to write this data to a file (*.csv) so I can analyze it later.

 

I know how to acquire a finite (pre-determined) number of samples at the push of a button and also I know how to write this data to a CSV file. The piece I am missing is the ability to record as long as I wish, and stop when I press a button.

 

Can LabVIEW do something like this?  If so, can someone please point me in the right direction?

 

thanks!


 

Jeffrey Zola
Message 3 of 8
(3,797 Views)

Here's another example of a VI (LV2011) that collects data until the STOP button is pressed. I use this frequently to collect voltage from a PXI-4071 DMM and current from a PXI-4141. The VI plots the results in the front panel and logs a text file of the results that can be brought into Excel for analysis or compilation. The text file is named based on the current timestamp and the various input fields on the front panel.

 

Hope this help!

 

Jeff

Jeffrey Zola
0 Kudos
Message 4 of 8
(3,788 Views)

Thanks everyone who has responded so far.  

 

I tried opening "indefinite data collection.vi" in LabVIEW 2012 but I got some errors about missing VIs.  Is there a version I could open in LabVIEW 2012 instead?

 

thanks!

0 Kudos
Message 5 of 8
(3,775 Views)

It is likely that you do not have either NI-DMM or NI-POWER installed. That message is not related to the version of LabVIEW.

 

I suggest that you look at the structure of my VI and tailor it to your data collection application using the modules is your system. Or install the DMM and SMU drivers and run them "virtually" with my program.

 

Jeff

 

 


@souperman1985 wrote:

Thanks everyone who has responded so far.  

 

I tried opening "indefinite data collection.vi" in LabVIEW 2012 but I got some errors about missing VIs.  Is there a version I could open in LabVIEW 2012 instead?

 

thanks!


 

Jeffrey Zola
0 Kudos
Message 6 of 8
(3,766 Views)

@TroyK wrote:

Have a look at the example VI named "TDMS Logging - Cont Log Data Only.vi".

Help > Find Examples: Search for "TDMS Cont Log".

 

TDMS is a very good way to stream data to the harddrive.


Troy-- Did you mean  -- Have a look at the "continious measument and logging example project template?"

 

The rest of you that have not become familliar with it --- I recommend you catch up a bit.  Project templates have a lot of power to educate!

 

 

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 8
(3,757 Views)

In the attached version of my VI, I have removed the DMM and SMU instruments and replaced them with random number generators.  Enjoy!

 

Jeff

Jeffrey Zola
Message 8 of 8
(3,721 Views)