Author Topic: Open Close Air  (Read 3813 times)

singline

  • Robots in Architecture Members
  • Forum User
  • *
  • Posts: 77
    • View Profile
Open Close Air
« 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.

Code: [Select]
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

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1341
    • View Profile
    • Robots in Architecture
Re: Open Close Air
« Reply #1 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