06-13-2018 03:39 PM
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:
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);
chan_fast_en_l.do_tristateThis 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".
chan_fast_en_l.do_output_drive_type=DigitalDriveType.OPEN_COLLECTOR;I get no errors but the pin continues to output 3.3V
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.
06-14-2018 09:04 AM
Hey wiwyam,
Using an analog output, have you tried using "ao_load_impedance" instead of "ao_output_impedance"?
06-14-2018 01:42 PM
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.
06-19-2018 02:40 PM
Have you tried this with another device besides the USB-6001 that may have additional capability?
06-19-2018 06:48 PM
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
06-20-2018 09:57 AM
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?
06-20-2018 11:03 AM
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