Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Check DO values programmatically

For analog output on the X series, it is possible to record the output actually produced using the _aoN_vs_aognd internal source available to the analog input hardware.  This is pretty useful for synchronizing different pieces of software on the same machine without running wires or rewriting existing programs.


Is there anything similar for DO?  I would like a way to check the state of a DO channel that is already in use without having to actually wire a connector to it, but I don't see any obvious way to route it to an AI, PFI, etc.  

0 Kudos
Message 1 of 4
(3,055 Views)

At least for software-timed DIO tasks, the answer is both simple and kinda surprising.  Just use your DO task refnum and wire it to DAQmx Read.

 

Can't test now, but I suspect this might not work for hw-timed DO tasks.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 4
(3,031 Views)

I wouldn't have access to that from another process though right?  Usually if I try to access a DO from another program (for logging), its an error since the hardware is in use.

0 Kudos
Message 3 of 4
(3,025 Views)

Assuming your other "process" is still part of the same overall application, then you just need to provide that process with the DO task refnum.  Note: it *is* important that they share the *same* refnum though, you can't have the other process try to make its own task that wants access to the same hardware.

 

If you've got 2 separate applications, then you'll probably need to approach things another way.  Either combine the applications or parallel wire from the DO pins to some pins you can access with a DI task.

 

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(3,019 Views)