LOGIC QUESTION IN KUKA SWITCH CASE
*I am having a subprogram called a. In this, I am writing the conditions for subprograms selection, which i have used in main program called b. Note subprogram apple have no conditions.
* I have used for ENUM for SWITCH CASE
* I have used a LOOP i main program
SUBPROGRAM a
......a()
Wait 0.05 sec
bag=#apple
.
;writing conditions for selecting Subprogram
.
.
Bag=#orange
.Endif.
.
;writing conditions for selection another subprogram
.
.
Bag=#grapes
Endif
.
E....
MAIN PROGRAM b
....b()
IOSTROm...
.
.
LOOP
.
.
switch bag
case #apple
apple() : a subprogram
case #orange
orange() : a subprogram
case #grape
grape() : a subprogram
default
asdf()
En....
END LOOP
At the end of every subprogram I am calling subprogram 'a' to select my next suitable subprogram
My Doubts
1. Since apple has no conditions and written at the top, my bag variable will be loaded with apple. and the programe goes down and when certain conditions are met then orange or grape will be loaded in my variable bag.
It is clear that when I have no conditions then apple subprogram will run because variable bag is loaded with apple
a) when my condition are met for orange subprgram It will start only after apple subprogram. In my point of view the variable BAG is loaded with apple first so it will complete its apple task first because it is above orange(even though the conditions are met). ??????????????????????????????????????????? and will my orange subprogram will it run after apple????????????????? or who will it behave?????????????????????????? NOTE my main programe 'b' is in loop.