LBR IIWA R800 : Stop the application

  • Hello,


    I have a simple question, can we kill the running application with a simple Command ( function abort for exemple or something like that ) ?


    Thanks

  • edit: You can also use something like .triggerWhen(...) and program your desired action.
    e.g.:


    ----


    You can pause the application with the .pause() command:

    Code
    getApplicationControl().pause();


    Is this what you are looking for?



    Thank for the reply, but i want to do it in soft, for exemple, stop the application if a condition isn't fulfilled.


  • Thank for the reply, but i want to do it in soft, for exemple, stop the application if a condition isn't fulfilled.


    Can you elaborate on what you want to do? There are a lot of possibilities here. What's the condition you want to check to stop your program? Do you know it in advance? Is it an event? etc.

    Edited once, last by kiiwa ().

  • You can use the following code lines to singal the current application to stop and in your main thread, the InterruptedException shouldn't be caught.
    It isn't a decent way.



    Hello,


    I have a simple question, can we kill the running application with a simple Command ( function abort for exemple or something like that ) ?


    Thanks

  • Thanks for reply


    Here is my function, if the user answer is "Oui", the application is still running, but if the answer is "non", i wan't to quit the application, here i made a boolean Abort that i set on true if the answer is "non", so it kill the application because i put an IF loop with the (!Abort) condition.


    My question is, Can we do that more simply ? ( I know that on ABB robot there is an "Abort" Function who quit the application ).


    int CyManu = getApplicationUI().displayModalDialog(ApplicationDialogType.QUESTION, "Voulez-vous éxécuter le cycle en mode T1 ?", "Oui", "Non");
    switch(CyManu) {
    case 0:
    //oui
    break;
    case 1:
    //non
    abort = true ;
    break;

  • Generally speaking, in any programming language, it is not a good habit to kill a thread(application) abruptly, because you never know what it is doing. If it is operating some critical object or data and is killed in the midst, these critical object will be dirty.
    Actually there are 4 ways to terminate a thread in java
    (1)Normal return
    But sometimes it can't handle complicated scenario.
    (2)Monitoring a flag. If it is time to exit the thread, you set the flag true to break the outer loop, which is the choice you have made.
    Its defect is that you can't terminate a blocked thread in this way.
    (3)interrupt() method of thread
    When a thread's interrupt() method is called, the thread's code branch will throw an InterruptException exception if it was blocked or its method isInterrupted()/interrupted() will return true if it was running.
    (4)stop() method of thread
    It kills thread immediately but not safe, as mentioned. Also it is marked as depreciated.

Advertising from our partners