RobotStudio event

Is there a method to pass the "save" instruction when we have a error ?

Hi all,


I need to do regularly automatic save of some modules on IRC5. I think to use the "save" instruction for that, like this :
SAVE "PRG_MVT" \FilePath:="pc:/PRG_MVT.MOD";
The PLC call a service cycle where this "save" instruction is.
The "pc:/" is an external computer where a FTP server is running.
All It's work properly. But, if the FTP server is unavailable, the program stop and I can't use the Error handling method to inform the PLC.

My question :
Is there a method to pass the "save" instruction when we have a error ?
Which would allow me to do some action in function of the ERRNO content.

I would wish not to use the interrupt system with "CONNECT" instruction for this case. Just don't have a program stopped on a "SAVE" error.

thanks alot for your help

Best Answers

  • soup
    soup ✭✭✭
    Answer ✓
    Few thoughts:
    1. If the FTP is a little unreliable, save to the local flash or HOME then, then use a background task to save to the FTP so production doesn't stop...
    2. Not sure what you're saving for, but figure it's worth mentioning the UnLoad with the \Save option for auto saving when unloading modules...
    3. RETRY re-executes the instruction which caused the error and TRYNEXT would skip the save and keep going...
  • DenisFR
    DenisFR ✭✭✭
    Answer ✓
    Olivier,
    In your example, you miss the ERROR line, to start error handler.
    &nbsp; PROC T_Serv3()<br>&nbsp;&nbsp;&nbsp; ErrWrite \W, "AUTO-SAVE", "sauvegarde automatique de PRG_MVT";<br>&nbsp;&nbsp;&nbsp; Save "PRG_MVT" \FilePath:="pc:/PRG_MVT.MOD";<br><i>  </i><b><i>ERROR</i></b><br>&nbsp;&nbsp;&nbsp; TEST ERRNO<br>&nbsp;&nbsp;&nbsp; CASE ERR_IOERROR:<br>&nbsp;&nbsp;&nbsp; ErrWrite "SAUVEGARDE IMPOSSIBLE", "le dossier de sauvegarde automatique est inaccessible";<br>&nbsp;&nbsp;&nbsp; ENDTEST<br>&nbsp; ENDPROC

Answers

  • DenisFR
    DenisFR ✭✭✭
    Hello,

    It doesn't trig this error?

    ERR_IOERROR

    The save file cannot be opened because of denied permission, no such directory, or no space left on device.


  • soup
    soup ✭✭✭
    edited July 2018
    ...and I can't use the Error handling method to inform the PLC.
    Can't or don't want to?

    Example:

    PROC Test_ErrorToPLC()
       Save "PART_B"; ! will trigger an error for the test
       ERROR
            SetGO goPLC_ErrorSend,ERRNO; ! send error number to the plc, then the plc does whatever, stops the robot, displays error on hmi, etc., etc.
            WaitUntil giPLC_ErrorReceived=ERRNO\MaxTime:=10\TimeFlag:=timeout; ! plc sends back the error number to signal that it's received
            IF timeout ErrWrite "PLC Communication Error", "Robot controller failed to", \RL2:="communicate with the PLC.", \RL3:="Please contact support."; ! plc failed to respond
            SetGO goReadyForOffsets,0; ! clear the error output
            WaitTime 2; ! slight delay before a retry
            RETRY;
    ENDPROC

  • Thanks for your answer Denis.

    In my first message, I haven't speak about many try I have already do.
    One of this is :

      PROC T_Serv3()
        ErrWrite \W, "AUTO-SAVE", "sauvegarde automatique de PRG_MVT";
        Save "PRG_MVT" \FilePath:="pc:/PRG_MVT.MOD";
        TEST ERRNO
        CASE ERR_IOERROR:
        ErrWrite "SAUVEGARDE IMPOSSIBLE", "le dossier de sauvegarde automatique est inaccessible";
        ENDTEST
      ENDPROC

    In this case, I hoped do a error handler after the "save" instruction but the robot program stop on the "save" instruction if the path of file is wrong.


    ----------

    Hi soup,

    Thanks for your answer.

    The problem is that if the path is wrong (for example FTP server down) the robot program stop on the "save" instruction and the production stop too.
    Inform the PLC is useful but it's not yet my first problem.
    I search a method to pass the "save instruction" in case of error. Or a method to restart the program just after the "save" instruction in case of error.

  • thanks for your quick answer soupe.
    My goal is to follow all robots program changes by comparing the robot program each day with the program of day before. In my factory, everybody can change à move path in program without inform anybody.
    The idea is to put each day some module on computer where a dos/batch script will automatically compare module of day to detect a change and inform my service.
    This is all the story :)

    Now, I will try your option "TRYNEXT" and I come back to you.

  • soup
    soup ✭✭✭
    I like the idea. Could have the PLC signal for a robot controller backup each night -- keep watch on all the system files too and always have a recent backup if you need to restore.
  • &nbsp; PROC T_Serv3()<br>&nbsp;&nbsp;&nbsp; ErrWrite \W, "AUTO-SAVE", "sauvegarde automatique de PRG_MVT";<br>&nbsp;&nbsp;&nbsp; Save "PRG_MVT" \FilePath:="pc:/toto/PRG_MVT.MOD";<br>&nbsp;&nbsp; ERROR<br>&nbsp;&nbsp;&nbsp; TRYNEXT;<br>&nbsp; ENDPROC

    TRYNET was the instruction that I was looking for. Thanks soup.

    I have just test this code and it's ok !

    .

    .

    DenisFR said:
    Olivier,
    In your example, you miss the ERROR line, to start error Handler.

    That's right Denis. That is the reason why my robot program stop on an error without test the ERRNO value.
    I'm very new in ABB programming and I had not understood the error handler system.

    But now it's ok !
    Thanks alot for your help

    .

    .

    soup said:
    I like the idea. Could have the PLC signal for a robot controller backup each night -- keep watch on all the system files too and always have a recent backup if you need to restore.

    Yes soup. It's the best way. But at this moment, we have few robot with a RobotWare 6.05 and we have a lot of RobotWare 5.09 who haven't the "backup" in "action" of input.

    That why I must use the SAVE / ERROR / TRYNEXT solution. 
    And I was looking for a solution for S4C too. And I think I can use the same solution on these S4C.

  • soup
    soup ✭✭✭
    Not sure about S4C, but could also grab backups semi-automatically with a Jobs script in RobotStudio 6.
  • Ok soup.
    I will try this on a S4C as soon I have a S4C free of production.
    I'll come back here to inform you about the result of my try.