LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Capturing identical consecutive (back-to-back) samples

I am posting my project in hopes someone can help me figure out what is happening.  I am self taught in labview, so I probably don't know the fundamentals, but I am able to get things working with enough time.

 

System Setup:

CompactRIO 9049

9 vibration channels (NI 9232)

2 DIO (NI 9375)

8 analog channels (NI 9201)

 

My Issue:

When I start the data logging on my system, which I am taking data from DAQ Assistant (Sample Rate=100Hz, Samples=100), my analog channels contain consecutive samples that are identical.  I am hooking up a function generator to mimic a sine wave signal (I have varied frequencies for testing).  I have read that the scan engine can handle upto 1000hz, DAQmx can handle upto 5000hz, and FPGA can handle up to 10s MHz.  The kicker is I have implemented this on all 3 interfaces and they all seem to give me identical consecutive samples.  Please note that these consecutive samples are random.  Sampling at 100hz should be well within what DAQmx can handle.  

 

What I have been doing to see these samples is triggering the logging, waiting roughly 1 minute, stop the logging, and open the excel file (TDMS) that was created.  In the voltages tab, on the first channel (although all channels do it) I scan through until I see a double sample.

 

Please let me know if I haven't provided enough information as I am hoping with me posting my entire project that someone can see what is taking place.  Thanks for any information at all.

0 Kudos
Message 1 of 5
(717 Views)

Here is the project saved for LV 2018.

0 Kudos
Message 2 of 5
(607 Views)

Hi,

If you want to read/write the digital inputs/outputs every 250 ms, the sequence structure is unnecessary. Each iteration executes every 250+X ms. X is the time spent to read/write.

In the data logging loop you correct this X by calculating the process time. I think it works but a better way of doing this, is simply using the wait function and removing the sequence structure here as well.

 

The small X delay in the digital I/O loop will add up. If X=1ms then after 250 seconds the outputs may only be written 999 times instead of a thousand. If the data logging depends on the digital outputs, after some time it could read the same sample twice.

Yddet

0 Kudos
Message 3 of 5
(601 Views)

Thanks for your response.  It hasn't given me any issues reading the digital i/o as if it missed a read of the digital input (IO_LoggingOn) I would imagine that my program would try and FTP my file over to me before I was ready.  With that being said I removed the sequence structure from both the digital i/o loop and the data logging loop with the same results.  I have attached my TDMS file for a roughly 189 second run.  If you look in the voltage tab and scan through the first column (S5C0) on row 2495 you can see a double sample.  The other channels on this tab also have many double/triple samples but they are not tied to anything and I am chalking that up to floating inputs.  I also attached a JPEG for the double sample I described if you can't open the TDMS file.

Download All
0 Kudos
Message 4 of 5
(592 Views)

I can’t believe not 1 person is able to solve this issue or point me in the right direction.  Do NI employees actually monitor the forums?  I’ve always hated NI.  They are over sold in schools and I realized it quick when I was given real world issues that I had to integrate.  I provide my whole project for the world and still not one solution.  I guess the easy answers will get the solutions so they can raise their  cred on the forums.  Terrible.

0 Kudos
Message 5 of 5
(527 Views)