Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

What hardware should I use for TTL synchronization?

Solved!
Go to solution

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?

0 Kudos
Message 1 of 10
(7,137 Views)

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?

 

best regards
Alexander
0 Kudos
Message 2 of 10
(7,116 Views)

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.

0 Kudos
Message 3 of 10
(7,072 Views)

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

 

 

best regards
Alexander
0 Kudos
Message 4 of 10
(7,067 Views)

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

0 Kudos
Message 5 of 10
(6,869 Views)

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.

best regards
Alexander
0 Kudos
Message 6 of 10
(6,854 Views)
Solution
Accepted by topic author brinmr

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.

0 Kudos
Message 7 of 10
(6,804 Views)

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.

best regards
Alexander
0 Kudos
Message 8 of 10
(6,799 Views)

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

0 Kudos
Message 9 of 10
(6,794 Views)

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.

best regards
Alexander
0 Kudos
Message 10 of 10
(6,784 Views)