This example demonstrates how to properly configure an NI 9401 in DAQmx for independently controlled bidirectional DI/O with nibble 0 (lines 0-3) set for digital input and nibble 1 (lines 4-7) set for digital output.
This VI creates a digital input (DI) and digital output (DO) task which will perform continuous bidirectional data acquistion.
NI LabVIEW 2009 or compatible
NI DAQmx 8.9.5 or compatible
NI 9401 DIO Module
NI CompactDAQ Chassis
Steps to Implement or Execute Code
To run this example, select the proper I/O channels for each nibble corresponding to DI and DO, set the execution timing for each nibble independently, and run the VI.
1. Creates DI and DO tasks 2. Reserves one of the tasks first 3. Starts the other task that has not yet been reserved 4. Starts the task that was previously reserved 5. Performs continuous bidirectional DIO 6. * Note that each nibble can execute at different rates 7. Clears tasks and handles errors
Additional Information or References
One way to easily observe the bidirectional capability is to perform a loopback test across the nibbles (i.e. connect line 0 to line 4, line 1 to line 5, and so on). Then when you run this VI, you should see your output reflected on the input indicators.