LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Master-slave issue. How to gently break and re-start the same while loop?

Hi,

 

 

Quickly: My main aplication has two buttons Start and Stop which are handled by Event structure. Start should trigger start of testing (another while loop) which is programed to perform 1000 times.  However, due to fact that that test takes long time I'd like to have an oportunity to break that test before declared reapetations with Stop button

 

After break I'd like to collect results and to have opportunity re-start the same test loop with that Start button.

 

What is the best approach to program it?

 

K.

0 Kudos
Message 1 of 8
(3,503 Views)
you may want to look into a state machine
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 2 of 8
(3,500 Views)

 

can u post your VI?

Anil Punnam
CLD
LV 2012, TestStand 4.2..........
0 Kudos
Message 3 of 8
(3,482 Views)

Thanks for all answers.

 

The draft version of my VI is attached.

 

Cheers,

0 Kudos
Message 4 of 8
(3,455 Views)

Slave.JPG

 

As a quick demo I modified your lower loop to operate as a slave to the upper.

 

The cases to the left wait 500 ms for a queue update and if no time out the command will switch to the desired mode. If Time out then use the previous mode.

 

The case to the right implements your mode Start, Stop or Exit. Only the Exit terminates the lower loop.

 

 

Have fun,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 8
(3,442 Views)

...adding to my previous post.

 

SEarch on "State-Machine". It sounds like you want your lower loop to be a State Machine (operates in one of many states) that changes states based on commands from the upper loop. Figure out how State Mahcine and queues work as seperate tasks. Then combine the two.

 

Ben

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

Thanks a lot guys.

 

I know how it works now.

 

K.

0 Kudos
Message 7 of 8
(3,353 Views)

MimiKLM wrote:

Thanks a lot guys.

 

I know how it works now.

 

K.


 

Could you pllease post code that illustrates your solution?

 

This forum lives and dies by people posting answers as well as questions.

 

Ben

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