09-03-2013 08:00 AM - edited 09-03-2013 08:10 AM
I am searching for a hardware recommendation. Here's what the hardware should do: notify a PC program to run a subroutine upon detection of a TTL pulse (digital input change).
So I need one 1-bit digital input, and the device should communicate with a computer via USB. The TTL pulse voltage is about 4.7 V. Since the synchronization must be fairly precise, the delay should be on the order of 1 ms or less. Therefore the hardware should have a sampling rate of at least 1 – 10 kS/s.
I purchased the USB-6501 not realizing that it doesn't have any triggering or interrupt functionality, and now I don't think it will work for my application. I could constantly poll one of its inputs with my software to check for a change in value, but that would be relatively slow and hog my CPU. I would prefer that the device triggers or provides some kind of interrupt to my software application. I am considering using some NI software, but right now I'm using the session-based interface of the Data Acquisition Toolbox in the latest version of Matlab (R2013a, 64-bit) on 64-bit Windows 7.
I think either the USB-6008, USB-6009, or USB-6525 might be a good option, but I'm not sure. I don't fully understand the difference between the triggering/interrupt capabilities of the USB-6008/9 and the USB-6525. Any advice?
Solved! Go to Solution.
09-04-2013 08:48 AM - edited 09-04-2013 08:58 AM
Hello Brinmr,
it should be worked with this example "Voltage (with Events) - Continuous Input.vi" from the example
finder in this the PFI 0 can be used for an trigger input to start AI and this generates the event.
So the PFI0 can be used on the 6008/9 as trigger input for AI, but i
recommend to use an M-Series or X-series device with the change detection event.
What subroutine will be executed, what do this?
09-06-2013 08:41 AM
I think I've found a suitable product, the USB-6525. As Duffy2007 mentioned, the feature I need is what NI calls "change detection"; a list of devices that include this feature is listed here. Although the USB-6525 is not on that list, "change detection" is mentioned in its data sheet, and I have been assured by a technical sales representative that this feature is available on this device. Note that the incoming signal must be at least 200 µs long to be reliably detected.
I have also confirmed that the USB-6008 and USB-6009 do not support change detection. I'm going to try out the USB-6525.
09-06-2013 08:57 AM
Hello Brinmr,
this should help for your tests
Change Dectection Event Registration
NI-DAQmx: time loop when Digital Input Change Detection and read digital level
10-15-2013 03:45 AM
Hi Alexander,
Thanks for the tips. Unfortunately, I do not have a LabVIEW license, so I can't look into those examples. I would also like to report that the USB-6525 is no better suited to the job than the USB-6008 because Matlab does not support the change detection feature as of the time of writing. What I really need to do is find a device that can actually use the clocked operations (e.g. startForeground() or startBackground()) of Matlab's Data Acquisition Toolbox. I simulated a USB-6509 in NI MAX and discovered that those functions also don't work with the USB-6509 (perhaps unsurprisingly, as I believe that device lacks an internal clock).
Regards,
brinmr
10-16-2013 01:01 PM
Hello Brinmr,
i do not hava license for matlab so i can not test it.
On this page you found the supported NI hardware and here is the information the 6008 can be
used in session mode Supported Hardware - National Instruments- NI-DAQmx
and if i understand the function startForeground correct is this a session mode function.
You can made some tests with a simulated 6321 or 6251, but if this also not works then you should contact
the mathworks to ask them how you should implement your functions with mathlab.
10-22-2013 07:07 AM
I tried simulating the 6321 and the 6251, but they also didn't work. After further contact with a Mathworks employee, however...
I finally found some hardware! For devices in the "Industrial Digital I/O" and "High Speed I/O" categories, the specifications page should list the timing as "Hardware" rather than "Software". Then the device should work with clocked operations in Matlab. I tested this by simulating the PCIe-6535B, and I was able to run clocked operations in Matlab. Some CompactDAQ devices also seem to work, though I'm not sure how to determine which ones. I tested the 9201, though, and it works.
10-22-2013 07:23 AM
Hello brinmr,
thanks for the update, but for your information the 6321 has also hardware timed digital outputs, so they should
also work like the cDAQ 9178 series.
10-22-2013 10:35 AM
Hi Alexander,
You're right. I can at least see that the NI webpage for the PCIe-6321 says the timing is either hardware or software. Nonetheless, when I simulate that device in NI MAX and then add a digital input channel for it in Matlab, I receive a warning saying that clocked operations have been disabled because the channel does not support clocked sampling. Perhaps only the outputs or only the analog inputs are hardware-timed? Or maybe it's just somehow not supported in the toolbox.
I didn't see any information about the timing of the PCI-6251 on its webpage, but I receive the same warning when I simulate that device and add a digital input channel for it in Matlab.
Cheers,
brinmr
10-23-2013 04:32 AM
Hello Brinmr,
i think the situation is that the toolbox do not support this the 6321 has hardware timing for digital i/o the 6251 not.