object model aktiv extruder on an Idex
-
can someone tell me what the code should look like if i want to use the if command on the active extruder?
if {move.extruders[0].filament = "PLA"} if {sensors.gpIn[1].value = 0} M300 S600 P1000 G4 S2 M300 S600 P1000 G4 S2 M300 S600 P1000 G4 S2 M291 P"Tür oder Deckel geschlossen" R"Es wird PLA gedruckt bitte Deckel öffnen" S3
-
@Proschi78 This should work:
if state.currentTool >= 0 && #tools[state.currentTool].extruders > 0 var toolExtruder = tools[state.currentTool].extruders[0] if move.extruders[{var.toolExtruder}].filament = "PLA" && sensors.gpIn[1].value = 0 M300 S600 P1000 G4 S2 M300 S600 P1000 G4 S2 M300 S600 P1000 G4 S2 M291 P"Tür oder Deckel geschlossen" R"Es wird PLA gedruckt bitte Deckel öffnen" S3
-
@chrishamm unfortunately didn't work.
But that's how it works
Anyways thanks for your helpif (move.extruders[0].filament == "PLA" || move.extruders[1].filament == "PLA") if {sensors.gpIn[1].value = 0} M300 S600 P1000 G4 S2 M300 S600 P1000 G4 S2 M300 S600 P1000 G4 S2 M291 P"Tür oder Deckel geschlossen" R"Es wird PLA gedruckt bitte Deckel öffnen" S3
-
@chrishamm "The code you provided runs without errors, but there is neither a beep nor the M291 message displayed."
-
@Proschi78 I don't know what the value of your second gpIn port is but that script works OK on my setup if a tool is selected and if I remove the gpIn check.
-
@chrishamm said in object model aktiv extruder on an Idex:
I don't know what the value of your second gpIn port is but that script works OK on my setup if a tool is selected and if I remove the gpIn check.
it's just a magnetic switch. 0 and 1