Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6351 digital streaming output rate

I everybody,

 

I would like to buy a USB-6351 device to stream digital data from   my laptop harddisk to the   Digital Port 0 8-bit  interface.

The  sequence I need to generated is at 1.25 MHz, a total  bandwidth of 10 Mbit/s , but I read in the manual that the USB version of 6351 would be limited to 1 MHz while the PCIe version goes up to 10 Mhz.

The same manual also indicates Hi-speed USB support, ie a bandwidth of 480 Mbit/s that is much higher than 10 Mbit/s.

This limit of 1 MHz clock is therefore a real limitation and I have to necessarily buy the PCIe version?

Can I consider the USB version to transfer a continuos stream of 8 bit digital data (on port 0) at 1.25 Mhz?

 

Thanks,

 

Giulio

0 Kudos
Message 1 of 12
(5,434 Views)

Hi Giulio,

I looked through the specifications of the NI USB-6351 but I didn't find that 1 MHz limitation you mentioned..
It seems to me that USB-6351 offers 8 hardware-timed DIO lines with 10 MHz max rate, so I think 1 DIO line can be controlled with 10/8=1.25 MHz rate. (But it's only a supposition, I don't know this hardware.)

Greets,

 - George -

0 Kudos
Message 2 of 12
(5,427 Views)

thanks George,

 

the 1 Mhz limitation is reported at page 7 of the 6351/6353 manual I downloaded from NI website (and is here in attach):

 

DO Sample Clock frequency
NI PCIe-6351/6353
Regenerate from FIFO........... 0 to 10 MHz
Streaming from memory........ 0 to 10 MHz, system and
bus activity dependent
NI USB-6351/6353
Regenerate from FIFO........... 0 to 10 MHz
Streaming from memory........ 0 to 1 MHz system and
bus activity dependent

 

Giulio

 

0 Kudos
Message 3 of 12
(5,425 Views)

since I'm not shure I've attached the file, the link to the 6351 specification document is:

 

 

http://www.ni.com/pdf/manuals/370787b.pdf

 

 

Giulio

 

0 Kudos
Message 4 of 12
(5,422 Views)

Sorry, you're right. I read the specifications only on the product's webpage, but there not shown this limitation. Well, I too don't understand.. pci card is able to use dma, usb can't.. maybe this is the reason.. strange..

George

0 Kudos
Message 5 of 12
(5,418 Views)

Hi Giulio,

 

USB X-Series can operate faster than 1MHz. The DIO circuit is almost exactly the same on PCIe and USB devices. If there are any timing issues with the rate you select, the hardware will detect them and throw an error.

 

So why the difference in specs? The answer is a combination of USB bandwidth limitations, as George guessed, and some hardware implementation details of DIO on X-Series.

 

As you pointed out, USB 2.0 bandwidth is 480Mb/sec. It's worth noting this is mega-BITs, not mega-bytes per second, so in other words the maximum bandwidth is 60MB/s (note the upper-case B, for Bytes instead of bits - fun, right?).

 

This number is "ideal" bus bandwidth. Each byte of data sent on USB is contained in a packet, and without going into lots of gory detail on how USB works, there is a lot of overhead used for each actual byte of data sent on the bus. This overhead is not subtracted from the 60MB/s number specified by the USB 2.0 spec, since the amount of overhead varies drastically from device-to-device, and system-to-system.

 

Realistically, you can send 30-40 megabytes of data per second on most USB 2.0 devices, and the real-world number generally ends up being much closer to the lower end of that range. This number can be very different from system-to-system with the same device, due to differences in host-controller implementations, and vary a lot on the same system depending on what other activity is happening on the bus at any given time.

 

For X-Series USB devices, no matter how many bits of port-0 you use, there is a dedicated circuit in hardware that updates the state of a 4-byte latch register from a FIFO every sample clock pulse. This circuit's behavior is fixed, and always latches 4-bytes (the same circuit is used to support devices with 8-bit and 32-bit ports) on USB X-Series devices. Each digital line of port-0 can be connected individually to this latch register. So, if you use only one DO line, only that line's pin will be physically connected to the latch-register; however, all bits of the latch-register itself will be updated every sample clock.

 

So, at 1MHz, the device uses 1,000,000 * 4 bytes of data per second. 40MB/s is at the limit, if not past the limit for most systems, of what transfer speed USB will be able to sustain. It felt very misleading to specify a maximum rate of 10MHz for USB X-Series devices, since the bus cannot come anywhere close to this bandwidth. As a result, our USB devices are speced to 1MHz.

 

William Earle

Staff Software Engineer

DAQ Software

National Instruments R&D

Message 6 of 12
(5,407 Views)

Just to be clear, I would not expect you to be able to maintain a 1.25MHz output with the USB-6351, due to bus bandwidth limitations. You might be able to burst at 1.25MHz for a very short time. The PCIe and PXIe buses have the bandwidth you need for a continuous 1.25MHz output.

 

However, there might be an exception to this. If your output waveform can fit entirely in the device's onboard buffer (2047 samples for X-Series digital output), you can use a feature of X-Series called onboard regeneration. This feature will transfer the output waveform to the device's onboard buffer once, and then repeatedly output the pattern in the buffer. After the initial transfer occurs, the output will require NO bus bandwidth, and should be sustainable at 1.25MHz for a USB-6351.

 

William Earle

Staff Software Engineer

DAQ Software

National Instruments R&D

Message 7 of 12
(5,405 Views)

Thanks William,

 

your answer is very clear and complete. I will look for a non USB device.

And thanks also to George.

 

Regards

 

Giulio

0 Kudos
Message 8 of 12
(5,393 Views)

William,

 

reading againg your answer there is still something I can't completely understand: 

you write "1,000,000 * 4 bytes of data per second. 40MB/s is at the limit" but if I understand well your definition of MB, 1000000 * 4 bytes shoud be 4 MB/s, about one order of magnitude under the limit. Am I right?

 

Giulio

0 Kudos
Message 9 of 12
(5,392 Views)

Yep, in my comment above, change it to 10MHz = 10,000,000 samples / sec * 4 bytes / sample = 40MB/s. I typed my answer a little too fast in between working on other projects :). The overall point is most systems can't go at 40MB/s, so we didn't want to spec X-Series at a rate that would require that bandwidth. The amount of bandwidth you can get is VERY non-deterministic, so we wanted to error low.

 

The next logical question is: 1.25MHz is only 1,250,000 * 4 = 5,000,000 bytes / sec of bandwidth, so can you go this rate? I didn't go into a lot of detail in my second response, but I would suspect you would be able to burst at this rate for a short period of time, but if you were trying to maintain a long-running continuous output, you may run into issues.

 

Why? Depending on bus activity, and even on how busy the host machine's CPU is, you can get latency spikes where the host does not send data to the device for long periods of time (we've observed on the order of 100s of microseconds to milliseconds). So even though the bus can average 30MB/s and up, the device will not get this bandwidth continuously.

 

As was pointed out above, there is no DMA for USB, so every byte of data sent requires the host CPU to be interrupted once an I/O request completes, and the device driver to write data to a new I/O request. As an example, if you move a USB mouse or type on a USB keyboard, these actions will have similar priority to sending new data to the device, so whatever is happening on your system at any given time can result in latency spikes.

 

At 1MHz, the 2047 sample onboard buffer equates to about a 2ms of buffer time. Going at 1.25MHz means you have significantly less buffer time to be able to maintain output through spikes in bus activity (~1.6ms). Depending on what your host computer is doing, this may be perfectly fine, or you may not be able to sustain a continuous output. This is another reason we choose to spec the devices at 1MHz.

 

William Earle

Staff Software Engineer

DAQ Software

National Instruments R&D

 

 

Message 10 of 12
(5,378 Views)