08-26-2020 07:46 AM - edited 08-26-2020 07:57 AM
@Kevin_Price wrote:
I've never used (or even seen) a PXI-2503, but the online docs refer to it as a "matrix switch" device. As far as I understood, such devices wouldn't have counters, might not have "regular" DIO, and might require the NI-SWITCH API rather than DAQmx.
Having no direct experience, I can't offer much more than that. What led you to the understanding that you could operate it with a DAQmx counter task?
-Kevin P
Hi Kevin,
The VI I attached earlier in the thread, (Simple Gate.vi) does work as is. I'm attempting to take bits and pieces from a known working application and implement it into my own app to give the user a slightly different test. I've inherited a test system that has worked up to this point, but now a little bit different functionality has been requested and I'm attempting to get it working.
Thanks,
Jay
08-26-2020 09:16 AM
So much for my prior understanding...
If it supports the DAQmx API for controlling the relays in question, I'll *now* guess that you would still have the option to choose either a counter pulse task or a more manually controlled DO task.
Timing for a counter pulse will be *autonomous*, which is often great, but maybe not so much for your particular app. You have to set up pulse timing parameters in advance, and then once you start the task the hardware takes over and controls timing. If you want to choose when to start *AND* stop this digital output, you'd have to do something hacky like define the pulse to be way longer than you'll ever want, and then stop the task when you want to stop the pulse. Yuck!
I agree with others' suggestion that it'd probably be more straightforward to use a regular DO task where you manually decide when to set it High (True) or Low (False) in your app.
The posted code doesn't explicitly set pulse timing parameters so it'll just use defaults. Seems you'd want to define the timing. It also looks *probably* wrong that you repeatedly start the task inside your loop. There's also no indication that you're choosing where to direct the counter pulse output. So again, it'll direct the pulse to the default pin which may or may not be the one you have hardwired. Under DAQmx, one can use a channel property to redirect the output to a desired PFI pin.
-Kevin P