Thanks Danal for the reply I have a Duet Wifi the switches are attached to the Z end stop switch which Index 2.
Board: Duet WiFi 1.02 or later
Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 2.05 (2019-12-13b1)
Duet WiFi Server Version: 1.23
Duet Web Control 2.0.4
;General preferences
M111 S0 ; Debug off
G21 ; Work in millimetres
G90 ; Send absolute coordinates...
M555 P2 ; Set output to look like Marlin
M83 ; ...but relative extruder moves
M208 Y0 Z0 S1 ; set axis minima (adjust to make X=0 and Y=0 the edges of the bed)
M208 Y340 Z380 S0 ; set axis maxima (adjust to suit your machine)
M208 X0 S1
M208 X360
;Wifi
M550 XXXXXX ; Machine name (can be anything you like)
;M551 XXXXXX ; Machine password (used for FTP connections)
M540 P0 XXXXXXXXXX D ; MAC Address ; IP address (0 = use DHCP)
M554 Pxxx.xxx.x.x ; Gateway
M553 P255.255.255.0 ; Netmask
M555 P2 ; Set output to look like Marlin
M575 P1 B57600 S1 ; Comms parameters for PanelDue
M552 S1 ; start wifi
;Endstops
M574 X1 Y2 S1 ; set endstop configuration (X, Y, Z endstops only, at low end XY, high Z, active low)
M574 Z2 S1
M581 Z2 S1 T2
; Z probe
M558 P1 R1.0 H10 F200 T1500 X0 Y0 Z0 ;digital piezo sensor, output falls on contact, probing speed, not used to home axes
G31 Z1.842 P500 ;sensor is nozzle and debounce value.
; Mesh Levelling
M557 X10:360 Y10:320 S50 ;define mesh
;M376 H10 ;taper off after 10mm
;G29 S1 ;load mesh
;Drives
M667 S1 ; set to CoreXY mode
M569 P0 S1 ; Drive 0 goes forwards (change to S0 to reverse it)
M569 P1 S1 ; Drive 1 goes forwards
M569 P2 S1 ; Drive 2 goes forwards
M569 P3 S0 ; Drive 3 goes forwards
M569 P4 S1 ; Drive 4 goes forwards
M92 X160 Y160 Z3200 E390 ; Set axis steps/mm Set extruder steps/mm
M350 X16 Y16 Z16 E16 I1 ; Set 16x microstepping with interpolation
M566 X400 Y400 Z20 E300 ; Set maximum instantaneous speed changes (mm/min)
M201 X1000 Y1000 Z100 E6000 ; Set accelerations (mm/s^2)
M203 X60000 Y60000 Z200 E20000 ; Set maximum speeds (mm/min)
M204 P1000 T4000 ; Set printing and travel accelerations
M906 X1000 Y1000 Z1000 E1100 I30 ; Set motor currents (mA)extruder current just enough will click not strip
M84 S30 ; Set idle timeout
M572 D0 S0.001 ; Set pressure advance S0-off
M207 S0.75 R-0.000 F3200 T3200 Z0.0 ; Firmware Retraction
M593 F40 ; cancel ringing at 40Hz
; Heaters
M305 P0 T100000 B3950 C0 R4700 ; Set thermistor + ADC parameters for heater 0
M143 H0 S150 ; Set temperature limit for heater 0 to 120C
M305 P1 T100000 B4725 C7.060000e-8 R4700 ; Set thermistor + ADC parameters for heater 1
M143 H1 S285 ; Set temperature limit for heater 1 to 285C
M307 H1 A394.1 C234.5 D3.0 S1.00 V11.8 B0
; Tools
M563 P0 D0 H1 ; Define tool 0
G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets
G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C
M591 D0 P5 C3 R140:220 E3.0 S0
; Thermistors and heaters
M570 S180 ; Increase to allow extra heating time if needed
; Automatic power saving
M911 S10 R11 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; Set voltage thresholds and actions to run on power loss
;Fan config
M106 P0 S0 H-1 C"Hotend Fan"
M106 P1 S1 I0 F500 H1 T45 C"Parts Fan"
M106 P2 T38:42 H100:101:102 C"Board Fan"
;M106 P1 S1 I0 F500 H1 T45
;M106 P1 T45 H1
;M106 P0 S0 I0 F500 H-1 ; set fan 2
;M106 P1 H-1 ; set fan 1 to be gcode controlled
;M106 P1 S0 ; switch off fan 1 at startup (and verify m106 will control fan 1)
; Tool definition
;M563 P0 D0 H1 F1 ; Define tool 0
;G10 P0 S0 R0 ; Set tool 0 operating and standby temperatures
;*** If you are using axis compensation, put the figures in the following command
;M556 S78 X0 Y0 Z0 ; Axis compensation here
M501 ; Run config-override.g
T0 ; select first hot end
M561