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
(2,891 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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 4
(2,867 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
(2,861 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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 4
(2,855 Views)