LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pause a timed task, do something, and than return

Hi all!

 

I am new programing on LabVIEW, and I have been trying to do something with no success.

 

 

Scenario:

User write a value to 'howLong' (should be around 9secs);

If the system turn 'request1' to TRUE, the action1 must stay TRUE for 9secs.

During this time, if the user presses the button request2 (Latch Until Released), action1 must be PAUSED while action2 is completed, and than it has to go back to action1 turning it back on until the 'actionTimer' goes to 9secs.

 

 

holdAction.JPG

 --

request1 turns action1 ON

request2 turns action2 ON

action1 must obbey the 'howLong' variable

action2 have to stay ON as long as the user keep pressing the button

 

action2 has priority

 --

 

 Does anyone have a goood idea on how to do this?

 

 

Thanks a lot!

 

 

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

No one here will do your homework for you (except for Ray R Smiley Wink).  I suggest you take some Labview tutorials (free and online at ni.com).  Make an attempt at coding. Then we could help you get over your problems.  To start you off, learn about elapsed time function, loops, case structures, event structures.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(2,763 Views)

Please don't get me wrong.  I don't want anyone doing my things, really!

I have tried a lot of things during these days, but I haven't found anything so simple as I think it should be.

 

I just would like to hear some ideas from you guys, that are more experienced in LabVIEW.

 

 

Anyway, thanks for your time tbob.

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

I'll tell you about some of the tools and how they are used.  Study the event structure.  Here you can put in some code to be executed when a button is pressed.  It sits and waits for an event (like a button pressed, which is called a value change, or a mouse move, etc).  When the event takes place, the code inside the event case will execute.  So you can create an event case for your buttons.  Inside the event case, you can start a timer and wait for it to finish.

 

The case structure is like and If-Else in text based languages, or more like a Select-Case in C.  Wire in some variable.  A case which matches the variable value is selected and the code inside that case is executed.

 

For you problem, you described a sort of algorithm, request 1 turns on action 1.  You can set up an event case for request 1.  Inside that case, put code to cause action 1.  Continue in this manner.  When you get stuck, post your code and tell us what you are having problems with.  Someone will help you for sure.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 4
(2,751 Views)