LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

set and reset in labview

I'm new to labview, and I'm sorry for my knowledge of English. I'm having difficulties with the logic in labview, mainly that I would like to keep two active exits, forward and backward a cylinder, alternating between them before a condition, that is, set an outupt and after the condition is true, reset this first and set the second.

ps: I´m ussing outputs with DaqAssistant

0 Kudos
Message 1 of 6
(1,771 Views)

One of the key steps in asking for help is actually showing us where you are stuck.

 

Please attach a VI that shows where you have gotten to so far. Especially since you say you use a DAQ Assistant which is an Express VI that hides lots of details behind the pretty blue box.

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

My understanding is that you have two Digital Output channels that you are using to control some sort of solenoid, valve, or relay or something that moves a piston (cylinder) in and out.

 

Is your "condition" a Digital Input channel? Or an elapsed time?

 

It sounds like a State Machine architecture would suit this application well. First check your condition, activate one of the outputs to actuate the cylinder (initial movement direction may be based on the initial "condition"), wait for the end condition in a loop that also checks for a human stop input, then actuate the cylinder in the other direction by changing both of the digital outputs accordingly. Does this help?

_______________________________________________________________
"Computers are useless. They can only give you answers." - Pablo Picasso
0 Kudos
Message 3 of 6
(1,756 Views)

I just put the part that I have doubts. in my starting condition, a button is pressed that activates the output that recedes cylinder. But DaqAssistant only activates with the input enabled, I would like to leave it active until a condition is true, then resetting my output

0 Kudos
Message 4 of 6
(1,749 Views)

That is not a VI.  That is a picture.  As a result, like I said before, we can't see what's happening in that blue box.

 

And it is a picture of only part of your block diagram which means there is no context to what you are showing us.

0 Kudos
Message 5 of 6
(1,738 Views)

@FeMolina92 wrote:

I just put the part that I have doubts. 


 

Please do a few basic tutorials first, because you have some glaring race conditions due to overuse of local variables. Your "Partida de Cicio" local variable has a >>50% change to get read before the it's terminal is updated with current data. Since the outcome differs based on what happens first, your program is not reliable. The correct way would be to eliminate the local variable and just wire from the compound node to the OR, guaranteeing execution order.

 

Feel free to attach your actual VI (or a simplified version). We cannot debug truncated pictures of partial code containing opaque express VIs.

0 Kudos
Message 6 of 6
(1,719 Views)