ACR-MOTIONMAX Installation Guide
20
Step 13. Editing the S Code Function
When ACR-MOTIONMAX Encounters a SCode … Example: S2000.
It will do the following Steps.
1). Check if the Requested Spindle Speed is different from the Current Spindle Speed.
2). If it is it then checks if the Speed is within the current Gear Range as defined in the Parameters.
3). If the new Speed requires a different Gear, ACR-MOTIONMAX will set the Binary code of the Gear
Range to be in.
4). If Gear Change is Required then the AcroBasic shall stop the spindle and switch to the new Gear Range.
5). If the spindle was previously running (SpindleRunning Bit 190 =1) then the function will restart the
spindle and wait till its running at the commanded speed.
6). If the spindle wasn’t previously running (SpindleRunning Bit 190 =0) the function should write the
Dac value but not restart the spindle.
7). The function then Clears the S Strobe and sets the S Done bits to Signal ACR-MOTIONMAX to
continue.
Parameters Gear Range Section of the Parameters File
[SpindleOptions]
SpindleGears=3
SpindleMaxRPMGearRange0=1000
SpindleMaxRPMGearRange1=2000
SpindleMaxRPMGearRange2=4000
SpindleMaxRPMGearRange3=4000
Control Signals used with S Codes:
S Strobe Bit 151 Set by ACR-MOTIONMAX to Trigger the SCode
Handler Function
S Done Bit 148 Set by AcroBasic when S function is completed
SpindleRunning Bit 190 Tells AcroBasic if spindle was Previously Running
GearChangeActive Bit 176 Set in AcroBasic to Signal a Gear change is occurring
GearRangeBit0 Bit 177 LSB of 3 bit Binary code of Gear Range
GearRangeBit1 Bit 178 Binary code of Gear Range
GearRangeBit2 Bit 179 MSB of 3 bit Binary code of Gear Range
Axis5 Dac (Spindle Axis) P6480 ACR-MOTIONMAX Writes this as the Spindle
Speed
REM ********************
REM *** S Strobe Sub ***
REM ********************
8000 IF (NOT CTLMDone) THEN GOTO 8990
8010 IF (NOT CTLTDone) THEN GOTO 8990
8011 IF (CTLTStrobe) THEN GOTO 8990
REM ~ STORE D/A, CLR SPINDLE ORIENTED SIGNAL, SAVE STATE OF SFWD/SREV
8013 P3 =P6480: P4= OUTSpindleForward: P5= OUTSpindleReverse: AXIS5 OFF

Insert Your S Code & Gear Change Logic Code Here

REM IF SPINDLE WAS RUNNING, RESTORE D/A AND DIRECTIONS & WAIT FOR UPTOSPEED
8351 IF (BIT 190) THEN P6480= P3: OUTSpindleForward= P4: OUTSpindleReverse= P5: INH 25 9:
GOTO 8420
REM ~ ELSE CLR FWD & REV ENABLES & reset D/A
8352 OUTSpindleForward: OUTSpindleReverse: P6480= P3
REM ~CLEAN UP
8420 SET CTLSDone: CLR 183 : REM Set SDONE, clear spindle oriented bit