08-18-2010 05:35 PM
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.
08-19-2010 12:57 PM
Hi newbee22,
The simplest use case if you want to use DAQ Assistants might look something like this:
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,
08-19-2010 01:41 PM
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.
08-19-2010 01:45 PM - edited 08-19-2010 01:46 PM
Can you post your code? I'd have to look at it to see what might be going on.
08-19-2010 01:57 PM
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
08-19-2010 03:27 PM
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,
08-19-2010 03:54 PM
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
08-19-2010 05:50 PM
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:
Best Regards,
08-20-2010 04:57 PM
That did it John, thanks for your help.