Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

8 NI 9401 modules on a compactdaq

Hello,

 

First of all, I must mention that I currently am not familiar with NI hardware. We're exploring our options for a project.

 

We need fast digital IO capabilities and we need a lot of channels. NI 9401 seems a good fit for us. This is an 8-channel, 10Mhz digital IO module. We want to use this module on a 8-slot CompactDAQ chassis with USB connection. We'd like to get as many digital IO lines as we can get, so we'd like to populate the CompactDAQ chassis with 8 modules, to get 64 total IO channels. I'm curious about something though. My questions are:

 

- Does CompactDAQ hardware work in 'sampling' mode for the digital IO lines? In other words, do we get notification in software when the IO line changes state, or do we get 10Mhz samples?

- 8-channels of digital IO contains 8-bits of data, ie, 1Byte. 10Mhz x 1Byte makes 10MB per second, from one NI 9401. 8 NI 9401 devices would generate 80MB/sec of data. This definitely exceeds the USB transfer speeds. Does this mean that when we populate CompactDAQ with this many DIO modules, we have to reduce the sampling speed, or does not chassis somehow take care of that transfer speed?

- Similarly, we'd like to use the same chassis to capture many analog signals, NI9223 seems to be a good fit for us. However, again, at 1MS/s/ch rate, with 16-bit resolution, that makes 8MB/sec of data from 1 module (for 4 total channels), that would be 64MB/sec of data to be transferred to the PC. IS this possible, or are we missing something fundamental about CompactDAQ hardware?

 

We'd like to know the possible limitations so we can plan accordingly before we purchase a system.

 

Best regards,

0 Kudos
Message 1 of 5
(3,077 Views)

Hi graf4,

 

Here are answers to your questions:

 

 


 

- Does CompactDAQ hardware work in 'sampling' mode for the digital IO lines? In other words, do we get notification in software when the IO line changes state, or do we get 10Mhz samples?

 


 

You will get chunks of samples. To read at the rated sample rate, you set a task onto the card that uses the hardware timing. This task will fill up a buffer on the card. On the software side, you will read the data from the buffer at some rate slower than 10Mhz. This is because Windows is nondeterministic and works on millisecond level, which is far too slow to read individual samples at a time.

 

 


 

- 8-channels of digital IO contains 8-bits of data, ie, 1Byte. 10Mhz x 1Byte makes 10MB per second, from one NI 9401. 8 NI 9401 devices would generate 80MB/sec of data. This definitely exceeds the USB transfer speeds. Does this mean that when we populate CompactDAQ with this many DIO modules, we have to reduce the sampling speed, or does not chassis somehow take care of that transfer speed?

 


 

You are correct. If you have that many cards on the same CompactDAQ chassis, you would need to reduce the sampling rate of the cards if you want to use them simultaneously because the USB spec maxes out at a theoretical of 60MB/s. The real world speed is going to be less than this.

 

 


 

 - Similarly, we'd like to use the same chassis to capture many analog signals, NI9223 seems to be a good fit for us. However, again, at 1MS/s/ch rate, with 16-bit resolution, that makes 8MB/sec of data from 1 module (for 4 total channels), that would be 64MB/sec of data to be transferred to the PC. IS this possible, or are we missing something fundamental about CompactDAQ hardware?

 


 

Again, you would need to reduce the sampling rate of the cards.

 

If you need to sample that much data at that speed you can purchase 2 CompactDAQ chassis for your Digital IO and 2 CompactDAQ chassis for your analog signals. This will cut the data requirement of each CompactDAQ chassis and will be well under the USB theoretical maximum. You will need to make sure that each CompactDAQ is on its own root USB hub so they will have enough bandwidth to operate a the maximum speed.

 

Please post back if you have any more questions. Thanks.

 

Steven K.
National Instruments
Software Engineer
Message 2 of 5
(3,056 Views)

Thanks Steven, that was helpful.

 

One more question. Does the hardware or the software warn the user if we setup the modules in a way that would exceed the data rate of the USB connection. As the user, I can try to make sure that I don't exceed USB max speed, but CompactDAQ actual speed is probably lower than USB max speed. As the user, what guidelines can I use to set my sampling rates, in order not to exceed the usb data rate?

 

Regards

0 Kudos
Message 3 of 5
(3,042 Views)

Hi graf4,

 

The software won't give a warning that you are going over the spec, however it will give a buffer overflow error if you try to run the acquisition too fast. As for a guideline to how to set the sampling rate, I'd like to point you to a Dev Zone article about USB Bandwidth considerations: USB DAQ Bandwidth Considerations and Troubleshooting

Steven K.
National Instruments
Software Engineer
0 Kudos
Message 4 of 5
(3,024 Views)

Hi all,

 

I have some benchmarks for the 9178 that might be helpful.  Improvements are being made in the driver (will hopefully make it into 9.3) intended to increase streaming performance in many cases.  The following benchmarks were taken using Windows XP on a Dell T3400--exact numbers will vary depending on your computer and OS (Win7 should be slightly faster, Vista RTM slower, Vista SP1 similar to XP).  These benchmarks are not a guaranteed specification by any means, but just represent numbers that I was able to sustain in testing on my particular system.

 


DAQmx 9.2.3
DAQmx 9.3.0 (alpha testing)
Digital Input (DI)
33 MB/s 36 MB/s
Digital Output (DO)
27 MB/s 28 MB/s
DI / DO
24 MB/s
38 MB/s

 

 

Benchmarks were taken by Acquiring / Generating 4 bytes per task and adjusting the sample rate.  The numbers shown are the aggregate throughput.  Note that even though the aggregate throughput for the DI / DO case is higher in DAQmx 9.3, the individual task throughputs are each lower than the single stream cases. 

 

One other thing to keep in mind... parallel digital modules (8 lines or less) in slots 1-4 will have their data combined into a single 4 Byte (32 bit) sample.  You can't transfer just a single byte if (for example) you were only using one module.  If you are using a parallel digital module in slots 5-8, regardless of the presence of other modules the transfer will actually be 8 Bytes per sample (64 bits).

 

The analog data transfers are pretty straightforward.  For the 9223, any sample taken will be 2 Bytes (the module has 16-bit accuracy).  In the past I've been able to run 4 9223s at full rate in a single chassis (32 MB/sec aggregate).  DAQmx 9.3 should hopefully allow the use of 4 full modules plus an additional 2 channels, but it likely won't quite support 5 modules acquiring from all channels at full rate.  I haven't been able to benchmark this yet however.

 

 

Having multiple subsystems streaming simultaneously can have interesting results.  For example, acquiring and generating simultaneously can give a higher aggregate throughput (see the 9.3 benchmarks) than single stream cases since there is more on-board buffer space to work with.  Do you know what rates you require and which subsystems you plan on using?  How many total channels of each type do you need for your entire system?

 


If you are able to go down to ~142 kHz per digital line, you could fit in quite a bit more DIO lines as you would be able to use 9403s, which in 9.3 will support hardware timing for DIO (either input or output for each module, not both at the same time) in DAQmx.  The 9403 currently only supports static DIO as of DAQmx 9.2.3.

 

 

Best Regards,

John Passiak
0 Kudos
Message 5 of 5
(2,975 Views)