Murphy,
I have noticed that too much logic in the TIMER.FIL file does degrade performance. If you think about it everytime the timer interval you set elapses then all the logic runs again.
Motion is handled separately by the second CPU on the motion board so you're safe there cause it won't affect positioning performance.
It's all in how you manage the IF THEN GOTO logic in the TIMER.
Use GOTO to jump around large chunks of logic that don't need to run once the timer logic finds what it needs. This makes the logic flow run faster. Then put the most important events at the top so they run first.
The two major factors seem to be how well the logic flows and how often the timer interval is set. TIMER ON,1000 every 1 second is very good cause in computer terms that's a long time. I didn't try too hard but I got up to 100 lines in the TIMER.FIL file and it ran quick at a 1000 milliseconds.
Your package is different than mine and the limits to how many lines in the factory automation program may be less. CNC Lite and Professional do have a limit but find another way like other buttons on the screen if you have too many lines for the timer. The guys at Camsoft have always been more than willing to help me if I needed a new command or something increased.
200 variables are okay. I know there is room for 999 of them.
The MACRO.FIL and MCODE.FIL files I have done for some very nasty machine tool changers have been huge. Far bigger logic files than what you have so far. I wouldn't worry about these. If Camsoft could handle these machines it could handle anything.
Also I ran into something else on the test program I made. Watch out when using IF THEN to compare a variable and some text like the EXIT MENU text and using spaces at the end of the text. It compares every thing even spaces unless it's a numeric value.
On the subject from yesterday
Yesterday you didn't update the TIME variable \31 in the code you posted so there was no need to go into a loop. So if it wasn't for the reason that you wanted to update the pop up list box menu for the time then the code I posted yesterday will work very cleanly.
Instead of the M code from yesterday put this code in the TIMER and also refresh your variables here too.
!IF \81=0 THEN \9=FREE
!IF \81=2 THEN \9=BUSY
!LISTCLEAR: LISTSETUP 20;5625;2000;2000 :LISTADD STAGE 1 STATUS :LISTADD EXIT MENU :LISTADD TIME LEFT \31 :LISTADD STATUS \9 :LISTADD DWELL \151 :LISTADD DRIP \171 :LISTPICK \8
Jim C. |