Robots in Architecture Forum

KUKA|prc - parametric robot control for Grasshopper => Support => Topic started by: singline on August 03, 2016, 02:11:27 PM

Title: Open Close Air
Post by: singline on August 03, 2016, 02:11:27 PM
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.
Title: Re: Open Close Air
Post by: Johannes @ Robots in Architecture on August 03, 2016, 04:36:54 PM
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