Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous Digital Input and Output from NI 9403

Hi,

I was wondering if it is possible to digital output through one line in this module(NI 9403) while simultaneously reading from 10 other lines?

 

Basically what I need is for line0 to always be closed(true), and read lines1:10 - at very least 1sample/second.

 

I have attached a stripped down version of my code illustrating my error. I thought I was getting the error because the two tasks were using different clock configurations, but I tried using the same inputs and that doesn't work for me.


Any input is greatly appreciated.

Thank you

 

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

Hi Matthew,

 

The behavior you're seeing is expected for the 9403 module, since it is a serial module. The DAQmx help has the following restrictions in the Digital I/O Considerations for C Series Devices section.

 

Timed digital input/output restrictions:

  • You cannot use parallel and serial modules together on the same hardware timed task. 
  • You cannot use serial modules for triggering. 
  • You cannot do both static and timed tasks at the same time on a single serial module. 
  • You can only do hardware timing in one direction at a time on a serial bidirectional module.

 

So you can only do timed input or output at one time, but not both. However, based on the VI you attached and the description of what you want to do, you don't necessarily need both timed tasks in your loop. You can create a static output task to update that one line and after that, you can just start your timed input task on the rest of the lines. This should maintain the state on the DO line, since you're not acquiring from it.

 

Cheers,

 

Cristina

Cristina
Message 2 of 5
(7,414 Views)

Hi Cristina,

Thanks for your reply!

I was wondering if that would be a solution, but I thought that after I wrote one true to the line that the relay would open after since that is the default state.

I don't have the physical equipment yet to test this.

 

So if I write one true to line0, then initialize my other lines to begin reading, line0 will stay closed?

I attached a VI, is this a good way to do it?

 

 

Thank you for your time

 

 

 

0 Kudos
Message 3 of 5
(7,396 Views)

Hi Matthew,

 

Yes, if you write true to line0, it will stay that way if you don't rewrite to it or read from it, unless you reboot your chassis or perform a reset. The write will cause the output of the device to change, which is maintained even after the static task has been cleared. So you can even write that true to line0 and clear that task, and then move on to read from lines 1:10.  Line0 will stay high because you haven't done anything else to change it.

Cristina
Message 4 of 5
(7,370 Views)

 
  • You cannot do both static and timed tasks at the same time on a single serial module. 

I am running into the same problem with NI 9375 in the cDAQ-9171 chassis. When I configure Digital Inputs acquisition with a Sample Clock to read 100 samples at a time, there is no configuration of Digital Output generation that doesn't result in a shared resource error.

 

Is it possible to do timed acquisition AND any kind of generation?????

 

Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Source Device: cDAQ2
Source Terminal: do/SampleClock
Destination Device: cDAQ2
Destination Terminal: Slot1/ConvertPulse

Required Resources in Use by
Source Device: cDAQ2
Source Terminal: di/SampleClock
Destination Device: cDAQ2
Destination Terminal: Slot1/ConvertPulse

0 Kudos
Message 5 of 5
(2,080 Views)