From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set tristate logic using NI-DAQ 6212 in C#

Solved!
Go to solution

Hi everyone,

 

I am very new to NI & seeking guidance from all of you, experts out there.

 

As the subject says it, I am trying to set digital output channel to tristate using DAQmx & C#. I found link on Tristate property, but I do not know how to use it. http://zone.ni.com/reference/en-XX/help/370473H-01/mstudiowebhelp/html/bd33b0d/

 

Any help would be very much appreciated!

 

Thank you.  

0 Kudos
Message 1 of 2
(3,790 Views)
Solution
Accepted by kasrus

Hi kasrus,

 

You would set the property using the following syntax (after creating your task):

 

digitalWriteTask.DOChannels.All.Tristate = true;

 

As the help document indicates: "You must commit the task for this setting to take effect."  The help document also highlights when to set the property in relation to a read or write.

 

This is referring to the DAQmx Task State Model:

 

Task State Model

http://zone.ni.com/reference/en-XX/help/370466AC-01/mxcncpts/taskstatemodel/

 

The configuration methods will move your task through this state model, but you can also control them using the syntax in the below article:

 

Verifying, Committing, Starting, and Stopping NI-DAQmx Tasks Programmatically

http://zone.ni.com/reference/en-XX/help/370473H-01/mstudiowebhelp/html/verifycommitstartstopdaqtask/

 

Regards,

 

Kyle S.

Applications Engineer

National Instruments

http://www.ni.com/support

Message 2 of 2
(3,777 Views)