ACR-MOTIONMAX Installation Guide
19
Step 12. Edit the M Code Functions
ACR-MOTIONMAX is set up to Provide 128 User definable MCodes.
They are set By ACR-MOTIONMAX via the MCode bits Bank of Signals (Bits 1920-2047)
When ACR-MOTIONMAX encounters A MCode it Parses the Code and sets a corresponding Bit of the
MCode Signals to Tell AcroBasic which Subroutine to Call.
For Example M00 = Bit 1920 … Bit 1921 = M01 and so on.
Also ACR-MOTIONMAX will set the MStrobe Bit (Bit 150).
Program 1 will see the Strobe Signal = 1 and Parse the MCode Bit and call the proper subroutine to execute
the desired MCode Function.
Rules of operation:
All MCode functions are executed at Dedicated Address of

Program 1

Starting at Address 1000.
All MCode functions are called from the MCode Parsing function Starting at line 11.
The Template Provides 128 MCode Subroutines.
These subroutines are 50 lines long.
Do not Exceed this limit of 50 lines or the parser will call the wrong function.
For Example: M00 subroutine is at Address 1000 to 1049 as shown in the Code Below.
REM ***********************************
REM *** MCode EXECUTION SUBROUTINES ***
REM ***********************************
REM ~ M00
1000 CLR CTLInCycle: REM Set program stop
1001 GOSUB 40500 :REM CLEANUP MCODES
1049 RETURN
REM ~ M01
1050 IF (CTLOptStopActive) THEN CLR CTLInCycle: REM set optional program stop if active
1096 GOSUB 40500: REM CLEANUP MCODES
1099 RETURN
MStrobe = 1
STrobe = 0
(11 to 150 )
Parse
M-Code
( 40500 )
Set M Done
Clear All M
Codes
M Code
Process
Done
?

Progam 1

Yes
( Line 6 )
Control
Ready
Bit 143
= 1 ?
Control
Initialized
Bit 145
=1 ?
( 30000 )
Do Control Initialazation
Yes
(1000 to 7999 )
Do MCode
Functions
Line 5Line 4
Yes
No
NoYes
No