LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Large Software Stop Methods

Hello all,

I am currently writting a large and fairly complex software and I find myself with a question that probably quite a few programmers have had.  I was wondering, what is the best way to have a "STOP ALL" control in a large software?  I obviously need this in case some measurements go wrong, limits are reached etc.

I'm using a "Producer/Consumer" architecture.  One handles the UI and the other handles all the instrument control, etc.

I would like to have some input from programmers who have already faced this decision and what they decided to do.  Examples could be nice also!

Thanks

Yohan

0 Kudos
Message 1 of 7
(2,812 Views)
Anyone?
0 Kudos
Message 2 of 7
(2,779 Views)
Hi,

A few questions that, I think, need to be answered to determine a nice way to stop the application :

1. How many tasks do you need to stop at the same time ?
2. What kind of task are we talking about ? (I guess you have some instrument control, measurments, what else ?)
3. Is it important to stop all the task exactly at the same time ?

I can remenber a discussion started by Ben a while ago, basically he had lots of parallel task (about 5 or 6 hundred timed loops) and he had just 1 global variable to stop these tasks at the same time and after noticing some issues (update of the global variable in the user interface thread as far as I can remember) so after benchmarking different techniques  (notifier, queues, FGV) he went for an FGV.

Hope this helps 😉

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 3 of 7
(2,774 Views)
By FGV, you mean Global Variables? To answer your questions... :

1 - Only one or two at a time.
2 - Usually, the type of task I need to cancel is a for loop (soon to be a while loop! ;)) send commands commands to my "consumer" thread and this thread is communicating with instruments throught TCP/IP or GPIB.
3 - No.

Thanks for the link, I will read through it.

Yohan
0 Kudos
Message 4 of 7
(2,757 Views)
No, I meant Functional Global Variable which are also called LV2 Globals.
You'll easily find definitions of FGV in this forum, a good one here by tst.

From your answers I think you don't really need to develop some huge stop procedure. Replacing for loops by while loop seem necessary...
And now you have to determine in wich order you want to stop the different tasks.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 5 of 7
(2,748 Views)
As TiTou says, the functional global variable is one standard way to do this.  You can put a query in all your loops at each iteration to look for stop.  If you are unfamiliar with functional globals and their use in large applications, I have attached an example (it does not have a stop, since it is a pretty simple example).  The example is LV7.1.  I have it in 7.0 as well, if you need it.
0 Kudos
Message 6 of 7
(2,713 Views)
thanks!  I will have a look at the example when I find some time.

Cheers

Yohan
0 Kudos
Message 7 of 7
(2,681 Views)