Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

NIDAQMX Python - Setting an output to High Impedance (High-Z) on USB-6001

I have a USB-6001 and need to toggle an output between '0' and 'High-Z' and have tried the following methods with no success:

  1. Using an analog output
    1. ao_output_impedance=1.0e9. I get error message that this option is not available on my device
    2. ao_voltage_current_limit=0.0. I get error message that this is also not supported.
    3. So how can I turn off an analog channel?
  2. Using a digital output
    1. First I do 
       chan_fast_en_l= task_do.do_channels.add_do_chan("Dev1/port0/line0",line_grouping=LineGrouping.CHAN_FOR_ALL_LINES)
      task_do.write(True,auto_start=True); 
    2. chan_fast_en_l.do_tristate
      This has no effect and also gives no errors. The documentation says I must 'commit' this change, but I don't know what a 'commit' is and failed several attempts like "task.action.commit=0".
    3. chan_fast_en_l.do_output_drive_type=DigitalDriveType.OPEN_COLLECTOR;
      I get no errors but the pin continues to output 3.3V
    4. Is there a write keyword like TRUE, FALSE, HIGH-Z?

I'd really appreciate some assistance! If you could help for digital and analog, with some sample code, then that would really help me and others I'm sure.

 

0 Kudos
Message 1 of 7
(4,078 Views)

Hey wiwyam,

 

Using an analog output, have you tried using "ao_load_impedance" instead of "ao_output_impedance"?

Mike W.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(4,042 Views)

I tried your suggestion using the following code:

 

import nidaqmx
task_output = nidaqmx.Task() temporary_chan=task_output.ao_channels.add_ao_voltage_chan("Dev1/ao0") task_output.write(1.8, auto_start=True,timeout=0.0) time.sleep(3) temporary_chan.ao_load_impedance = 1.0e6 time.sleep(3)
exit()

And I get the following error:

 

nidaqmx.errors.DaqError: Specified property is not supported by the device or is not applicable to the task.
Property: DAQmx_AO_LoadImpedance
Channel Name: Dev1/ao0

 

 

I did have some success generating high impedance with

 

temporary_task=nidaqmx.Task()
temporary_channel=fast_en_l.do_channels.add_do_chan("Dev1/port0/line0",line_grouping=LineGrouping.CHAN_FOR_ALL_LINES)
temporary_channel.do_output_drive_type=DigitalDriveType.OPEN_COLLECTOR
temporary_task.write(False,auto_start=True);
time.sleep(3)
temporary_tast.write(True,auto_start=True);
time.sleep(3)

 

But then was disappointed to discover that this property is apparently not supported on my device (what if I want to use 1.8v?):

temporary_channel.do_logic_family=LogicFamily.THREE_POINT_THREE_V

Which means I am still looking for a solution for analog high impedance.

Or at least a more straightforward way to be open-collector to VDD rather than VSS.

 

 

0 Kudos
Message 3 of 7
(4,037 Views)

Have you tried this with another device besides the USB-6001 that may have additional capability?

Mike W.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 7
(4,016 Views)

No, USB-6001 is the only device I have.

And if I were to buy a higher end device there is no documentation guaranteeing that it would have these capabilities

0 Kudos
Message 5 of 7
(4,009 Views)

Can you explain a bit more about your application as to why you need to use a high load impedance to turn off the device instead of just putting a 0 on the line?

 

Mike W.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(3,999 Views)

We have designed an ASIC including a push-button de-bouncer. A real push-button only pulls the pin high, then the circuit is responsible for pulling it low afterwards. I have been using a '0' instead of 'high-z' for now.

I would also use the high-z mode for any SPI communication

 

0 Kudos
Message 7 of 7
(3,994 Views)