From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow digital output on USB-6009 using NIDAQmx

The software timed DIO on the USB-6009 makes it unsuitable for any applications requiring timing or jitter <10s of milliseconds. You can sometimes get close to 1 ms pulses but they are not reliably timed and sooner or later the jitter will get you. Without the hardware timing you cannot write a waveform directly to the DO port.

 

The USB-6341 and the USB-621x series devices have at least one hardware timed DIO port. Those can provide the timing accuracy you want.

 

Lynn

0 Kudos
Message 11 of 18
(2,743 Views)

It sounds like you've already gotten our opinion, but in case you want another NI employee's opinion:

The reason the 6341 can do what you want is because it has a counter on board. The 6009 don't have any timing source, so you have to use software timing. This isn't ideal for all the reasons you've mentioned. The M-Series cards also have an on-board clock, so they'll be capable of what you're describing.

Tanner B.
Systems R&D Engineer - Aerospace, Defense, and Government
National Instruments
0 Kudos
Message 12 of 18
(2,723 Views)

Just a heads up--unlike most other M Series the 621x only has software timed DIO.  It does have 2 counters that can be used to generate hardware-timed pulses but you cannot clock out an arbitrary digital waveform.

 

 

Best Regards,

John Passiak
0 Kudos
Message 13 of 18
(2,721 Views)

I'll concede, this is a much better desciption of what's happening.

Tanner B.
Systems R&D Engineer - Aerospace, Defense, and Government
National Instruments
0 Kudos
Message 14 of 18
(2,719 Views)

thanks all for your reply. I am a bit disppointed that the 621x does not have hardware timed D/IOs. Could you please recommend me one USB DAQ Module that has hardware timed D/IOs and is powered only by USB?

0 Kudos
Message 15 of 18
(2,703 Views)

Hi wohltemperiert,

 

I recommend you look at our X-Series USB devices. The lowest cost option is the USB-6341, which has 8 hardware-timed digital lines. You might also find a cDAQ chassis and C-series digital module at a similar price point. The cDAQ option allows you more modularity for future use.

 

Regards,

Andrew

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
0 Kudos
Message 16 of 18
(2,676 Views)

The comments above do answer this question quite thoroughly, but I'd just like to briefly mention a few points from my experience with the 6009.

 

As John Passiak correctly pointed out in a related thread:

"...the precise 1 ms delays mentioned by ricovox seems quite likely related to the minimum 1 ms transaction time limitation of USB Full Speed (which the 6008/6009 is)."

 

I was initially confused because I thought "software timed" meant that digital IO could be performed as fast as my operating system could issue the commands.  This is in fact probably true, but I also assumed that because the USB transfer speed was 12 Mbps (which translates to about 1570 bytes per millisecond or 1.5 bytes per microsecond) that this meant I should be able to issue USB commands at sub-millisecond speeds.  I didn't realize the 1ms minimum transaction time limit of USB Full Speed, which John pointed out.  

 

I was further confused by the fact that it seemed that I could READ from the USB device at about 4000 samples per millisecond. Later John pointed out that this is because I was using hardware-timed analog input, which is buffered and uses "USB Bulk" transfers, which can deliver large amounts of data in each transaction--but the timing (i.e. latency) between each individual transmission over USB is still limited to the 1 ms minimum.

 

I was able to produce digital output signals that were fairly precisely timed at 1 ms each, but as described above, issues such as processor load and thread queuing can easily cause large deviations from this timing when it needs to occur over long periods of time (i.e. longer than the maximum time slot the operating system grants the IO thread).

 

Personally I wish NI had been more forthright when describing the IO capabilities of the 6009. To me "software timed" seems to indicate that timing is limited only to how fast software can execute, (which is millions of instructions per second, and tight loops, even in high-level languages, can execute at several thousand cycles  per millisecond).  NI's description of course is accurate--it is the USB driver software (which is limited by the USB spec) that ultimately limits the speed of digital IO.   But I feel that a more sincere description would have been to explicitly state that it is ultimately limited at 1 DIO instruction per ms (or less depending on processor load), because that's effectively what it is.  Having this written in the device description or at least in the User Manual would have saved me (and at least a few others) a huge amount of trouble in trying to find out why the DIO was so "slow".

 

Thanks to everyone who has commented, and especially to John Passiak who was able to explain the issue so accurately and clearly.

0 Kudos
Message 17 of 18
(2,659 Views)

The manual for the USB-6008/9 has the follwoing specifcation for Analog output:

 

"Analog Output

Analog outputs........................................2

Output resolution ....................................12 bits

Maximum update rate .............................150 Hz, software-timed..."

 

They do not have a similar specification for digital I/O but I have always figured that since both are software timed, the DIO is likely similar.  I have done better than 150 Hz on both AO and DO, but do not count on it being reliable.

 

I agree that it should be better documented.

 

Lynn

0 Kudos
Message 18 of 18
(2,643 Views)