LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 Daq different sample rate, one program

Hello,

 

I am running a NI9239 Using 4 channels at 25k sample rate. I am taking the data in and triggering off events based on the voltage change.

 

The issue I am having is I have certain times that I want to ignore the results of the trigger. I have a 0-5v signal that I can trigger the ignore off from but don't have enough channels on the 9239 to add that sample data. What I do have is a ton of USB6008's left over from another project.

 

What I would like to do is trigger off my events with the 4 channels on the 9239 and ignore certain times using the 6008. When I try to take in the data with two DAQ assistance it will run for a short time 30 seconds to a few minutes then crash with a buffering error.

 

Thanks in Advance

-Joseph

0 Kudos
Message 1 of 9
(3,055 Views)

Ji Joseph,

 

the USB6008 doesn't allow the same sample rates as your NI9239 as it is a rather simple DAQ device.

 

How did you setup your DAQ assistents? Can you get rid of them and use plain DAQmx functions instead?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,050 Views)

I can use the DAQmx Functions but ran into the same problem.

 

I know that the 6008 can only take a 10k sample rate, and I am sampling at 25k on the 9239.

 

The secondary data that I am gathering with the 6008 is mainly a HI / Low signal, I am looking for a high signal on a channel on the 6008 to ignore the trigger on the 9239. I was hoping that I could just use the cheaper daq to sample for a high / low signal at a slower rate

 

The DAQ Assistent is setup like this

NI9239

4 Channels, Continuous, 25k Samples to Read, 25k hz

 

USB6008

1 Channel, Continuous, 10k Samples to Read, 10k hz

 

I had hopped that because I am pulling all the samples every second that it would not cause any issues, It seems to happen more often when there is a lot of triggered events. I had created just a simple read data in from 2 daqs and trigger off one of them to test the theory of operation before spending time writting the full logic.

 

 

I just recreated the error the program stops at the 6008 DAQ assistent

Error -200279

Possible reason(s):

Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<4C>

0 Kudos
Message 3 of 9
(3,040 Views)

Hi Joseph,

 

error -200279 means you're too slow with reading sampled data. Read your data more often…

 

Standard suggestions for that matter:

- Use parallel loops for both DAQ devices.

- Use a producer-consumer scheme…

- Read data in smaller blocks more often. It's often recommended to read blocks of 1/10th of the sample rate (read 1000 samples at 10kHz samplerate)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(3,033 Views)

I spent some time working on the main program and was able to use the producer/consumer scheme to pull the data from the 9239 and the 6008 at the same time.

 

While it fixed one issue another arose. Over time the sync between the two DAQs decays and in the course of about 18 hours is over 1/2 second difference in the timing between the 9239 and the 6008.

 

The scope of the project it so take 4 channels of high speed data in on the 9239 and analyze it on the fly.

 

We ran into an issue were there is noise created on the line by a solenoid. In the grand scheme of things we can ignore the time period that noise is created in, except that the noise looks exactly like the data we are trying to collect and we have been unable to filter the bad data out. That led us to using a 6008 to monitor the solenoid signal and programically ignore the time period (~3/10th of  a second ) around the solenoid firing.

 

I've been able to observe the data out of sync by running the app for a few hours and sending 5v into both the 9239 and 6008 and observing the time shift between the two. I let it run overnight last night to see if it stabilized and was predictable, when I looked at it this morning it had gone from 1/10 a second to over 1/2 a second. I can only assume it will continue to drift.

 

Is there a way to make sure that both DAQs pull from the same time period? I know the 6008 doesn't have an internal clock, so I am hoping it is still possible.

 

Thank you for any help you can provide

-Joseph

0 Kudos
Message 5 of 9
(2,961 Views)

If you want to keep two devices in sync, you have to supply a clock to both of them.  Since the 6008 doesn't have an external clock input, I would say that you are just going to have to deal with the accuracies of the internal sample clocks.  If these were both PXI(e) cards, you could set the internal reference clock to the chassis clock, which is often a little more accurate.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 9
(2,952 Views)

You say the data that you're collecting with the 6008 is a "hi/low" signal. What is it that you are interested in the amplitude of the signal or how often long between transitions?

 

The 6008 has digital inputs, maybe something could be done using them. I don't remember, does the 6008 have any counters?

 

Mike...

 


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 9
(2,940 Views)

What I am interested in is more or less the timing of what is happening. When the Hi/Low Signal happens on the 6008, I want to ignore the signals coming in on my 9239 DAQ.

 

We are doing a continuous sample on the 9239 but there are random times when a solenoid fires that we want to ignore the data coming in. I am trying to use the 6008 to trigger an ignore signal in software when that solenoid fires either on or off.

 

-Joseph

0 Kudos
Message 8 of 9
(2,890 Views)

Joseph,

 

You said that the interference form the solenoid is very similar to the desired signal. Do the desired signals have any periodic or distinctive features which would allow you to synchronize the data if the same signal was recorde on both the 9239 and the 6008?

 

If so the option may be to record the solenoid control signal and one of the data signals on the 6008. In the osftware analysis you will need to locate the solenoid on times on one channel (easy) and find matching features in the data signal on both the 6008 and 9239 channels which recorded that signal. Then you can calculate the regions which need to be suppressed.

 

Because of the clock and trigger limitations of the 6008 I do not think you can do directly what you would like to do.

 

Please tell us more about your signals and post some data or at least images of graphs.

 

Lynn

0 Kudos
Message 9 of 9
(2,884 Views)