Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Software triggering a digital output line on a 9402

Hi, 

I'm simply trying to trigger a digital output on a 9402 to go high when the reading on an analog input of a 9205 goes beyond a certain threshold. When I use the DAQ assistant to insert the block, the only control I can use is some type of array with a True/False constant for each value. Any ideas on how to do this? Thanks for your help.  

 

 

0 Kudos
Message 1 of 9
(4,142 Views)

Hi newbee22,

 

The simplest use case if you want to use DAQ Assistants might look something like this:

 

        21898i8D47DA1A673974C7

 

 

The above code uses software-timing to achieve the feedback, which is going to create some latency (on the order of ms) and non-determinism. 

 

If you want to improve upon this, the 9205 does have an on-board comaprator on it (for analog triggering) that you should be able to route to the 9402 without having to go through software.  If low latency and determinism are important to your application, I can offer more advice on how to set this up.  You would have to use the lower-level DAQmx API rather than the DAQ Assistant to program this.

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 9
(4,128 Views)

John, 

thanks for your help. I tried the wiring you suggested, but the 9402 isn't outputing any signal. I have the Generation Mode set to 1 Sample(on demand), all the other options are grayed out. When I click on the DigitalOut button while inside the DAQ Assistant, I can see the output go high or low, but the logic feeding the True/False from the 9205 doesn't seem to be triggering the same response. (I don't have the Line inverted...)

 

Any ideas? Thanks again. 

 

 

0 Kudos
Message 3 of 9
(4,125 Views)

Can you post your code?  I'd have to look at it to see what might be going on.

John Passiak
0 Kudos
Message 4 of 9
(4,122 Views)

John, 

here it is. Pretty much what you suggested. DAQ Assistant 2 is the 9402. The idea is to get the line0 on the 9402 to go high if one of the values read in the 9205 is above the theshold. NOt sure what I'm missing.. thanks

0 Kudos
Message 5 of 9
(4,118 Views)

You can use the "Or Array Elements" to return a single boolean value (True if any one of the array elements is True).

 

Are you using On Demand Timing for the DO task?  If you post the actual VI instead of just the screenshot I can look at how you have your DAQ Assistant configured.

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 9
(4,099 Views)

John, 

here it is. I can't put the "Or Array Elements" in there, it won't allow me to connect that to the DAQ Assistant2... don't really know why. 

 

As far as timing goes, yes, the only option available was "On demand" for a trigger source other than hardware. If I should be doing this differently, please let me know. Thanks

 

newbee22

0 Kudos
Message 7 of 9
(4,094 Views)

Hi newbee22,

 

Oh sorry about that, the DAQ Assistant is actually looking for a 1D array of booleans (the same DAQ Assistant can work for multiple DO lines).  If you just convert the result into a 1D array of length 1 it should work out.  Something like this:

 

21938i254B8D702B35C5A1

 

 

Best Regards,

John Passiak
0 Kudos
Message 8 of 9
(4,090 Views)

That did it John, thanks for your help. 

0 Kudos
Message 9 of 9
(4,062 Views)