CONSTANT "input_estopon", 0
CONSTANT "input_xdatum", 1
CONSTANT "input_ydatum", 2
CONSTANT "input_zdatum", 3
CONSTANT "input_viceopen", 4
CONSTANT "input_vacuumbedbutton", 4
CONSTANT "input_airpressure", 5
CONSTANT "input_toolrelease", 6
CONSTANT "input_waitforinputR", 6
CONSTANT "input_guardclosed", 7
CONSTANT "input_8postoolchanger", 8
CONSTANT "input_toolchangerfitted", 9
CONSTANT "input_carocelcounter", 10
CONSTANT "input_input1waitR", 11
CONSTANT "input_input2viceR", 12
CONSTANT "input_doorfullyopenR", 15

CONSTANT "output_spindleenable",8
CONSTANT "output_guardlock", 9
CONSTANT "output_zbrakerelease", 10
CONSTANT "output_vacuumbedon", 11
CONSTANT "output_viceopen", 11
CONSTANT "output_toolreleasedrawbar", 12
CONSTANT "output_auxout1RMicroturn", 12
CONSTANT "output_coolanton", 13
CONSTANT "output_carocelpower", 14
CONSTANT "output_caroceldirection", 15
CONSTANT "output_auxout1R", 16
CONSTANT "output_auxout2R", 17
CONSTANT "output_openguardR", 18
CONSTANT "output_closeguardR", 19
CONSTANT "output_spindledirection", 21

CONSTANT "unknown", 0
CONSTANT "microrouter", 1
CONSTANT "microrouterpro", 2
CONSTANT "microroutercompact", 3
CONSTANT "microroutervertical", 4
CONSTANT "novamill", 5
CONSTANT "novamillpro", 6
CONSTANT "triton", 7
CONSTANT "tritonpro", 8
CONSTANT "triac", 9
CONSTANT "triacvme", 10
CONSTANT "micromill", 11
CONSTANT "maxirouter", 12
CONSTANT "cyclone", 13
CONSTANT "cyclonestepper", 14
CONSTANT "meteor", 15
CONSTANT "microturn2000", 16
CONSTANT "microturn", 17
CONSTANT "mirac", 18
CONSTANT "novaturn", 19
CONSTANT "router2600", 20
CONSTANT "router2600pro", 21
CONSTANT "router2600atc", 34
CONSTANT "compact1000", 22
CONSTANT "compact1000pro", 23
CONSTANT "vmc1300", 24
CONSTANT "vmc1300pro", 25
CONSTANT "turn270", 26
CONSTANT "microrouterproscanner", 27
CONSTANT "micromillpro", 28
CONSTANT "mrc40", 29
CONSTANT "router6600", 30
CONSTANT "router6600pro", 31
CONSTANT "router6600atc", 32
CONSTANT "turn370",33
CONSTANT "router2600atc",34
CONSTANT "turn270pro",35
CONSTANT "turn270prom",36
CONSTANT "turn370pro",37
CONSTANT "turn370prom",38
CONSTANT "microturn2000ns",39
CONSTANT "microturnpro",40
CONSTANT "f1router",41
CONSTANT "pcbengraver",42

'CONSTANT "table_startingup",100
'CONSTANT "table_estoppressed",101
'CONSTANT "table_dooropen",102
'CONSTANT "table_guardunlock",103
'CONSTANT "table_speedoverride",104
'CONSTANT "table_feedoverride",105
'CONSTANT "table_maxfeed",106
'CONSTANT "table_speedoutput",107
'CONSTANT "table_eventUpdate", 108

CONSTANT "table_startingup",100
CONSTANT "table_estoppressed",101
CONSTANT "table_dooropen",102
CONSTANT "table_guardunlock",103
CONSTANT "table_speedoverride",104
CONSTANT "table_feedoverride",105
CONSTANT "table_maxfeed",106
CONSTANT "table_speedoutput",107
CONSTANT "table_eventupdate",108
CONSTANT "table_eventhoming",109

CONSTANT "table_movesmade",200
CONSTANT "table_consumed",998
CONSTANT "table_readupto",999
CONSTANT "table_firstmove",1000

CONSTANT "table_xpos",110
CONSTANT "table_ypos",111
CONSTANT "table_zpos",112
CONSTANT "table_ivpos",113
CONSTANT "table_positionneedsresetting",114
CONSTANT "table_idletesting",115
CONSTANT "table_checkingemptybuffer", 116
CONSTANT "table_spindlerunning", 117
CONSTANT "table_idle",118
CONSTANT "table_applistening",119
CONSTANT "table_speedrequest",120

CONSTANT "vr_tool",1
CONSTANT "vr_machine",2

CONSTANT "vr_version",0
CONSTANT "vr_tool",1
CONSTANT "vr_machine",2
CONSTANT "vr_license",10
CONSTANT "vr_notes", 1000
CONSTANT "vr_licensedto", 2000

' Constants for MINT comms array
CONSTANT "COMMS_Task" , 1 ' PC <-> Task Notification
CONSTANT "COMMS_Mode" , 2 ' PC  -> Mode (Home, Jog, Auto)
CONSTANT "COMMS_Feed" , 3 ' PC  -> Feed Change Request
CONSTANT "COMMS_Speed" , 4 ' PC  -> Speed Change Request
CONSTANT "COMMS_FeedOverRide" , 5 ' PC <-> % feed  override value
CONSTANT "COMMS_SpeedOverRide" , 6 ' PC <-> % speed override value
CONSTANT "COMMS_Tool" , 7 ' PC  -> Tool Number Request
CONSTANT "COMMS_FeedPot" , 8 ' PC  -> 0 , Pot NOT Fitted   1  , Pot Fitted
CONSTANT "COMMS_SpeedPot" , 9 ' PC  -> 0 , Pot NOT Fitted   1  , Pot Fitted
CONSTANT "COMMS_ATC" , 10 ' PC  -> 0, None, 1..??,ATC type number in Mint
CONSTANT "COMMS_XHomed" , 11 ' PC <-  0 , Axis not yet Homed  1 , Axis Homed
CONSTANT "COMMS_YHomed" , 12 ' PC <-  0 , Axis not yet Homed  1 , Axis Homed
CONSTANT "COMMS_ZHomed" , 13 ' PC <-  0 , Axis not yet Homed  1 , Axis Homed
CONSTANT "COMMS_MaxFeed" , 14 ' PC  -> Maximum Feedrate
CONSTANT "COMMS_MaxSpeed" , 15 ' PC  -> Maximum Spindle Speed
CONSTANT "COMMS_PokeValue" , 16 ' PC  -> Poke Value
CONSTANT "COMMS_PokeAddress" , 17 ' PC  -> Poke Address
CONSTANT "COMMS_MCode" , 18 ' PC  -> M Code Change Request
CONSTANT "COMMS_Safe" , 19 ' PC <-  0 , machine in an UNSafe contition  1 , Safe
CONSTANT "COMMS_BufferSize" , 20 ' PC  -> Size fo the MINT move buffer (2..64)
'****** locations 21 to 30 reserved for Turning use only
CONSTANT "COMMS_PerMinPerRev" , 21 '        0,feed/min 1,feed/rev
CONSTANT "COMMS_RPM_CSS" , 22 '        0,RPM      1,CSS
CONSTANT "COMMS_Feed_Rev" , 23 '        FeedRate / Rev    (in Step units-same as normal Feed)
CONSTANT "COMMS_ActualSpeed" , 24 '        Actual Spindle Speed
CONSTANT "COMMS_CSSDiameter" , 25 '        Setup Diameter for CSS (in motor steps)
CONSTANT "COMMS_CSSSpeed" , 26 '        Spindle Speed for CSS (in steps per min / 1000)
'        CSS in Metres / minute
CONSTANT "COMMS_MaxCSS" , 27 '        Max speed when in CSS mode
'****** OK to add stuff here in milling or turning (update both files though !)
CONSTANT "COMMS_MintVerMajor" , 31 ' PC  <- Mint: The Mint program major version number
CONSTANT "COMMS_MintVerMinor" , 32 ' PC  <- Mint: The Mint program minor version number
CONSTANT "COMMS_MachProblem" , 33 ' PC  <- Mint: Machine not safe problem identifier
CONSTANT "COMMS_RemoteControl" , 34 ' PC  -> Mint: Machine functions to be controlled by CIM not mcodes
' *at this is now RemoteControl because CIM mint stuff is broken up into 3 parts
' RemoteControl is cycle start/status output to CIM controller stuff
CONSTANT "COMMS_MinSpeed" , 35 ' PC  -> Mint: Minimum Spindle Speed
CONSTANT "COMMS_DriveEnable" , 36 ' PC  -> Mint: Enable the drives (and take off brakes etc)
CONSTANT "COMMS_EstopState" , 37 ' Mint -> PC:  Read the estop state
CONSTANT "COMMS_RemoteVice" , 38 ' This one determines if M10/M11 does vice or CIM In/Out 2 controls it
CONSTANT "COMMS_RemoteChuck" , 38 ' This one determines if M10/M11 does vice or In/Out 2 controls it
CONSTANT "COMMS_StepPerMM" , 39 ' PC -> Mint: Tell mint how many steps per MM we are using
CONSTANT "comms_stepperMMz" , 57 ' PC -> Mint: Tell mint how many steps per MM we are using on the Z axis
CONSTANT "COMMS_HandWheelAxis" , 40 ' PC -> Mint: Which axis to enable handwheel for
CONSTANT "COMMS_HandWheelDist" , 41 ' PC -> Mint: How far in mm to move per HW step
CONSTANT "COMMS_XPLUSLimit" , 42 ' pc -> Mint
CONSTANT "COMMS_XMINUSLimit" , 43 ' pc -> Mint
CONSTANT "COMMS_YPLUSLimit" , 44 ' pc -> Mint
CONSTANT "COMMS_YMINUSLimit" , 45 ' pc -> Mint
CONSTANT "COMMS_ZPLUSLimit" , 46 ' pc -> Mint
CONSTANT "COMMS_ZMINUSLimit" , 47 ' pc -> Mint
CONSTANT "COMMS_MMPerStepMul" , 48 ' Mint -> Pc  ' set stepspermm scaling in the mint (eg, for microstepping)
CONSTANT "COMMS_UseSecondLimits" , 49 ' Mint -> PC: tell control software to use the second alternative limits if
'this value is 1

'****** RESERVED for threading stuff here 50 to 59 (ie Lathe only)
CONSTANT "COMMS_MasterDistX" , 50 '        Master Distance for threading (ie,how many encoder counts)
CONSTANT "COMMS_FlyDistX" , 51 '        X fly distance for threading  (ie,how many X steps to do)
CONSTANT "COMMS_MasterDistZ" , 52 '        Master Distance for threading (ie,how many encoder counts)
CONSTANT "COMMS_FlyDistZ" , 53 '        Z fly distance for threading  (ie,how many Z steps to do)
CONSTANT "COMMS_DoThread" , 54 '        Do the thread now
CONSTANT "COMMS_AccelFact" , 55 '        Acceleration multiplier for threads
CONSTANT "COMMS_AuxEncPulseCount", 56 '        Added for debugging in easyupgrader

' 60 to 69 used for reading captured array data
CONSTANT "COMMS_ReadCapture" , 60 '        DPR event driven from mint when it wants us to read captured data
CONSTANT "COMMS_CaptureAxis1" , 61 '        Tell mint which axis to capture (main scanning axis)
CONSTANT "COMMS_CaptureMove1" , 62 '        The relative move for capturing
CONSTANT "COMMS_CaptureAxis2" , 63 '        The other axis to step across in
CONSTANT "COMMS_CaptureMove2" , 64 '        The relative move for stepping across in
CONSTANT "COMMS_DataReadOK" , 65 '        Signal to the mint that the capture was uploaded ok
CONSTANT "COMMS_EnableLaser" , 66 '        Tell the mint to enable the scanner (if door is closed)

' 70 ... General flags
CONSTANT "COMMS_TCRemoved" , 70 '        Tells us that the toolchangers has been removed to force manual
'toolchange mode
CONSTANT "COMMS_TCHeightAdjust" , 71 '        Adjust the Z height when picking up or dropping tools. the mint adds
'this number to the default Z change positon
CONSTANT "COMMS_NumAxes" , 72 '        Tell mint number of axes (nextstep 5560+)
CONSTANT "COMMS_Airpressure" , 73' positive FOR air pressure

' 80 is used for probing results
CONSTANT "COMMS_ProbedPos" , 80 '        Fast input captured position (M80)
CONSTANT "COMMS_ProbeFlag" , 81 '        Probing cycle status (0,OK, 1,error, 2,start probing, 3,stop probing,
'4, mint finished proing)

CONSTANT "comms_needtohome", 90
CONSTANT "comms_homefeed", 91

CONSTANT "comms_acceljog", 92 'acceleration FOR jogging
CONSTANT "comms_accelprogram", 93 'acceleration FOR programrunning

CONSTANT "COMMS_RapidFeed", 94

CONSTANT "COMMS_Reset" , 98 ' PC -> Mint: Reset any loops going on
CONSTANT "COMMS_Event" , 99 ' PC <-> Event Notification


CONSTANT "toolchangespeed" ,3000
CONSTANT "toolchangezup" ,1
CONSTANT "toolchangezdown" ,-152
CONSTANT "toolchangexhome" ,5
CONSTANT "toolchangeycentre" ,-69
CONSTANT "toolchangexnearlyin" ,-290
CONSTANT "toolchangexin" ,-367
CONSTANT "toolchangemaxpockets", 8


CONSTANT "num_moves_newspeed",2
CONSTANT "num_moves_linear",4
CONSTANT "num_moves_arc",7


