Error: unknown variable 'global.magprobestatus'
-
I am trying to run this macro but I keep getting the error unknown variable. This is a Duet 3 6HC with SBC, what am I doing wrong.
if sensors.probes[0].value[0] = 0
set global.magprobestatus = "attached"
elif sensors.probes[0].value[0] > 500
set global.magprobestatus = "docked" -
@thaug29 said in Error: unknown variable 'global.magprobestatus':
I am trying to run this macro but I keep getting the error unknown variable. This is a Duet 3 6HC with SBC, what am I doing wrong.
if sensors.probes[0].value[0] = 0
set global.magprobestatus = "attached"
elif sensors.probes[0].value[0] > 500
set global.magprobestatus = "docked"You have to create a variable before you can refer to it with a set command.
To create the variable you would use something like:
global magprobestatus = "unknown"
That is not a typo, there is no period, there is one space.
I create my globals in config.g.
Frederick
-
@fcwilt said in Error: unknown variable 'global.magprobestatus':
global magprobestatus = "unknown"
Thanks You, that did it!