10-22-2019 04:33 AM
Hi, I'm setting up a test system interfacing to a 1V8 device to simulate button presses that normally pull to ground. So I was very happy to find that the IO's seem to be configurable using the DigitalDriveType.
Using advice from Open-Drain Configuraiton for USB-6000 with Python I was able to get the code working, but the IO's still don't behave like open-collector/drain ...
Setup code:
self.nidaqmx_simple_io = nidaqmx.Task() self.nidaqmx_simple_io.do_channels.add_do_chan(digital_io) self.nidaqmx_simple_io.do_output_drive_type = DigitalDriveType.OPEN_COLLECTOR
Any suggestions? Could of course be that the module just doesn't support this configuration - e.g. USB-6501 clearly states that 'open collector(open-drain)' is supported, but I can't find that for any C Series Digital Module's ...
Thanks in advance and best regards Jesper
01-09-2020 08:38 AM - edited 01-09-2020 08:40 AM
I have since done some testing on the USB-6501 and I'm able to set an output to open-collector mode, BUT it seems that the 4k7 pull-up resistor is permanently active - this is a bit surprising to me (see: https://www.ni.com/pdf/manuals/375268c.pdf).
There's an interesting value in the constants file, but I have not been able to guess how to apply it (if it's at all relevant for this device):
class LogicLvlBehavior(Enum):
PULL_UP = 16064 #: High logic.
NONE = 10230 #: Supply no excitation to the channel.
Setup code found to work:
import nidaqmx
from nidaqmx.constants import DigitalDriveType
TEST_IO = "USB-6501/port0/line0"
with nidaqmx.Task() as task:
task.do_channels.add_do_chan(TEST_IO)
for channel in task.do_channels:
channel.do_output_drive_type = DigitalDriveType.OPEN_COLLECTOR
print(f'TEST IO Write: {task.write([False, True, False, True], auto_start=True)}')
This site uses cookies to offer you a better browsing experience. Learn more about our privacy statement and cookie policy.