perform_simple_code is not working on DSF 3.5.2
-
Hi,
We were using this function to send some parameters from python to Duet:def updateGlobalVar(self,varname, val): cc = CommandConnection() cc.connect() ############ This is Ray's code to store data to the Duet side, There might be a better way to do that cc.perform_simple_code("if exists(global.{})".format(varname)) cc.perform_simple_code(" set global.{}={}".format(varname,val)) cc.perform_simple_code("else") cc.perform_simple_code(" global {}={}".format(varname,val)) cc.close()
It doesn't work anymore after I have upgraded to DSF 3.5.2.
The previous version was:
Board: Duet 3 MB6HC (MB6HC)
DSF Version: 3.4.6
Firmware: RepRapFirmware for Duet 3 MB6HC 3.4.6 (2023-07-21) -
@pouryatorabi Meta G-code has been supported only within macro or job files (at least in SBC mode). If you need code flow in your custom code implementation, either move the corresponding code to a macro file and invoke that using
M98
, or fetch the object model using yourcc
in your function and check if the returnedglobal
part of the object model contains your varname, and then either set or define it. -
@chrishamm I moved everything in a macro and now it works, thanks.
-
-