Measurement Studio for .NET Languages

Showing results for 
Search instead for 
Did you mean: 

How do I configure the USB-6501 DIO ports as push-pull?

Go to solution

I am using this code in my Visual C# application to write digital outputs on the USB-6501 after adding NationalInstruments.Common and NationalInstruments.DAQmx as References:


using NationalInstruments.DAQmx;


private static void writeport(int value)
        using (Task digitalWriteTask = new Task())
            digitalWriteTask.DOChannels.CreateChannel("Dev1/port2", "MyPort", ChannelLineGrouping.OneChannelForAllLines);


            DigitalSingleChannelWriter writer = new DigitalSingleChannelWriter(digitalWriteTask.Stream);
            writer.WriteSingleSamplePort(true, value);
    catch (Exception ex)


I want to configure the USB-6501 DIO ports as push-pull. What is the syntax for doing this and will the USB-6501 retain that configuration after power cycling it?


I found this documentation on the NI website:


I see that DAQmxSetDOOutputDriveType() can be used to set the drive type to DAQmx_Val_ActiveDrive but I don't know how to access this API from C#. Any suggestions?


0 Kudos
Message 1 of 3

Somehow your post is exactly the same except for the difference in language -


There is  a property to set that in DAQmx in .NET



This documentation is available under C:\Users\Public\Documents\National Instruments\NI-DAQ\Documentation if you have installed DAQmx support for .NET


I don't think the value of this property will persist on power cycle, as a safe bet, always set this property on creating the task.



Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 3
Accepted by topic author scottmorgan

Thank you for the response. Here is the solution in practice and it works!

DOChannel ch = digitalWriteTask.DOChannels.CreateChannel("Dev1/port1", "MyPort", ChannelLineGrouping.OneChannelForAllLines);
ch.OutputDriveType = DOOutputDriveType.ActiveDrive;


We also have removed all of the weak pull-up resistors from the USB-6501 so that the outputs don't automatically powerup high when the board powers up.



0 Kudos
Message 3 of 3