LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to change the digital outputs ports of a USB-DAQ from hi to low?

Hello,

 

I have this question. How I can change the status of digital ports from HI to Low. I am using a 2 digital ports from a USB-1208FS DAQ.  I have an electrical valve, this valve works as a switch (ON-OFF). Sometimes the output is HI (5V), when I stop the LV program using the stop button, the output stays on HI. How I can change it to LOW (0V) as soon as the program stops. Attached is the VI that I am working on. Thanks!

 

Mazin 

0 Kudos
Message 1 of 6
(2,574 Views)

When you say you use the "stop" button to stop your program do you mean the one that looks like a stop sign that is in the toolbar? If so, that is bad programming. You should have a program that is structured such that it as a programmatic stop button, that when pressed initiates an orderly shutdown process, including setting various outputs to the desired state.

 

Ok, I opened your code. Try putting a copy of the digital out vi's on the outside of your loop, with their inputs set to Low. COnnect them into the error wire so that they execute after the loop is stopped.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



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

Hi Putnam,

 

Thanks for your quick reply. Could you please tell me how I can set the digital out input to low that I didnot know how to do it. Thanks!

 

Mazin

0 Kudos
Message 3 of 6
(2,560 Views)

Hi Putnam,

 

Thanks for your advice, it worked. Now when I turned off the LV program the ports goes LOW (0V) thank you so much. I have only one problem left. The analog voltage from the ultrasonic sensor is kinda unstable. It keeps jumping up and down. I would appreciate it if you know how to stabilize the voltage from the sensor? I tried using a filter in LV, but it still the same. I want to stabilize it cause the switches connected to the sensor keeps turning on off very fast which is not good in my application. Thanks! 

 

Mazin

0 Kudos
Message 4 of 6
(2,518 Views)

@mazin wrote:

Hi Putnam,

 

Thanks for your advice, it worked. Now when I turned off the LV program the ports goes LOW (0V) thank you so much. I have only one problem left. The analog voltage from the ultrasonic sensor is kinda unstable. It keeps jumping up and down. I would appreciate it if you know how to stabilize the voltage from the sensor? I tried using a filter in LV, but it still the same. I want to stabilize it cause the switches connected to the sensor keeps turning on off very fast which is not good in my application. Thanks! 

 

Mazin


Do you have any sort of debounce configured for these switches? Are they NI switches? If so there is a wait for debounce function in the switch API.

0 Kudos
Message 5 of 6
(2,511 Views)

Hi,

 

Can you explain more please. The switches are basically 12vdc relays. Those relays controls a hydraulic valve (ON-OFF). The bouncing voltage from the sensor makes the valve unstable. Thanks!

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