ScriptApplication¶
- class ScriptApplication.ScriptApplicationMarker¶
Bases:
objectMarker object to check whether a ScriptObject is an application object.
- Version added:
3.5.2.0
- property is_application¶
Gets a value indicating whether this
ScriptApplicationMarkeris an application.- Return type:
bool
- Returns:
Trueif it is an application; otherwise,False.
- class ScriptApplication.ScriptApplication¶
Bases:
ScriptApplicationMarkerScriptObjects which are an application object are extended with this interface.
- Version added:
3.5.2.0
- property is_active_application¶
Gets a value indicating whether this.
ScriptApplicationis the active application.The active application is always in the primary project, so this property will always return false for non-primary projects.
- Return type:
bool
- Returns:
Trueif it is the active application; otherwise,False.
- build()¶
Builds the application.
You can use the
System.get_messages()andSystem.get_message_objects()calls to check whether any messages were added. This method only works for applications in the primary project.
- clean()¶
Cleans the application.
You can use the
System.get_messages()andSystem.get_message_objects()calls to check whether any messages were added. This method only works for applications in the primary project.
- generate_code()¶
Generates the code for the application.
You can use the
System.get_messages()andSystem.get_message_objects()calls to check whether any messages were added. This method only works for applications in the primary project.
- rebuild()¶
Rebuilds the application.
You can use the
System.get_messages()andSystem.get_message_objects()calls to check whether any messages were added. This method only works for applications in the primary project.
- create_boot_application(output_filename, update_compile_info=False, write_visu_files=False)¶
Creates the offline boot project at the specified outputpath.
If the project was changed since the last download or online change to a PLC, and you create a boot application with
update_compile_infoset totrue, this will overwrite the current compiler reference context with the one matching the boot project (which no longer matches the one on the PLC). Thus, a direct conline change to the PLC will no longer work. On the other hand, the reference context now matches the created boot application, so you can login to any PLC on which you deploy the generated boot application. This updated compile context is also the one to be included into a project archive.Relative output filenames are interpreted relative to the location of the project. If you pass None or the empty string, applicationname.app is used. This method only works for applications in the primary project.
- Version added:
3.5.5.0, available for 3.5.3.x from Patch 1
- Parameters:
output_filename (str) – The filename to write the boot application to.
update_compile_file (bool) – if set to
true, also writes the compile information (compiler reference context) to the project directory. (This may break online change, see below). (The compile information is updated in the directory where the project resides, not the output directory.)write_visu_files (bool) – if set to
true, also writes the visualization files into the output directory. It will be silently ignored when this application does not contain a visualization manager.
- create_task_configuration()¶
Add the task configuration object to an application.
- Version added:
3.5.10.0
- Return type:
- Returns:
Script object of the task configuration object
- property is_uptodate¶
Gets a value indicating whether this application is the same running on the PLC.
- Version added:
3.5.10.0
- Return type:
bool
- Returns:
Trueif it is the same; otherwise,False.
- property is_online_change_possible¶
Gets a value indicating whether an online change is possible or not.
- Version added:
3.5.10.0
- Return type:
bool
- Returns:
Trueif online change is possible; otherwise,False.