LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Timing] delay motor outputs?

I'm trying to set up a code so that when a button is pushed (boolean turns true), the following happens:

1) Send a value of -1 to a window motor

2) Wait 0.25 seconds

3) Send a value of 1 to the same motor

4) Wait 0.25 seconds

5) Send a value of 0 to the same motor

 

However I want this to happen all the way through, whether the boolean turns back false or not, and if I hold down the button, it only runs once.  I know how to put delays in STRUCTURES like loops and Case Structures, but outside of any of those, I have no idea.

0 Kudos
Message 1 of 4
(2,836 Views)

Hi Animus,

 

check.png

Seems to meet your request, when button is set to "latch when pressed"...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,834 Views)

That looks perfect, thank you ^^  How do I set a button to Latch When Pressed?  I tried Properties, but it only shows the attached (went ahead and included a pic of my code too)

0 Kudos
Message 3 of 4
(2,827 Views)

Hi Animus,

 

when you say "button" you should have noted you're talking about some hardware dangling aside your PC...

 

In that case you should use a shift register to hold the previous state of your button and compare that with the current state to generate the TRUE signal for the case structure. (That's usually called "rising edge detection"!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,818 Views)