Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneous sampling on 2 independent usb-6008

Does anyone know how to sample two channels at 10 KHz from two independent USB-6008 DAQs at almost the same time (not exactly simulateneous but maximum within 100 ms of time delay difference between the two channels on the same computer using two usb ports Dev1 and Dev2?

 

I am trying to avoid to use two independent computers to do this two channel processing.

 

Any info will be appreciated.

 

Regards,

D

0 Kudos
Message 1 of 9
(4,198 Views)

Assuming LabVIEW, you can sample in parallel just by having two independent tasks (or two separate DAQ Assistants). If you have a digital trigger source, you can use that to start the acquisition on both. Without that, there is nothing to guarantee any sort of simultaneous sampling. You would be at the mercy of a very non-deterministic OS.

 

Don't understand the comment about two independent computers. The synching with that setup would be nonexistant.

0 Kudos
Message 2 of 9
(4,180 Views)

It is very difficult to do. One solution is to provide a known signal to both usb instruments and use it as a sync signal. You need the sync frequency to be lower than the non-deterministic jitter. You can cross-correlate the sync from both instruments.  The syncing can be easily done in post-processing but it is pretty computationally intensive in "real-time". Multi-threading is your friend.

0 Kudos
Message 3 of 9
(4,142 Views)

If you can upgrade to the USB-6009, you could use two of the AI channels on the same device to sample at 10kS/s with significantly less than 100ms between channels.

 

Alternatively, if you can provide an external source as a trigger, you can trigger the acquisition on both USB-6008 devices using the DAQmx Start Trigger VI.  They won't be truly synchronized, because they will use different clocks, but the jitter will be less than 100ms.

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
Message 4 of 9
(4,118 Views)

I am getting Error code: - 200077
Description:
Requested value is not a supported value for this property.
Possible cause: The operation you are trying to perform or the values you selected are not supported on the device you are using. You might be designating options for the data acquisition that are not available on your device, such as in triggering or clock configurations. Likewise, you might be trying to configure invalid ports or self-calibration parameters.
Solutions: Many examples might contain configurations that only work on a certain series of devices. Make sure that the configurations in the example will work with your device. Consult your hardware documentation to make sure the operation and values are valid for your device. Make sure that the parameters you are trying to set are not already set by defaul.

 

when using acquireNScans-DigRef due to a setup.

 

 

 

 

 

0 Kudos
Message 5 of 9
(4,096 Views)

What development environment are you using?  LabVIEW, Visual Studio, etc?

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 6 of 9
(4,085 Views)

I am using OpenSuse 11.2 with this workaround:

 

Workaround steps NI-DAQmx base 3.3.4 for OpenSuse 11.2

----------------------------------------------------------------------------------------

    "COPY NIDAQMX 3.4 CD TO ~/bin"
    "COPY NIDAQMX 3.3 CD TO ~/bin/NIDAQmx_3_3
     cd /usr/src/linux
     make cloneconfig
     make modules_prepare
     cd ~/bin
     ./INSTALL

ANSWER AT THE PROMPTS
--------------------
     Do you want to install NI-DAQmx Base for C? No
     Do you want to install NI-DAQmx Base USB Support? Yes

     cd NIDAQmx_3_3
     rpm --install labview82-rte-8.2.1-2.i386.rpm
     rpm --install nidaqmxbase-cinterface-3.3.0-f0.i386.rpm
     /sbin/yast2 --install libstdc++33
     cd /usr/src/linux/; make mrproper
     zcat /boot/symvers-2.6.31.5-0.1-default.gz > Module.symvers
     make cloneconfig
     make modules_prepare
     updateNIDrivers
     reboot

AFTER REBOOTING
---------------

     lsdaq

--------------------------------
Detecting National Instruments DAQ Devices
Found the following DAQ Devices:
NI USB-6008 OEM1:"Dev1"    (USB0::0x3923::0x71D6::0151EA70::RAW)
--------------------------------

      cd /usr/local/natinst//nidaqmxbase/examples/ai
      make

      time ./acquire1Scan

Acquired reading: 0.001168

real    0m9.955s
user    0m9.173s

      time ./acquireNScans

Acquired 1000 samples
data[0] = 0.001168
data[1] = 0.001168
data[2] = 0.001168
data[3] = 0.001168
data[4] = 0.001168
data[5] = 0.001168
data[6] = 0.001168
data[7] = 0.001168
data[8] = 0.001168
data[9] = 0.001168

real    0m10.264s
user    0m9.409s
sys     0m0.244s

 

when I run the other external digital trigger example with the USB-6008 connected i get that error 20007.

 

Thanks,

Dave

0 Kudos
Message 7 of 9
(4,082 Views)

./acquireNScans-DigRef

 

under the C api examples.

0 Kudos
Message 8 of 9
(4,081 Views)

The USB-6008 does not support reference triggering, which is what this example is using.  The other digital triggering example uses an external sample clock.  You will want to use a digital start trigger, not a digital reference trigger.

 

Use the "contAcquire-ExtClk-DigStart.c" example, but change

clockSource[] = "/Dev1/PFI7";

to

clockSource[] = "OnboardClock";

 

This will show you how to use a digital start trigger while still using the onboard clock.

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 9 of 9
(4,004 Views)