CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sun Aug 18, 2019 11:50 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Oct 01, 2015 6:49 am 
Offline

Joined: Fri Jul 10, 2015 10:52 am
Posts: 35
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

Code:
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:
Code:
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


Top
   
PostPosted: Thu Oct 01, 2015 9:50 am 
Offline
Frequent User
Frequent User
User avatar

Joined: Fri Mar 18, 2011 4:12 pm
Posts: 266
Hi, etamgul,

etamgul wrote:
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 wrote:
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 wrote:

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

Code:
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:
Code:
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:
Code:
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 wrote:
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

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited