If statement for macro trigger in RRF
-
Hello,
I need help with syntax. I have duet 2 board with RRF.
I have a button that calls trigger2.g
So far this is ok.I have a filament runout sensor switch connected to zstop.
Depending on the state of the sensor I either want to start filament loading or filament unloading on button press triggering trigger2.g
The sensor is right at the extruder so it is a good indication of which gcode to start upon button press.M591 D0 returns this:
Simple filament sensor on pin !zstop, enabled, output low when no filament, filament present: yesHow is my if statement will look like?
if sensors.filamentMonitors[0].filamentPresent = true ;unload gcode else ;load gcode endif
Error: in file macro line 1 column 4: meta command: unknown value 'filamentPresent'
Thank you
-
@daninet You can look up the correct name for an object model variable by looking in the Object Model plugin. If I setup a runout sensor with
M591 D0 C"io4.in" P2 S1
, and look in the Object Model plugin, I can see:
So I think it is
sensors.filamentMonitors[0].status
that you want, and it's either 'ok' or 'noFilament'.Ian
-
-
I didnt know about this tool, it's cool. Makes this so much easier. Thanks
I think this is solved lets continue any discussion in the other topic: https://forum.duet3d.com/topic/34132/orbiter-filament-sensor-setup/9
-