Digital I/O

Showing results for 
Search instead for 
Did you mean: 

select type drive Digital Output NI USB 6501 Python

Hi all,


I want to configure output per output of my IO card. for example I want output p1.0 to be active drive and p1.1 to be open collector. I can’t figure out how to do that in python.

I found this on internet :


and this is my soft :


Active_Drive = 12573
Open_collector = 12574


import nidaqmx

task = nidaqmx.Task()

value1 = False
print('Valeur de la sortie :', value1)


I can’t select each output. I think I’m missing a few simple things but I tried a lot of things, I don’t see.

I also tried to add direction of port, or other things but i don't see.


Do you have an idea ?




0 Kudos
Message 1 of 6

I found this also :


but it does not run with :

0 Kudos
Message 2 of 6

It could be that you cannot set individual pins as open collector or active driver but rather only the entire port.



The driver might have the features but it will be limited by the actual hardware used.



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 3 of 6

Thanks for your answer, 


I thought like you, but I tried via labview or ni max and it is possible to individually select the outputs. I think it’s because I don’t use python drivers properly... 


0 Kudos
Message 4 of 6

Terible waste of time, no working example in Python, been desperate to use NI product, but at the end is expencive, difficult hard to implement not complete product, go back to LabJack, no time for empty examples and some amaters half solutions 

0 Kudos
Message 5 of 6

For clarity, LabJack devices do have individually controllable tri-state digital I/O and Python is commonly used with our devices.


Input: Terminal is connected to 3.3V through a 100 kΩ pull-up resistor.
Output-high:  Terminal has a low impedance connection to 3.3V.

Output-low:  Terminal has a low impedance connection to GND.


The terms open-collector, open-drain, NPN, and PNP are use to describe certain types of digital signals. These signals change between open & ground or open & high, rather than ground & high like you get from a push-pull signal. The various terms are used somewhat loosely, and often all variations are simply called "open-collector", but following is the most common usage:


Open-collector = NPN = Changes between open and low.

Open-drain = PNP = Changes between open and high.


Note that when you change LabJack digital outputs between output-low and output-high, that is a push-pull (aka driven) signal. For example in Python on a T-series device:


ljm.eWriteName(handle, "DIO4", 0)  # Set DIO4 to output-low.

ljm.eWriteName(handle, "DIO4", 1)  # Set DIO4 to output-high.


To act like an open-collector NPN output you actually want to change our outputs between output-low and input.


ljm.eWriteName(handle, "DIO4", 0)  # Set DIO4 to output-low.

state = ljm.eReadName(handle, "DIO4")  # Set DIO4 input and read state.


The code for LabVIEW and any other language would be similar.


0 Kudos
Message 6 of 6