|
From: Catherine S. <Cat...@ti...> - 2014-02-26 17:23:24
|
Hello all,
We have a critical Main plan that continuously needs to check for certain Lookup variables. Once the variables are switched to a certain value, a plan is called depending on which variable, while the Main plan continues to cycle to keep checking the Lookup variables. We are trying Main with just three plans to check for right now, but it eventually can check for as many as 60 plans. Here's pseudocode of what's going on:
Main:
{
RepeatCondition mainOn; //mainOn is always set to true
PlanA:
{
StartCondition Lookup(PlanAUI) == 1;
LibraryCall PlanA();
//switch PlanAUI back to 0;
}
PlanB:
{
StartCondition Lookup(PlanBUI) == 1;
LibraryCall PlanB();
//switch PlanBUI back to 0;
}
PlanC:
{
StartCondition Lookup(PlanCUI) == 1;
LibraryCall PlanC();
//switch PlanCUI back to 0;
}
}//end of Main
We tried the following scenarios:
1. if/elseif statements instead of StartConditions. This worked, but it was ridiculously slow. For just 3 if/elseif statements, it took 10 minutes after PlanAUI was switched to 1 for Main to go through all three of the possible plans and then all the nested plans that those plans called and mark them as SKIPPED, then finally call PlanA. The three plans and the ones that they call are all simple. After the Main took the initial 10 min to mark all the SKIPPED plans, the following loop iterations were a lot faster and called PlanA much more quickly when its Lookup variable was switched.
2. The StartCondition scenario as described in the pseudocode. This did not work at all. All three nodes were marked as WAITING for at least 15 min after the PlanAUI variable was switched to 1. It seems like after the nodes check their StartConditions and see that they are false through the first iteration, they won't "wake up" again for the following loop iterations when the appropriate Lookup variables are switched to 1.
3. Instead of StartConditions, we used PreConditions. This quickly failed all the plans before the PlanAUI variable could be switched to 1 and Main.ple failed as a result (expected, but worth a shot).
This is an important plan, so any suggestions would be appreciated! Thank you.
Catherine
|