Struggling to get cell.src to run on external

  • Hi Guys,


    1st time i've intregrated a robot before, this ones a refurb with a krc2 150kg payload
    With the help of this forum i've managed to setup devicenet, setup safety working zone, get all my safety circuits right.
    I've taught all my bases. tcp's, got some coords in that don't tie the bot in a knot, Cell is a bit Cosy.
    Now trying to get it to run in auto ext, using the configuration manual i've got drives on motion enabled ready to go. 2 Green Lights, Waiting for R to light up
    I've been reading, changing, reading, reading searching, and still not running cell.src when i change to auto ext.
    one odd thing that i've seen; i altered a line in custom.dat following reading


    "Automatic system start
    If the I/O interface has been activated by setting the system variable $I_O_ACT to the value
    TRUE, the output $_I_O_ACTCONF is also switched to TRUE as a feedback signal. If all other
    start conditions have been met, the program CELL.SRC can be started by a signal on the
    line $EXT_START.
    The CELL.SRC program can also, of course, be opened at any time from the user interface.
    For automatic system start the following value must be assigned to the system variable
    $PRO_I_O in the file “C:\KRC\Roboter\KRC\Steu\MaDa\$CUSTOM.DAT” :
    CHAR $PRO_I_O[]=”/R1/SPS()”
    After the controller has run up, it always tries to execute the program designated in
    $PRO_I_O. "



    The line in the program is the same as this,
    But the line above from memory is
    "$PRO_I_O[64]”


    I edited it to
    "$PRO_I_O[]” this edit doesn't seem to stick though as when i reenter the custom.dat its back to the original value "$PRO_I_O[64]”


    I've read alot but i think i'm missing 1 thing.



    Just one last thing..... I can't believe grippertech is not standard/free? i've used the plc to do the logic which is proberbly a better way but jees for such a simple piece of software. i would understand if it was there but just required installation/activation :wallbash:




    Cheers for listening i feel like its a AA meeting :sleeping_face:

  • Actually your $CUSTOM.DAT should have 2 lines that look like:

    Code
    CHAR $PRO_I_O[64] ;EXTERNES PROGRAMM FUER STEUERUNGSKNOTEN
    $PRO_I_O[]="/R1/SPS()"


    Do not change these. They are what start the SPS.SUB (Submit Interpreter) at startup.


    If you would like to also start a regular program you will do that in the SPS.SUB.


    There is already code in the SPS.SUB to select (ready for $EXT_START) the CELL() program if the system starts in Automatic External:

    Code
    IF $MODE_OP==#EX THEN
      CWRITE($CMD,STAT,MODE,"RUN /R1/CELL()")
    ENDIF


    If you would like to select a different program, replace CELL with the name of your program.


    If you would like to automatically select a program at times other than at start-up when in Automatic External you should search the KUKA forums for $CMD or CWRITE.

  • Cheers mean robot your right about having the 2 lines in config.dat,


    i will look again at the sbs in the morning,


    but today i still couldn't get the kuka to start the cell.src
    i got round this by selecting the cell.src before going to auto-ext,


    a day of reasonable success as once running, the plc called a program then triggered move from outputs.


    now got to work out home positions as i've set 1 in machine.dat which is setting an output, but the cell.src wants to drive to home now my xhome1.


    more reading.

  • The code you mentioned in the sbs mean robot was not in there. put that if there is any stop or the safety drops out it resets back to cell.src
    as long as i select the cell.src before going to auto ext (without the code in the sbs) it works fine but i could do with it selecting cell.src if no other program is selected.


    however this may be pointless i think as these issues are more apparent in commisioning as program changes are being made etc.


    It is working well now though but will need to make it to jump to another line one another sub routine from an if statement


    would something like this work


    lin
    ptp
    if $in(100) then
    jump to=continue1
    else
    lin
    ptp
    ptp
    ptp home


    nextsub ( )
    ptphome
    ptp
    ptp
    lin
    continue1
    ptp
    lin



    etc

  • GOTO commands should generally be avoided, as they quickly lead to spaghetti code and attacks by velociraptors.


    I would suggest something like this:

  • Hi all,


    I'm a newbie at kuka programming. I have somewhat a simular problem, I have a cell with a floor scanner to stop the robot if someone walks in its range.
    The robot is controlled by a plc, external start is configured (I did't build the cell).
    My problem is when someone walks in the range of the floor scanner and resets the fault and gives an external start the robot does not start back in cell.src but just continues
    it's last program active from the last line active.
    I dont want that because there is an auto homing program in cell. In the $custom.dat I have the lines :
    CHAR $PRO_I_O[64] ;EXTERNES PROGRAMM FUER STEUERUNGSKNOTEN
    $PRO_I_O[]="/R1/SPS()"


    Is it the robot or the plc that prevents cell.src from starting?


    Thanx

  • If the safety stops the program try:-


    Deselecting the program

    Code
    CWRITE($CMD,STAT,MODE,“CANCEL /R1/your_selected_program()”)


    Starting the cell program

    Code
    CWRITE($CMD,STAT,MODE,"RUN /R1/CELL()")


    The place to put this would be the SPS.SUB, but how you call the commands would depend on your system.


    If you need to stop the running program first

    Code
    CWRITE($CMD,STAT,MODE,”STOP /R1/your_selected_program()”)
  • yes that seems to be the problem, the current program is not cancelled/stopped. But if in the sps the program cell is selected with external start,
    how can it be that it doesn't select cell but continues the current active program?

  • Hi.
    I can write You about VKRC conditions to start robot from PLC. You are using KRC version so I think there are some diffs between those systems.
    Marek

  • manual for system integrators shows what the signals are and handshaking sequence.


    basically you need to configure CELL.SRC so each program that is to be called by PLC, has own number. CELL.SRC is already created for you, you just need to adapt it.


    next thing is configuring I/O for autoexternal... there are quite few signals but only handful are essential.


    robot inputs are:

    PGNO_TYPE - format used to interpret program number (1=binary, 2=BCD, 3="1 of N")
    PGNO_LENGTH - number of bits used to represent program number (1-16, if using BCD it must be multiple of 4)
    PGNO_FBIT - first bit (LSB) in group of inputs that receive program number
    PGNO_PARITY - specifies input number used for program number parity check (0= no check, positive number= even parity, odd number = odd parity)
    PGNO_VALID - robot input telling when program number should be read
    $EXT_START - input controlled by PLC to start robot program, if EXT mode is not used, map it to input 1026 (always false)
    $MOVE_ENABLE - robot input allowing robot to perform motions. PLC can use it to stop robot when needed.
    $CONF_MESS - input controlled by PLC to acknowledge messages
    $DRIVES_OFF - inverted signal used to turn off drives (normally held true, drives go off when this is low). this signal may remain permanently mapped to input 1025 (always true)
    $DRIVES_ON - pulse on this input powers up robot drives (if $DRIVES_OFF is true)
    etc.


    outputs from robot (inputs to PLC) are:
    $RCY_RDY1 - controller ready (compound signal)
    $ALARM_STOP - if true tells that all estops wired to robot are ok (circuit closed)
    $ALARM_STOP_INTERN - same as previous but only reports internal E-STOP (pendant), does not includes circuits at X11
    $USER_SAF - if true tells that gates are closed (operator safety)
    $PERY_RDY - tells when robot drives are on (green "I" in "SIR")
    $ROB_CAL - tells to PLC if robot is mastered
    $STOPMESS - tells to PLC that robot has message that needs acknowledgement
    $PRO_ACT - main program active (CELL.SRC)
    APPL_RUN - user application running (program selected by PLC, subprogram to CELL.SRC)
    PGNO_REQ - robot is ready to run application (just waiting for program number)
    etc.


    handshaking sequence is (PLC end):
    set move enable
    power up drives
    ack. messages
    present program number (and compute correct parity if it is used)
    when robot requests program number, hand it over (by turning on PGNO_VALID)


    start of operation on robot end is:
    switch to T1
    select CELL.SRC
    perform BCO
    switch mode to EXT

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • For Russiya


    Входы Управление программой Номер программы (адрес первого бита) PGNO_FBIT $IN[33] 33
    Входы Управление программой Бит контроля четности PGNO_PARITY $IN[41] 41
    Входы Управление программой № программы действителен PGNO_VALID $IN[42] 42
    Входы Управление программой Приводы включены $DRIVES_ON $IN[140] 140
    Входы Управление программой Деблокировка перемещения $MOVE_ENABLE $IN[1025] 1025
    Входы Управление программой Запустить интерфейс $I_O_ACT $IN[1025] 1025
    Входы Управление программой Привод выключен (инверсия) $DRIVES_OFF $IN[1025] 1025
    Входы Управление программой Запуск программы $EXT_START $IN[1026] 1026
    Входы Управление программой Подтверждение ошибки $CONF_MESS $IN[1026] 1026
    Выходы Состояние программы № программы запрос PGNO_REQ $OUT[33] 33
    Выходы Состояние программы Приложение выполняется APPL_RUN $OUT[34] 34
    Выходы Условия запуска Система управления готова $RC_RDY1 $OUT[137] 137
    Выходы Условия запуска Интерфейс активен $I_O_ACTCONF $OUT[140] 140
    Выходы Позиция робота Робот вблизи траектории $NEAR_POSRET $OUT[147] 147
    Выходы Режим работы Режим Test1 $T1 $OUT[993] 993
    Выходы Режим работы Режим Test2 $T2 $OUT[994] 994
    Выходы Режим работы Автоматический режим работы $AUT $OUT[995] 995
    Выходы Режим работы Режим работы внешней автоматики $EXT $OUT[996] 996
    Выходы Позиция робота Робот на траектории $ON_PATH $OUT[997] 997
    Выходы Условия запуска Первый бит для создания отражения программы PGNO_FBIT_REFL $OUT[999] 999
    Выходы Позиция робота В позиции Home $IN_HOME $OUT[1000] 1000
    Выходы Условия запуска Робот юстирован $PROB_CAL $OUT[1001] 1001
    Выходы Условия запуска Внутренний аварийный останов $ALARM_STOP_I $OUT[1002] 1002
    Выходы Условия запуска Общая ошибка $STOPMESS $OUT[1010] 1010
    Выходы Условия запуска Переключатель защиты оператора $USER_SAF $OUT[1011 1011
    Выходы Условия запуска Приводы готовы $PERI_RDY $OUT[1012 1012
    Выходы Условия запуска Контур аварийного отключения замкнут $ALARM_STOP $OUT[1013 1013
    Выходы Состояние программы Программа активна $PRO_ACT $OUT[1021] 1021
    Выходы Состояние программы Программное перемещение запущено $PRO_MOVE $OUT[1022] 1022
    Выходы Позиция робота Робот не перемещается $ROB_STOPPED $OUT[1023] 1023
    Выходы Позиция робота В позиции Home 1 $IN_HOME1
    Выходы Позиция робота В позиции Home 2 $IN_HOME2
    Выходы Позиция робота В позиции Home 3 $IN_HOME3
    Выходы Позиция робота В позиции Home 4 $IN_HOME4
    Выходы Позиция робота В позиции Home 5 $IN_HOME5
    Переменные Управления программой Тип программы PGNO_TYPE
    Переменные Управления программой отражение номера программы REFLECT_PROG_NR
    Переменные Управления программой Разрядность номера программы PGNO_LENGTH
    тип аннотация назначение имя адрес




Advertising from our partners