From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Gaps in data saved as LVM

I am using 2 USB-6009s to collect 16 channels of analog data and the 2 devices are not synced.  The data files attached were collected at 1,000 Hz for 2 sec using the Write to Measurement File function.

 

1. When the data were saved as a text (lvm) file [the csv file attached], there are gaps in the data.  However, there are no gaps when saved as an Excel file.

 

2. When saved as Excel with 'absolute' timestamps, the time column starts with 00.000 and then reset to 00.000 at non-regular intervals (as in the spreadsheet attached).  The time column has continuous time when the 'absolute' option is deselected,

 

If the gaps are related to the non-synchronization of the 2 devices, why are there no gaps when saved as Excel files?  Thanks for your time.

0 Kudos
Message 1 of 7
(3,134 Views)

HI,

 

When you are saving the different types of files are you just using the express VI? Have you tried making an array of the values you want to save and then use the Write to Spreadsheet File vi?

 

0 Kudos
Message 2 of 7
(3,090 Views)

Hi Riccardo:

 

Thanks for your response.  I used the Configure Write To Measurement File dialog to select the File Format (LVM or .xlsx) when I saved data in Text and Excel formats.  I will try your suggestion (Waveform => Array => Write to Spreadsheet File) later.

 

John

0 Kudos
Message 3 of 7
(3,065 Views)

Hi Riccardo:

 

At your suggestion, I used the Convert From Dynamice Data to 2D array before saving the array using Write to Spreadsheet File.  When I collected 2 seconds of data at 1,000 Hz, there are fewer than 200 lines of data in the spreadsheet file (no gaps in the data, see the txt file attached). For comparison, the file saved using Write to Measurement File has close to 1,000 lines (with gaps in the data, see the xlsx file attached).  Thanks for your time.

 

John

0 Kudos
Message 4 of 7
(3,012 Views)

I just want to make sure I'm understanding this correctly. Are you seeing less data than expected when you use the Write to Spreadsheet File? 

0 Kudos
Message 5 of 7
(2,985 Views)

Yes. A lot less.  I expected  ~2,000 lines and there were only ~200 lines.

 

Do NI have any example VIs for data acquisition which allow a user to set the sample rate and duration when the VI is running (with signals displayed in realtime) and then the user can start the data collection (writing data to a file) by clicking a button on the front panel?  That's what I am trying to do.

 

John

0 Kudos
Message 6 of 7
(2,980 Views)

If you look at the shipping examples in LabVIEW there is one that has a similar functionality that you're describing. In LabVIEW go to Help > Find Examples.. then select Hardware Input and Output > DAQmx > Analog Input > Voltage - Finite Input.vi. Taking a look at the logging settings and the timing settings would be a good start for your troubleshooting. 

0 Kudos
Message 7 of 7
(2,958 Views)