Possible to pass variable to custom m-codes?
-
I have been having issues passing variables to custom m-codes. Is that possible via DSF, or is that a fundamental limitation? When I try running the following macro and pass in any parameter, the DSF side shows the variable L as the string "{param.L}" instead of whatever value I try to assign.
Wrapper macro file:
if exists(param.L) M1234 L{param.L} else M1234
Currently using RRF 3.4.5 and testing with the basic custom m-code example from the dsf-python repository
-
@rymnd I think this is one for @chrishamm to look at.
-
@rymnd That's expected in v3.4 and earlier. You need to check if the parameter is an expression (I think there is a parameter property for that) and evaluate it using the
EvaluateExpression
command if it is. @Falcounet may help with the Python specifics.