06-07-2018 11:55 AM
Using the code attached with a NI USB-6343 (OEM) board
Issue: The output is left in a High (1) state after a series of pulses. The subsequent Digital Read will change the output to Low (0) and return a 0 value.
After some troubleshooting I find the output can be set in NI MAX to 1 or 0, stop NI MAX task, and fort the code given the Digital Read will read and _set_ only that state.
Write case - digital pulse
Status case - Digital Read
06-07-2018 12:58 PM
Are you sure it is not going low when you close and clear the output task?
Ben
06-07-2018 01:13 PM
If I highlight execution the change is coordinated with the Digital Read (the output is connected to a solenoid valve so I can hear the click when it changes).
06-07-2018 01:23 PM
@DTLamb wrote:
If I highlight execution the change is coordinated with the Digital Read (the output is connected to a solenoid valve so I can hear the click when it changes).
You should check the spec on your widget. When used as a DI line many DI devices go tristate.
And speaking only for myself, I can not recall ever using a Digital line as both in and out in the same app. But that may be because I am just an old guy that never thought about trying it.
If worse comes to worse, wrap-up your DO code in an Action Engine that cache the last written state.
That Nugget I linked above just happens to have an example that lets you control DO lines and track the status.
Ben
06-07-2018 01:48 PM
The DO is just a DO, not ever a DI. No external input.
Reading the state of the DO. NI has this example: Reading the Value of Analog or Digital Output Channels in LabVIEW and LabWindows™/CVI™ The digital example runs successfully on my system. If I add the overhead to generate the pulse then the Digital Read gets fixated on a value.
02-06-2020 01:05 PM
The support page fails to mention that this only works correctly on physical hardware, and the simulated device cDAQ-9132 with a M-series NI-9474 will not correctly read the previously written Digital Output state. Given that I must develop and compile an EXE to use on the 9132 located in a very remote location it would be nice to have the correct feedback from a simulated device.