This should be a simple one. Using a TurboPMAC you can "undefine" an M variable like this:
M100->*
I can still assign a value to M100 , I assume a 24bit Integer? and use it in my programs. It works fine.
In looking through the manual there is a section that talks about making additional timers and it says I need to assign my M variable to "An open memory location"
From the User Manual:
If more timers are needed, use memory address X:$0. This 24-bit register counts up once per servo cycle.
Store a starting value for this, then each scan subtract the starting value from the current value and
compare the difference to the amount of time to wait. By subtracting into another 24-bit register, possible
rollover of X:$0 is handled gracefully.
Define the following M-variables with on-line commands:
M0->X:$0,24 ; Servo counter register
M85->X:$0010F0,24 ; Free 24-bit register <=====
M86->X:$0010F1,24 ; Free 24-bit register <=====
Then write as part of the PLC program:
M85=M0 ; Start of timer
M86=M0-M85 ; Time elapsed so far
WHILE (M86
M86=M0-M85 ; Time elapsed so far
ENDWHILE ; Exit PLC program here when
Here is the question,why do I need the 2 marked steps, why can't I just use
M85->*
M86->*
The reason I ask is that I normally just find an unused M variable then do the
Mnnnn->* and use it like a P variable. After reading this in the manual I am afraid I am going to get into trouble doing what I am doing.