Posts by watchcat

    it changes also the movements , it would collide because of that ..



    regarding flags they are in sps:



    $CYCFLAG[5] = SignalToStopRob


    $cycflag[17]= Signal2LoadMagazine


    both are signals from PLC (but it bahaves the same way if I use it as veriables) . PLC don't send the signal and robot stops, then PLS resends the signal, starts the robot and I only check it for sure if the signal is really on .

    Thank you for feedback. I have just check it and declared it in main program at the very begging . It didn't change the behavior.


    I simplified the programs to make it easier to read.


    Main program only declares interrupts and call subprogram


    Subprogram turns on interrupt and moves on the trajectory




    interrupt program didn't changed :



    magazine loading didn't changed



    Still if I make interrupt to halt the robot , it behaves like expected: calls the interrupt program and when start is pressed again it waits for flag and comes back to subprogram, and pointer is exactly at the like when interrupt happen.

    If I make conditions for "halt_robot" during loading of magazine (interrupt with movements) , when start is pressed again, it waits for flag and comes back to magazine trajectory, but pointer goes one more line.

    what do you exactly mean that the program is not working and doesn't have a correct structure? It works, stops, reloads magazine and so on. Generally program runs as it should, station works. I cut some parts to make it more concentrated on the main issue, which are the interrupts.


    I did read the literature several times, have some years of experience with all different brands of robots. Kuka has too many limitations and therefore reacquires some additional "tricks". I am writing here 'cos I want to improve if there is possibility. How would you implement it then? And why the program pointer is "jumping" ?

    if robot does interrupt program :


    Code
    DEF StopAndGoToMagazine( )
    
       INTERRUPT OFF NrInterruptLoadMag
       PTP {A6 -230}
       PTP {A6 -200}    
       PTP {A5 -55}

    and it is on the line PTP {A6 -230} , line 4 ,(I can make override to zero to make sure it will not reach the point, and physically robot is really in position on traj to point a6 -230) then I can make interrupt "halt_robot" to happen, program stops after line with halt, start it again, WAIT FOR (SignalToStopRob) and when it is True, robot comes back to StopAndGoToMagazine but to the line 5. I can do that with override zero and it will "finish" whole program not even moving a bit..

    Hello,

    i have an issue with my programs: if i call an interrupt during execution of another interrupt program, after coming back to first interrupt pointer moves one line. I checked it on KSS V8.3.28 and KSSV8.6.5 and it behaves the same. I have a structure:

    main_program:

    sub_program in loop


    interrupt to call loading trajectory "StopAndGoToMagazine"

    interrupt to stop the robot with PLC HMI stop button "halt_robot"



    Robot runs main_program and then subprogram, at any point an interrupt can open trajectory "StopAndGoToMagazine", meanwhile operator can also press button to stop the robot and interrupt "halt_robot" can be called. When conditions are met and start is send, robot leaves interrupt "halt_robot" but it goes to NEXT line of "StopAndGoToMagazine"


    Subprogram:




    interrupt with movements :





    interrupt to stop robot:


    Code
    global DEF halt_robot()
       INTERRUPT OFF NrInterrruptStopRob
       BRAKE
       HALT
       WAIT FOR (SignalToStopRob)
       WAIT SEC 0.1  
       INTERRUPT ON NrInterrruptStopRob
    end

    and additional definitions:




    Sounds maybe complicated but all is about calling an interrupt during execution of another interrupt. Why coming back from second interrupt to fist one, that was called, makes current line to be change into next one?

    hello, the software is 8.3, alarm was supposed to come from robot itself , so messages generated by the system. I managed to do that so I will share in case anybody else need it.


    So I put in sps such code:


    if messege_check==true THEN
    message_count = Get_MsgBuffer (Message_buffer[])
    FOR n=1 TO message_count
    SWITCH Message_buffer[n].type
    CASE #SYS_QUIT
    if ( Message_buffer[n].NR == 'B0000010001101011') then ; the code for the allarm
    ; do sth here e.g. call a subprogram
    messege_check = FALSE
    endif
    DEFAULT
    ENDSWITCH
    ENDFOR
    endif


    IF ($T1 and not $STOPMESS) THEN
    messege_check = TRUE
    ENDIF




    where variables used are:


    DECL GLOBAL MSGBUF_T Message_buffer[100]
    DECL GLOBAL INT message_count=0
    DECL GLOBAL BOOL messege_check=TRUE



    I hope it will help to diagnose as it did in my case.

    Hello I need to implement a reaction in program on specific alarm on the Kuka in Sps. Is there any possibility? I need to check of alarm number is what I was waiting for, and then start program (no motion prog).


    Sent from my XT1572 using Tapatalk

    hello


    I need to move in ofsets around a point but in tool coordinate system:


    but I cannot figure how to make it not in Base but in tool
    lin {x 0,y -313,z 0,a 0,b 0,c 0}:xP1
    lin P1
    lin {x 0,y -313,z 0,a 0,b 0,c 0}:xP1


    #tool at the end line in lin_rel is not working... (I cannot use lin_rel as I want to approach the point P1)


    Any help, please

    what is the movement that you are making in this line? Check if the physical movement is not just rotation of one axis without any movement in Cartesian XYZ because some strange error can happen. Give more details about the type of motion and points before and after the line..

    finally I have time to sum up things here so that somebody else might use it.
    Different kind of coding numbers (hex, bin dec) was not a problem for me. I was just worried that the robot could send the mark H before it. But it didn't as you have written. It just sent a numbers so that I could decode it partner device.
    As about code - I made a function to change char into proper digit to calculate checksum, but I was sending chars to the open port as a "%s" type: first by SWRITE, and then into the opened serial by CWRITE.


    temp_data2bsent[j]="7"
    int_data2bsent[j]=ASCII2INT(temp_data2bsent[j]) ;for checksum calculation
    (...) ; rest of the data
    SWRITE(Dane_toSent[], CH_State, Offset, "%s", temp_data2bsent[]) ; make a string


    COPEN (:SER_3, Handle) ; open serial port COM3
    CWRITE (Handle, TX_State, Mode, "%s", Dane_toSent[]) ; send TX string
    WAIT SEC 0.1 ;
    CCLOSE (Handle, CH_State);



    What was strange, I had to add a little delay before closing serial port it because the message was not complete without. In documentation there was structure to check the CWRITE status value on #CMD_OK, but I didn't decide to use it. I could make "wait for #CMD_OK" as it might hang the communication and other values were not significant for me as if the partner device don't receive proper message, the whole communication looped anyway.
    Thanks for help! :smiling_face:

    jep later on, I was thinking about it before falling asleep. I will have to do all the ASCII2Intiger converter function and then of course express it in hex.


    It just I have my old backup and then when I added just intiger Kuka showed it like that:


    SWRITE(Send[], State, Offset, "%f %g", $axis_act.a1, $axis_act.a2) ;
    Offset = (( StrLen (Send_Command[])) +1 )
    Send[Offset]=ETX ;
    // output invariable was Send[]="38.627579 -77.7795'H03'"


    And I am not sure if it is sending it with ' and H at the begging? becouse this is what warries me...
    Now I am thinking about something like


    V_ESC = 'H1B'
    V_STX ='H02'
    V_ETX ='H03'
    V_3='H33'
    V_. ='H2C'
    V_6='H36'
    V_2='H32'


    SWRITE(Send[], State, Offset, "%x, %x,%x,%x, %x,%x,%x", V_ESC, V_STX,V_3, V_., V_6,V_ETX ,V_ESC ) ; for "ESC STX 3.6 ETX ESC" ="1B02332C36031B"


    or am I complicating it too much with %x? :] :uglyhammer2:

    hello I am writing sofware for robot communication over RS232 and I want to send messages coded in hex, like sendiing number 33.62 with ESC and STX at the start and EST ETX at the end , should give something like 1B 02 33 33 2C 36 32 1B 03 (without spaces)


    ESC ; Hx 1B
    STX ; Hx 02
    ETX ; Hx 03
    3 ; Hx 33
    . ;Hx 2C
    6 ;Hx 36
    2 ;Hx 32


    I cant try it now on the robot unfortunatelly, but I was thinking about writing something like this:
    decl char val[5]
    val="33.62" ;
    offset=0
    SWRITE(Send[], State, Offset, "%x", val) ;


    or like that
    SWRITE(Send[], State, Offset, "%x, %x, %x,%x,%x", val[0], val[2], val[3], val[4], val[5]) ; (later on parametriazing by loop for i =0 to strlen)


    and then adding ESC and STX and ETX later on.
    Could any of it work?

    Hi, I was ask if it is possible to make default operator (the lowest access user) to have all the point changing disabled.? I tried to found it on KRC Configurator -> Methods but I can't find anything that works like that. Is it possible?
    Another question is if automatic archive can be set? In Fanuc it is easy to set autobackup with certain frequency, but I am not sure if Kuka has the possibility. In Configurator I can see only paths.. Any suggestions?

Advertising from our partners