Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

onlineapp login & reset_origin

etamgul
2015-10-01
2015-10-01
  • etamgul - 2015-10-01

    Recently I had connection issues as some of them are resulted by a previous aborted flash (application load).
    For some reason around 1/20 of the cases the upload during login results a bad flash sector,
    causing an exception at device side and it locks out the comm-cycle.

    As a workaround I tried to erase the previous application (it might help) using the reset_origin()
    but it didnt do anything.

    1) is this function/method working properly?

    Reading the API reference I stumbled into this piece of description:
    OnlineChangeOption Enumeration

    Never 0 Online change shall never be performed. In that case a full download is forced.Β  
    TryΒ  Β  Β 1 Online change shall be tried. If not possible, a full download shall be performed.Β  
    ForceΒ  2 Online change shall be forced. If not possible, the action is terminated with no change. 
    

    While login has the following interface:

    void login( OnlineChangeOption change_option, bool delete_foreign_apps )
    

    2) what does onlinechange mean in this context? How is it possible to never perform online change while reflashing the application?
    example:
    change_option = Never
    for me it means do not change anything, but according to the description actually it forced an application reflash.
    3) what it that delete_foreign_apps for when I have the 'Never' option?

    Thanks

     
  • Anonymous - 2015-10-01

    Originally created by: M.Schaber

    Hi, etamgul,

    etamgul hat geschrieben:
    Recently I had connection issues as some of them are resulted by a previous aborted flash (application load).
    For some reason around 1/20 of the cases the upload during login results a bad flash sector,
    causing an exception at device side and it locks out the comm-cycle.

    This looks like a serious problem on the hardware or runtime side. I think you should contact your vendor, to diagnose and solve the problem.

    etamgul hat geschrieben:
    As a workaround I tried to erase the previous application (it might help) using the reset_origin()
    but it didnt do anything.
    1) is this function/method working properly?

    This funciton should to the same as the "reset origin" Command available in for the user in the CODESYS menus.

    If the user command works, but the script command does not work, please file a bug report via support department.

    On the other hand, when the user command also does not work, the problem is probably on the runtime side (maybe due to the corrupted flash).

    etamgul hat geschrieben:
    Reading the API reference I stumbled into this piece of description:
    OnlineChangeOption Enumeration

    Never 0 Online change shall never be performed. In that case a full download is forced.Β  
    TryΒ  Β  Β 1 Online change shall be tried. If not possible, a full download shall be performed.Β  
    ForceΒ  2 Online change shall be forced. If not possible, the action is terminated with no change.
    

    While login has the following interface:

    void login( OnlineChangeOption change_option, bool delete_foreign_apps )
    

    2) what does onlinechange mean in this context? How is it possible to never perform online change while reflashing the application?

    That's explained in the docu you cited yourself above:

    Never 0 Online change shall never be performed. [b]In that case a full download is forced. [/b] 
    

    To restate it: If OnlineChangeOption.Never is used, a full download of the application is performed, instead of attempting an online change.

    An online change means that only the differences to the currently running application are downloaded to the PLC, and the changes are applied while the application keeps running. In contrast, a full download stops the running application, removes it, and installs the new application in "stopped" state.

    Whether an online change is possible depends on some preconditions - for example, the compiler needs the reference context of the code which is currently running on the PLC, and the changes must be "normal" code changes - operations like a "Clean", or change of compiler version, or similar operations prevent online changes.

    If the compiler can assert that the code is exactly the same, a simple login is performed. If there are code changes, the compiler will calculate the changeset (which may include some copying and relocation of memory, e. g. if the size of a struct or FB did change), which will then be sent to the PLC and applied on the fly to the running application during the login.

    etamgul hat geschrieben:
    3) what it that delete_foreign_apps for when I have the 'Never' option?

    The "Never" option will just always perform a full download and not even attempt an online change, so why should it not be possible to delete the foreign applications?

    HTH,
    Markus

     

Log in to post a comment.