LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recording data with DMM

I am trying to configure my VI to record DMM data continuously until the VI is stopped.  Right now I can only get the data to record via a For loop which means I need to set the amount of data points to be recorded (i.e. in the screenshot I'll have a file with 12 voltage readings).  When I change it to a while loop the data stops writing to the file.  I tried using the set up from this thread (https://forums.ni.com/t5/LabVIEW/Reading-Data-From-Agilent-34401/td-p/3258814/page/2 ) as well, but could not get it to work. My vi is attached & here is an image:

 

voltage_vi_for_loop.png

Any help is greatly appreciated.

0 Kudos
Message 1 of 16
(2,776 Views)

Have you tried using a While Loop?

 

You really should go through the LabVIEW Basics tutorial

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 16
(2,772 Views)

Hi -- in my question I noted that I have tried using a while loop and it results in the data not being written to a file. With the simple switch of a for to while loop, no file is created nor data saved.

dmm_while_v1.png

I tried to build an array with the indices being used as elements, yet still no file is created or data saved:

dmm_while_v2.png

0 Kudos
Message 3 of 16
(2,759 Views)

I've added shift registers to try and retain the data, but am still running into the same problem from my original post where it is just not creating and logging to a file.  I added a table on the front panel and can see new values being stored and the old retained, but am still unsure why it won't write to an external file?  Here is my VI:

 
Download All
0 Kudos
Message 4 of 16
(2,738 Views)

Hello -- I am trying to continuously record values from a DMM until the user stops the VI.  Right now I have a VI that displays the readings in a growing table on the front panel.  However, I am struggling with getting these values to be written to a file.  As I have it, no file is created and no data is stored despite the use of the write to measurement file express VI.  Thanks in advance for any help!

voltage_recording_vi.png

0 Kudos
Message 5 of 16
(2,747 Views)

@mh256 wrote:

Hello -- I am trying to continuously record values from a DMM until the user stops the VI.  Right now I have a VI that displays the readings in a growing table on the front panel.  However, I am struggling with getting these values to be written to a file.  As I have it, no file is created and no data is stored despite the use of the write to measurement file express VI.  Thanks in advance for any help!

voltage_recording_vi.png


Why are you building your data point into an array before adding it to your array? Change your initialization outside your shift register to a 1D array and just wire your data point directly to the build array. I think that might fix your problem, but I never use dynamic data nor the Write to Measurement File express vi. 

 

A better approach would be to use standard calls to open, write, and close your file. Open the file before the loop. Write to the file inside the loop. Close the file after the loop has ended.

 

Unfortunately I can't open your file because I am still running LabVIEW 2019.

 

 

Message 6 of 16
(2,737 Views)

I believe the issue is resolved -- thank you so much!

 

0 Kudos
Message 7 of 16
(2,732 Views)

Have you tried using "Write Delimited Spreadsheet" vi instead?
BTW, a 1D array is sufficient to store the data.

 

Voltage Attempt Fixed.png

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 8 of 16
(2,714 Views)

Thanks for the reply, I appreciate it. I ended up using the standard open, write, close calls as recommended by  johntrich1971 which resolved my issue:

dmm_tdms.png

That being said, I need a column of the local time when each sample is recorded if you have any insight on ways to integrate that.

0 Kudos
Message 9 of 16
(2,705 Views)

Hi mh,

 


@mh256 wrote:

Thanks for the reply, I appreciate it. I ended up using the standard open, write, close calls as recommended by  johntrich1971 which resolved my issue:


Now you seem to write an ever-growing array into the TDMS file with each iteration of the loop - while you surely only want to save that scalar single new sample of that iteration!

 

Same problem as in that thread

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 16
(2,701 Views)