[http://www.dynomotion.com/Help/Cmd.htm#GetGatherDec GetGatherDec] [http://www.dynomotion.com/Help/Cmd.htm#SetGatherDec SetGatherDec] [http://www.dynomotion.com/Help/Cmd.htm#GetGatherHex GetGatherHex] [http://www.dynomotion.com/Help/Cmd.htm#SetGatherHex SetGatherHex]
==Performing multiple Operations continually in a forever Loop==
It doesn't make logical sense to have more than one forever loop in a program. That would be like saying to someone go and check if any mail arrived over and over forever and then when you are done with that go and check if someone is at the back door over and over forever. Obviously the back door will never get around to being checked. <br /> <br /> The solution is to create a single loop that checks two things each time through the loop. #1 go check the mail, #2 go check the back door, # 3 repeat. Using this technique any number of things can be continuously performed in a single loop. <br /> <br /> There is one catch with this technique. None of the operations should "block" or take a significant amount of time to perform. If you were to perform an operation that took a long time to complete all the other continuous operations would be blocked and go unserviced for that period of time. If it is required to do something that takes a significant amount of time then the solution is to break it down into pieces (states) that can be each performed in an insignificant amount of time. For example say you wish to activate a lubrication relay for 2 seconds each time a button is pushed. Instead of delaying 2 seconds you would instead record the time the relay was turned on, then go off and do other things while frequently returning to see if it is time to turn the relay off.