LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Output changes with read

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 pulseWrite case - digital pulse

Status case - Digital ReadStatus case - Digital Read

 

0 Kudos
Message 1 of 6
(3,411 Views)

Are you sure it is not going low when you close and clear the output task?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(3,388 Views)

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).

0 Kudos
Message 3 of 6
(3,384 Views)

@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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 6
(3,378 Views)

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.

0 Kudos
Message 5 of 6
(3,371 Views)

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.

0 Kudos
Message 6 of 6
(2,940 Views)