Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple accessors to digital inputs and outputs on NI-9375 DIO module

I have an application that requires intermittent access to digital inputs and outputs. I'm accomplishing this with a cDAQ-9178 chassis and an NI-9375 DIO module. These inputs and outputs will be used to control relays and read the on/off status of several pieces of machinery. These needs are not time-critical, and every usage of this module is a single point read or write.

 

My problem is that I want to avoid race conditions since it seems that I can only have one timing operation happening on this device at any given time. My worry is that two different parts of my main code will attempt to read or wright two different ports at the same time, and error out.

 

I've tried simulating this event using a simulated cDAQ device (as I don't have the hardware in-hand at the moment). I have a simple VI running that reads data at 5 Hz for 10 seconds (hardware timed). I then have a button that, when pressed, will trigger a software-timed write of a single data point. I had hoped that it would sense the resource was unavailable, then wait up to my specified timeout to trigger the write; instead, I *immediately* get error 201105 telling me that a specified resource was unavailable.

 

I'm pretty sure I understand how all the timing stuff needs to happen, and I'm pretty sure that the unspecified, unavailable resource was a timer. What I'd like to do is to be able to poll the system to see if a timer is available, and if not, wait until one IS available.

 

My other option is to use a semaphore or a queued system to only allow one part of my code to write to the module at a time, but I'd rather be able to just ask the module if it was ready to accept another data transfer. Is there a clean option for doing that?

0 Kudos
Message 1 of 4
(4,659 Views)

I realized today that I could summarize my issue with the following question: Can I have multiple tasks on this (or any) module accessing it at one time? I realize the 9178 has only one hardware timing engine for digital outputs- but I'd like to be able to write with multiple software timed outputs. (I'm actually running into a similar problem on my NI-9263, where I need to have one output constantly updating via hardware-timed sampling, and have another output update intermittently via software-timed single points).

0 Kudos
Message 2 of 4
(4,624 Views)

Hello BertMcMahan,


I created a simple VI which performs a hardware timed digital input task and software timed digital output task and was able to replicate your issue using the same hardware.


I am currently looking into a workaround and will provide you with my conclusions.
 
Regards,


j_bou

Message 3 of 4
(4,617 Views)

Hello BertMcMahan,

 

The 9375 is a serial digital module and you cannot do both static (software timed) and timed tasks (hardware timed) at the same time on a single serial module.

Digital I/O Considerations for C Series Devices:
http://zone.ni.com/reference/en-XX/help/370466V-01/mxdevconsid/digiocseries/

Therefore, you may need a second 9375 to meet your application requirement.

 

Regards, 

 

j_bou

 

Message 4 of 4
(4,569 Views)