I’m currently trying to replace a M-Function with a set variable with a function like expression.
Now:
MyVar = 500
M_MOVE_SOMETHING
Goal:
M_MOVE_SOMETHING[500]
I tried using the preprocessor replacements but I think that the “Is pattern” option there (which states “regular expression”) doesn’t understand matches / grouping.
If I configure
M_MOVE_SOMETHING\[[0-9]+\]
it will replace the string, but as soon as I add () to the expression, since I need to keep the number, it won’t even match anymore. “Unexpected open bracket”
M_MOVE_SOMETHING\[([0-9]+)\]
Anyone has another solution I could try to achieve my goal? (@michael.bertsch ? )
I am not an expert for regular expressions so i can’t tell you if you aproach with the preprocessor replacements would be possible.
The G-Code File is read by the Interpreter.
There is a default Configuration from B&R for the System Statements. But we can insert coustom Configuration which can extend the Language the Interpreter can understand.
This allows us to use the more advanced text interpreter functionality which is based on Tokens and Expected Objects.
This is not the easiest Task as the Documation for this in AS-Help is not the easiest to read.
You can compare the two variants now… i think the G172 in Svens code is not nessesary if you use the Pathsynch Statment.
I try to prevent the G172 because mapp Motion currently can have stops up to 300 ms du to the hold of the interpreter and the emptying of the buffers … depending by the calculation power.
Short addition:
If you need to run more than one AxesGroupInstance you have to improve the AIL-Macros and check the current Instance. There is an function for it available.
That was my mistake then, I added the G172
Good to know, thanks for the hint, I’ll update this!
And I had the impression that, if I used MPCMD_SET_M_FCT, it was somehow “blocking” again, even if the M-function configured in the axis group is not! When I changed it to MPCMD_SET_PREDEFINED_M_FCT it works now.
Hello Marcel,
as i went back through the thread i found this requirement…
You can use the “Defined(::)” Function to check if a Parameter was set within the G-Code
If you set the MinArgs to 0 it can be used with empty brakets. But as far as i know it needs brakets.