LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MyDAQ logging

Hello,

I need some help. I want to create a program in LabVIEW to measure an analog input signal. My PC is connected to the device via USB. I can't read and log the data fast enough. I want to read the analog input and log the data with 10 kHz, but in my program, the fastest frequency is 500 Hz. With a "wait until next ms multiple" I set the interval to 1 ms. I also tried some examples for logging, but they also didn't work. I hope someone can help me with my problem.

0 Kudos
Message 1 of 5
(1,164 Views)

Hi brendan,

 

welcome to the LabVIEW forum!

 

two recommendations:

  1. don't use "1 sample" modes for sample frequencies > 100Hz…
  2. don't use local variables to transfer data lossless

Suggestions:

  1. Set a sample rate in your DAQmx task.
  2. Read samples using "n samples" mode!
  3. Use the logging built into DAQmx. No need to create program code to do the very same job…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(1,159 Views)

Hello GerdW,

 

Thank you for your fast reply. Now I use the DAQ Assistant and it is working. Also, I have a much simpler program. Importing was to save the data as lvm file, because it's much simpler than xlsx to save.

 

But I'm not sure if this program is losing some data. My measurement frequency is 100kHz. I configured the program to save the data  in a lvm file and create a new lvm file after a minute. To minimize the size of one lvm file. Theoretically, 600k values should be stored in one lvm file. Sometimes, in one lvm file there are less than 600k values. In the following file, the values are continued directly in time. For example:

 

The first file start with 60,000000s and ends with 119,899990s

The following file starts with 119,900000s and ends with 179,899990s.

 

Did I lose some data here? 

Or.

I don't lose data. The first file just logged 59,900000 seconds and the next file logged directly after that without missing data.

 

But I don't know what happens here.

 

I uploaded a picture of my new program, the data logging configuration and 2 lvm files as an example. In the lvm file I deleted the data except the first and last 3 measurements, because the data was to big to upload.

 

Best regards,

brendan_137

0 Kudos
Message 3 of 5
(1,101 Views)

Hi Brendan,

 


@brendan_137 wrote:

Now I use the DAQ Assistant and it is working. Also, I have a much simpler program.


Wel,, the block diagram looks smaller. IMHO the VI is more complicated because all the important parameters are hidden in those light-blue ExpressVI blocks…

(In the long run you will write better VIs without ExpressVIs.)

 


@brendan_137 wrote:

But I don't know what happens here.


We neither, because we cannot edit/debug/run images in LabVIEW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(1,086 Views)

Hello Gerd,

 

I'm sorry. I'm new to this forum. I should have upload the vi file. Here is my vi file. I used the "MyDAQ" Device.

 


@GerdW wrote:

Wel,, the block diagram looks smaller. IMHO the VI is more complicated because all the important parameters are hidden in those light-blue ExpressVI blocks…

(In the long run you will write better VIs without ExpressVIs.)

You're right. For now I want to use them for my application, but I also will try without the ExpressVi blocks.

My thought:

There is no losing data. The DAQ Assistant transfers data: 2 analog inputs and the time. The "Write To Measurement File Express VI" (Messwerte in Datei schreiben) block just write this data into a lvm file. When there are not 600k values in one file, the data is stored "incorrectly", but the measurements are in the next lvm file.

 

I hope I am behaving correctly in this forum.

 

Best regards,

Brendan

0 Kudos
Message 5 of 5
(1,068 Views)