Open Close Air

Started by singline, August 03, 2016, 02:11:27 PM

Previous topic - Next topic

singline

Hi,

This one is a little more KRL than PRC. I have a lovely pick and place setup in PRC based on the tutorial file. That works with manual air, but I'm attempting to use the code that the spindle uses when picking up a tool - in my mind this should work - to turn on and off our KUKA's air.

OpenCollet
GLOBAL DEF OpenCollet()

    ; Stop the spindle if it is running
    Spindle(0)
    WaitForAir()

    ; Open the collet
    doRobCellSpindRel = TRUE

    WaitForColletOpen()

END
;ENDFOLD

;FOLD CloseCollet
GLOBAL DEF CloseCollet(WaitForTool : IN)

    DECL BOOL WaitForTool, WaitForToolD

    WaitForToolD = TRUE
    ON_ERROR_PROCEED
    WaitForToolD = WaitForTool

    ; Stop the spindle if it is running
    Spindle(0)
    ;WaitForAir()
    ; Close the collet
    doRobCellSpindRel = FALSE

    IF WaitForToolD THEN
        WaitForColletClosed()
    ENDIF

END
;ENDFOLD


This is not working - so I attempted to frankenstein the code which just threw up more errors.. any one have an ideas?

In my KUKA|PRC I have the custom KRL command ready - I just can't figure out the command I need?

I hope this is somewhat clear.

Johannes @ Robots in Architecture

Hello,

If you are using global functions, don't put them again into the KRL file, but just call them via e.g. OpenCollet() in the KRL component.
You could also put functions into the code pattern in the settings, if you want to change them depending on the project.

Best,
Johannes