Problems with meta comments
-
@philipp-r
...what dc42 said, but for other variables you can use "set variablename" = bla bla -
@peter247 thanks for the answer. Yes, I have Tool1
I also double checked it, and it should be move.axes[2].machinePosition -
@philipp-r said in Problems with meta comments:
I also double checked it, and it should be move.axes[2].machinePosition
You are right I didn't understand the object model viewer , BUT set variablename = whatever , you still need the var or global in it so it should be
set var.variablename = whatever , that I have learned. -
@dc42 maybe I should clarify my problem in more detail. Currently, I'm working with a tool changer with 4 Tools with different Z-offsets, my Tool1 has an offset in Z = -12. When I change the nozzle, I'm searching for the new offset. For this, I use a 10 mm gauge lock on the Heated Bed to get the new Z-offset. For example, on the DWC movement section, the value 9.95 mm is displayed.
So now I'm calculating (-12)+(10-9.95) = -11.95--> new Z-Offset which I should change in the config.g file.Now I want a macro for this procedure. But I don't see how it will be done with G10 as far as I know, I can only set the Z-offset value but can't put in a function like above. Please correct me if I'm wrong.
-
@philipp-r Eventually something like this:
if move.axes[2].machinePosition != 10 G10 P{ tools[1].offsets[2] + 10 - move.axes[2].machinePosition } M500 P10
I don't know the exact G10 command for setting offsets... so there could be a fault!
-
@cosmowave said in Problems with meta comments:
I don't know the exact G10 command for setting offsets... so there could be a fault!
Looks like you want to set the Z offset of tool 1, so:
G10 P1 Z{tools[1].offsets[2] + 10 - move.axes[2].machinePosition}
-
Here is the code for a macro to set your Nozzle height with a Gauge block of 10 mm of your selected Tool:
G10 L1 P{state.currentTool} Z{ tools[1].offsets[2] + 10 - move.axes[2].userPosition } M500 P10 ;save values into config-override.g
-
Had to change from move.axes[2].machinePosition to move.axes[2].userPosition. Because my machine coordinates and tool coordinates are different. But thank you guys for your help
-
@dc42 one more question came also to my mind. Is it possible to check whether a Pin input is true or false in a if or while condition?
I have defined a Trigger1.g at my machine and now i want to check the pin status, like:
if e0stop = true ... elif...
i tried also:
if M582 T1 = true ... elif...
But i got a error message for M582 is not known.
-
@philipp-r yes, you can configure the pin as a GpIn port using M950 with J parameter (which you probably do already to use it as a trigger), and then test sensors.gpIn[n].value.
-
@dc42 thank you for your help David it worked.