M66 IF Request in Subroutine

More
2 years 11 months ago #286194 by CNC_ANDI
Hello, I'm currently trying to do security queries in the subrotines. This is mainly about the M66 query. So I'm trying to make 2 M66 queries in a subrotine that I want to query with an If statement. The first m66 query with if statement always works but with the second m66 query with if statement it fails because it doesn't write the value to the var

How can i do that?

    M64 P07 ; open Drawbar
    M66 P31 L3 Q1 ; wait for drawbar open
    O104 if [#5399 LT 0]
        (abort, failed to open drawbar)
    O104 endif
    G1 G53  F2500 Z-100
    M65 P07
    G4 P0.5
    M66 P29 L3 Q1 ; check for tool
    O105 if [#5399 LT 0]
        (abort, failed tool not clamped)
    O105 endif
    G0 G53 Z0

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago #286281 by rmu
Replied by rmu on topic M66 IF Request in Subroutine
That looks correct. Are you sure your signal routing is correct?

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago - 2 years 11 months ago #286303 by CNC_ANDI
Yes for sure. When i check this two if statements selfly than it works

I will try a return[] next time.
Last edit: 2 years 11 months ago by CNC_ANDI.

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago #286308 by rmu
Replied by rmu on topic M66 IF Request in Subroutine
This is how I do it and contrary to some comments in another thread this code actually works.

github.com/rmu75/rover-342-retrofit/blob...ines/rack_change.ngc

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago #286331 by CNC_ANDI
i have tried this too

O104 if [#5399 LT 0]
M65 P07
(abort, failed to open drawbar)
O104 endif

dont work

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago #286338 by rmu
Replied by rmu on topic M66 IF Request in Subroutine
try single-stepping the file and keep halshow open.

Please Log in or Create an account to join the conversation.

Time to create page: 0.234 seconds
Powered by Kunena Forum