Remap M6, messages in subroutine not printed

More
05 Oct 2023 19:59 #282395 by Henk
HI
I have a basic M6 remap subroutine used for tool changing. Simple umbrella type toolchanger

I wrote some messages in the sub to help indicate where an error has ocured, but they are not printed for some reason. 

Initially i had them in the format (MSG, ....) and later changed them to (debug,.....) but no change.
If i copy the message from the sub and execute it in MDI. it does display the message as expected. 
note some are commented out using a ; they will not print. but the rest doesnt either


Any idea what im missing?

Help would be appreceated. 

.ngc subroutine  below...
o<remap_m6> sub

g90
#1=-47 ;tool clear position
#2=-164.53 ;tool grab position

;(debug,tool-ch start)

o200 if [#<_selected_tool> ne #<_current_tool>]


    m5

    g53 g0 z#2

    m19 p0

    m66 p2 l3 q10 (wait for sp-is-oriented signal)

    o500 if [#5399 eq 1]

        m64 p3 (car fwd) 

        m66 p0 l3 q10 ;wat for limit sw

        o300 if [#5399 eq 1]


            m64 p4 (release tool)


            m66 p5 l3 q10 (wait for limit tool-unclamped)

            o400 if [#5399 eq 1]

                g90
                g53 g0 z[#1]
                
                m64 p0

                g4 p1

                m66 p3 l3 q60 (wait for car to index to next tool)


                o100 if [#5399 eq 1]


                    g90

                    g53 g0 z#2
                    
                    m65 p0
                    m65 p4 (clamp tool)

                    m66 p4 l3 q10 ;wait for tool to clamp limit

                    o600 if [#5399 eq 1]

                        m65 p3 (car back)
                        m66 p1 l3 q10 ;wait for car to reach safe pos



                        ;(debug, confirm)


                        m64 p2
                        g4 p0.3
                        #5000=#<_selected_tool>
                        m6 g43 h#<_selected_tool>
                        m65 p2





                    o600 else
                        (debug,Failed to clamp tool)
                        (debug,Jog Z upwards, remove tool manually and excecute M101)
                        m65 p0
                        m65p4    
                        m65 p2
                        m65 p3
                        m65 p1
                        m5
                    
                        m2
                    o600 endif

                o100 else 
                    
                    (debug,Tool carousel failed to reach target position.)

                    m65 p0
                    m65p4    
                    m65 p2
                    m65 p3
                    m65 p1
                    m5
                    m2
                
                        



                o100 endif


            o400 else

                (debug,Tool not unclamped in time.)

                m65 p0
                ;M101 (car back)
                m65 p2

                m65p4
                g4p2
                m65 p1
                m65 p3
                m5
                m2

            o400 endif
        o300 else

            (debug,Toolchanger failed to reach forward position.)

            m65 p0
            m65p1
            m65 p2
            m65 p3 (car back)
            m65p4
            m5 
            m2

        o300 endif
    o500 else 

    (debug,Spindle Orientation Failed)
    m5
    m65 p0
    m65p1
    m65 p2
    m65 p3 (car back)
    m65p4
    m2
    o500 endif



o200 else
m6 g43 h#<_selected_tool>
o200 endif


o<remap_m6> endsub






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

More
06 Oct 2023 20:18 #282463 by bkt
honestly neve check debug messages in mdi mode .... in auto run mode it work?

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

More
06 Oct 2023 21:17 #282466 by MaHa
I recognized some M2 in your subroutine, which seems not recommended, better use abort

linuxcnc.org/docs/html/remap/remap.html#...g_dealing_with_abort

I started your sub in my simulation, and after mcode timeout some debug messages appeared, so it seems to work. Maybe you can debug #5399 before the if statement, to see which path is expected

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

More
11 Oct 2023 20:00 #282769 by andypugh
Where are you looking for the error messages?

If you start LinuxCNC from the command-line (with the command "linuxcnc") then you might see the messages printed to the terminal.
It's worth a try, at least.

Also put in some messages that absolutely should be displayed, regardless of probe results etc.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum