class
ScriptApplicationComposer.
ScriptModuleRepository
Bases: object
An instance of an object implementing this interface is injected into the scriptengine scope under the name "modulerepository".
get_toplevel_instances
Gets all Toplevel-Module-Instances of the primary project.
list
Returns all Toplevel-Module-Instances of the primary project.
get_all_instances
Gets all Module-Instances of the primary project.
list
Returns all Module-Instances of the primary project.
get_toplevel_modules
Gets all Toplevel-Modules available in the primary project.
list
Returns all Toplevel-Modules available in the primary project.
get_all_modules
Gets all Modules available in the primary project.
list
Returns all Modules available in the primary project.
find_module
stQualifiedName
Finds the module with its declaration at the given qualified path (namespace.modulename).
stQualifiedName (str) -- The qualified path of the module description.
The module defined by the module description at the qualified path.
get_compatible_modules
slot
Gets all modules which are compatible to a specified slot.
slot (ScriptModuleSlot) -- The slot for which comaptible modules shall be searched.
list
Returns a list of all compatible modules as ScriptModule-Objects.
add_toplevel_instance
stInstanceName
scriptMd
Adds a toplevel instance to the module tree.
stInstanceName (str) -- The desired name for the toplevel instance.
scriptMd (ScriptModule) -- The ScriptModule-Object describing the desired module type.
Returns the added toplevel instance ScriptObject-Object or None if the operation failed.
add_submodule_instance
stInstanceName
scriptMd
scriptSlot
index
Adds a submodule instance to the module tree under the specified slot.
The slot has to have an ownership of type submodule, otherwise the operation will return None.
stInstanceName (str) -- The desired name of the submodule instance.
scriptMd (ScriptModule) -- The ScriptModule-Object describing the desired module type.
scriptSlot (ScriptModuleSlotInstance) -- The ScriptModuleSlot-Object under which the new submodule instance shall be created.
index (int) -- The index defining the position of the created submodule instance under the slot.
Returns the added submodule instance as ScriptObject-Object or None if the operation failed.
add_reference_instance
scriptObj
scriptSlot
index
Adds a reference instance to the module tree under the specified slot.
The slot has to have an ownership of type reference, otherwise the operation will return None.
scriptObj (ScriptObject) -- The ScriptObject-Object of the module instance which shall be reference by the created reference instance.
scriptSlot (ScriptModuleSlotInstance) -- The ScriptModuleSlot-Object under which the new reference instance shall be created.
index (int) -- The index defining the position of the created reference instance under the slot. Not relevant if scriptSlot is a Single-slot.
Returns the added reference instance as ScriptObject-Object or None if the operation failed.
set_generator
stGenGuid
bEnable
Enables generators in the generator settings.
stGenGuid (str) -- The string representation of Guid of the generator, which shall be enabled.
bEnable (bool) -- Whether the generator shall be enabled or not.
bool
Returns True if enabling succeeded.
load_wildcard_setting
stFileName
Loads a specific XML file into the wildcard options dialog.
stFileName (str) -- The file to be loaded into the wildcard dialogs settings. If None the current filename or last used filename is used.
bool
Returns True if loading succeeded.
create_module_declaration_object
stDeclObjectName
stDeclObjectText
Adds a module declaration object to the POU-Pool.
stDeclObjectName (str) -- The name of the module declaration object.
stDeclObjectText (str) -- The declaration text in the module declaration object. This text can be changed using the module declaration object afterwards.
Returns the module declaration object as ScriptObject-Object or None if the operation failed.
generate
Generate an IEC-Application from configured module instance tree.
bool
Returns True in case of success.
scan_all_modules
Scans all available module declarations.
bool
Returns True in case of no error.
generate_and_login
Generates the IEC-Application from the module tree.
It then uploads this application and logs on.
bool
update_all_module_instances
Update all module instances to the current version of the module descriptions.
class
ScriptApplicationComposer.
ScriptApplicationComposerObjectMarker
Bases: object
Every ScriptObject instance will be extended using this interface.
is_module_instance_object
Gets a bool indicating whether this ScriptObject is a ModuleInstanceObject object.
bool
is_module_reference_object
Gets a bool indicating whether this ScriptObject is a ModuleReference object.
bool
is_module_declaration_object
Gets a bool indicating whether this ScriptObject is a ModuleDeclObject object.
bool
class
ScriptApplicationComposer.
ScriptModuleInstanceObject
Bases: ScriptApplicationComposer.ScriptApplicationComposerObjectMarker
Functionality for manipulating ModuleInstanceObject-Objects.
All Objects implementing ModuleInstanceObject will be extended with this methods.
name
Gets the Instance-Name of the ModuleInstanceObject-Object.
str
module
Gets the Module this instance is type of.
parameters
Gets the Parameters of the Instance (see ScriptModule).
list
ios
Gets the IOs of the Instance (see ScriptModule).
list
slots
Gets the Slots of the Instance (see ScriptModule).
list
inst_refs
Gets the InstanceReferences of the Instance (see ScriptModule).
list
toplevel_info
Gets the ToplevelInfo of the Instance (see ScriptModule).
Returns None if the instance is not toplevel.
parent_instance
Gets the parent module instance or None if this instance is toplevel.
parent_slot
Gets the slot this module instance is connected to or None if this instance is toplevel.
is_submodule
Whether this module instance is a submodule or not.
bool
class
ScriptApplicationComposer.
ScriptModuleReferenceObject
Bases: ScriptApplicationComposer.ScriptApplicationComposerObjectMarker
Functionality for manipulating ModuleReferenceObjects.
All Objects implementing ModuleReferenceObject will be extended with this methods.
target
Returns the referenced module instance object or None if the referenced instance does not exit.
target_path
Returns the (relative) instance path of the referenced object.
The components of the path are separated by "/" characters, the parent path is denoted by the special string "..".
str
class
ScriptApplicationComposer.
ScriptModule
Bases: object
Interface providing necessary information and functionalities dealing with Modules in Python.
Equalling the type Module in the application composer interface collection.
name
Gets the name of the Module.
str
qualified_name
Gets the fully qualified Name (namespace.modulename) of the Module.
str
parameters
Gets all Module-Parameters.
list
ios
Gets all Module-IOs.
list
slots
Gets all Module-Slots.
list
inst_refs
Gets all Module-InstanceReferences.
list
var_arrays
Gets all Module-VarArrays.
list
toplevel_info
Gets the Module-ToplevelInfo.
Returns None if module is not toplevel.
meta_data
proxies
Gets all Module-Proxies.
list
iec_declaration
Gets the declaration of the corresponding Module-IEC-FB.
is_param_page_disabled
Whether the Editors Parameters-Page is dissabled or not.
bool
is_toplevel_page_disabled
Whether the Editors Toplevel-Page is dissabled or not.
bool
device_generator_data
Returns the data provided for the device generator.
alarm_generator_data
Returns the data provided for the alarm generator.
class
ScriptApplicationComposer.
ScriptModuleParameter
Bases: object
Interface providing necessary information and functionalities for dealing with Module-Parameters in Python.
name
Localized (multi-lingual) name of the Parameter.
str
description
Localized (multi-lingual) description of the Parameter.
str
id
Id of the Parameter. The Id is unique among all Parameters of one module.
str
get_value
The current value of the Parameter.
If no value is set, default or initial values that are actually used are returned. If this parameter does not belong to a Module instance an empty string is returned.
str
type
The IEC-Type of the Parameter.
str
var_path
Gets the instance path of the Parameters variable relative to the instance FB of the module.
str
minimum
Gets the minimum value, that is defined for the parameter.
str
maximum
Gets the maximum value, that is defined for the parameter.
str
group_id
The GroupID of the parameter or an empty string if the parameter does not belong to a group.
3.5.13.0
str
group_name
The localized GroupName of the parameter or an empty string if the parameter does not belong to a group.
3.5.13.0
str
class
ScriptApplicationComposer.
ScriptModuleParameterInstance
Bases: ScriptApplicationComposer.ScriptModuleParameter
Interface providing necessary information and functionalities for dealing with Module-Parameter-Instances in Python.
set_value
value
Sets the current value of the Parameter.
By setting a parameter its standard initial or default values are no longer used.
value (str) -- The value to set for the Parameter.
get_initial_value
Gets the initial value of the parameter as string. Never returns None.
3.5.13.0
str
class
ScriptApplicationComposer.
ScriptModuleIo
Bases: object
Interface providing necessary information and functionallities for dealing with Module-IOs in Python.
name
Localized (multi-lingual) name of the IO.
str
description
Localized (multi-lingual) description of the IO.
str
id
Id of the IO. The Id is unique among all IOs of one module.
str
is_output
Returns whether the IO is output or not.
bool
is_input
Returns whether the IO is input or not.
bool
get_display_name
The current representation of the current IO-Channels mapping meant for display.
If not mapped, a value indicating "missing" is returned. If this IO does not belong to an instance an empty string is returned.
str
type
The IEC-Type of the IO-Channel.
str
var_path
Gets the instance path of the IO-Channels variable relative to the instance FB of the module.
str
class
ScriptApplicationComposer.
ScriptModuleIoInstance
Bases: ScriptApplicationComposer.ScriptModuleIo
Interface providing necessary information and functionallities for dealing with Module-IO-Instances in Python.
set_void_mapping
Sets a void mapping, which equals an IO-Channel with no connection.
set_missing_mapping
Sets a missing mapping.
This indicates that this io channel has no connections (as for void), but remembers the user to set a mapping whenever code is generated by the application composer.
set_direct_mapping
other
Sets a direct mapping to another IOChannel.
other (ScriptModuleIoInstance) -- The IO-Channel this channel shall be connected to. Note that Inputs only can be connected to Outputs and vice versa.
set_io_channel_mapping
channel
Sets a channel mapping, which connects this IO to a physical IO-Channel.
A possible example for a valid string used for this type of mapping is "param::Device.EtherCAT_Master.EL9800:1:2000007:dwIn1".
channel (str) -- String specifying the desired physical IO-Channel in the form "param::Device.VisibleParameterPath".
set_expression_mapping
expression
Sets a channel mapping to an ST-Expression.
expression (str) -- String holding the ST-Expression.
class
ScriptApplicationComposer.
ScriptModuleSlot
Bases: object
Interface providing necessary information and functionallities for dealing with Module-Slots in Python.
role
Localized (multi-lingual) description of the slot role.
str
id
Id of the Slot. The Id is unique among all Slots of a module.
str
is_submodule_slot
Returns whether the Slot is meant to hold submodules or not.
bool
is_reference_slot
Returns whether the Slot is meant to hold references to modules or not.
bool
is_single
Returns whether the Slot is a Single-Slot, which only can hold one instance, or not.
bool
is_multi
Returns whether the Slot is a Multi-Slot, which can hold multiple instances, or not.
bool
max_connections
Gets the number of the maximum of submodules or references, that can be connected to this Slot.
int
min_connections
Gets the number of the minimum of submodules or references, that have to be connected to this Slot.
int
default_inst_name
Gets the default name for module instances, which are connected to this Slot.
If no default name is defined an empty string is returned.
str
type
Gets the interface type of this Slot.
Slot is corresponding to the interface, that FBs have to implement, when they shall be connectable to this slot.
str
var_path
The IEC instance path of the slot variable relative to the FB instance of the module.
str
var_array_size_path
Returns instance path.
For Multi-Slots the instance path of the variable, which holds the number of connected submodules or references, relative to the FB instance of the module. For Single-Slots an empty string is returned.
string
inst_prefix
Gets the optional prefix, that is prepended to the name of the FB instance variables of submodules.
This string can either have a value or is empty, what indicates a prefix, or that no prefix is wished. When this string is None no prefix wishes at all are given.
str
pragmas
Returns the compiler-pragmas, that are to be inserted before instances of submodule function blocks.
list
class
ScriptApplicationComposer.
ScriptModuleSlotInstance
Bases: ScriptApplicationComposer.ScriptModuleSlot
Interface providing necessary information and functionalities for dealing with Module-Slot-Instances in Python.
connected_sub_modules
Returns a List of connected ModuleInstanceObject-Objects to this Slot.
When there are no submodules connected an empty list is returned.
list
connected_ref_modules
Returns a List of connected ModuleReferenceObject-Objects to this Slot.
When there are no references connected an empty list is returned.
list
class
ScriptApplicationComposer.
ScriptModuleInstRef
Bases: object
Interface providing necessary information and functionalities for dealing with Module-InstanceReferences in Python.
description
Localized (multi-lingual) description of the InstanceReference role.
str
is_single
Returns whether the InstanceReference can only hold a single instance or not.
bool
is_multi
Returns whether the InstanceReference can hold multiple instances or not.
bool
max_connections
Maximum number of connectable instances.
int
min_connections
Minimal number of connectable instances.
int
type
Gets the interface type of the InstanceReference.
Only FB instances which implement this interface can be connected to this InstanceReference.
str
is_interface_type
Returns whether the reference type is an interface.
bool
array_size_var_path
Returns instance path.
Only defined if the InstanceReference is able to hold multiple instances (see "is_multi"). The IEC instance path of the variable, which holds the number of connected instances, relative to the FB instance. of the module.
str
get_connected_instances
Return a list of connected instances.
If there are no instances connected an empty list is returned.
list
class
ScriptApplicationComposer.
ScriptModuleInstRefInstance
Bases: ScriptApplicationComposer.ScriptModuleInstRef
Interface providing necessary information and functionalities for dealing with Module-InstanceReference-Instances in Python.
set_connected_instances
listInstances
Replaces the current list of instances of the InstanceReference instance by the given list of strings describing FB instances.
listInstances (list) -- List of strings describing the new FB instances to be connected to this InstanceReference. If this is None or an empty list all InstanceReferences are removed.
class
ScriptApplicationComposer.
ScriptModuleVarArray
Bases: object
Interface providing information and functionalities for dealing with Module-VarArrays.
id
Id of the VarArray. The Id is unique among the VarArrays of a module.
str
type
The IEC-Type of the array elements.
str
var_path
The IEC instance path of the array variable, relative to the module FB instance.
str
array_size_var_path
The IEC instance path of the variable, which holds the size of the array, relative to the module FB instance.
str
instance_name
The optional instance name of the array variable.
str
pragmas
Returns the compiler-pragmas that are to be inserted before the created array variables.
list
class
ScriptApplicationComposer.
ScriptModuleMetaData
Bases: object
Interface providing necessary information and functionalities for dealing with Module-MetaData in Python.
description
Localized (multi-lingual) description of the module.
str
category
The hierarchic category of the module. The components are separated by '|'.
str
inst_prefix
An optional, default instance prefix that is prepended to the name of the FB-instance variables of submodules and to the names of VarArray variables.
"" is a possible value. If no prefix is given, 'inst_prefix' is None.
str
default_inst_name
Returns the default name for instances of this module type.
str
class
ScriptApplicationComposer.
ScriptModuleAlarmGeneratorData
class
ScriptApplicationComposer.
ScriptModuleSetAlarm
Bases: object
Interface providing necessary information for a alarm, which is generated by the alarm generator.
alarm_id
Returns the internal id of the module alarm.
str
module_call_flags
Returns the type of module calls for alarming.
int
message
Returns the message of the module alarm.
str
alarm_class
Returns the alarm class of the module alarm.
str
latch_var_1
Returns the latch variable 1 of the module alarm.
str
latch_var_2
Returns the latch variable 2 of the module alarm.
str
deactivation
Returns the deactivation variable of the module alarm.
str
pending_time
Returns the pending time of the module alarm.
str
higher_prio_alarm_id
Returns the id of the higher priority alarm of the current module alarm.
str
expression
Returns the expression being alarm watched.
str
comparer
Returns the type of comparison for UpperLimit, LowerLimit and Equality alarms.
str
limit_expression_1
Returns the limiting expression for UpperLimit and LowerLimit alarms, the equality expression for Equality alarms, the lower area expression for InsideRange and OutsideRange alarms.
str
limit_expression_2
Returns the higher area expression for InsideRange and OutsideRange alarms.
str
inclide_limit_1
Returns whether the lower area expression (limit_expression_1) is includes in the defined area.
bool
inclide_limit_2
Returns whether the higher area expression (limit_expression_2) is includes in the defined area.
bool
inside_range
Returns whether a InsideRange or OutsideRange alarm is used.
bool
hysteresis
Returns the alarm hysteresis for UpperLimit, LowerLimit, Equality, InsideRange and OutsideRange expressions.
double
latch_vars
Returns all latch variables of the module alarm.
Dictionary(int, string)
class
ScriptApplicationComposer.
ScriptModuleDeviceGeneratorData
Bases: object
Interface providing necessary information and functionalities for dealing with Module-DeviceGenerator-Data in Python.
generated_devices
Returns a list of objects corresponding to the generated devices of the module.
list
generated_ios
Returns a list of objects corresponding to the generated ios of the module.
list
generated_inst_refs
Returns a list of objects corresponding to the generated instance references of the module.
list
generated_device_parameters
Returns a list of objects corresponding to the gerenrated device parameters of the module.
list
class
ScriptApplicationComposer.
ScriptModuleGeneratedDevice
Bases: object
Interface providing necessary information and functionalitties for dealing with Module-DeviceGenerator-Generated-Devices in Python.
device_id
Returns the internal identification of the (generated) device.
str
parent_device_id
Returns the internal identification of the parent (generated) device if available.
str
device_type
Returns the Device-Identification-Type of the generated device if available.
str
device_identification_id
Returns the Device-Identification-Id of the generated device if available.
str
device_version
Returns the Device-Identification-Version of the generated device if available.
str
device_module_id
Returns the Device-Identification-Module-Id of the generated device if available.
str
wildcard_type
Returns the Wildcard-Device-Type of the generated device if available.
str
wildcard_description
Return the Wildcard-Description of the generated device if available.
str
flexible_wildcard_maximum
Returns the maximum number of flexible Wildcard-Devices if available.
str
class
ScriptApplicationComposer.
ScriptModuleGeneratedIO
Bases: object
Interface providing necessary information and functionalities for dealing with Module-DeviceGenerator-Generated-IOs in Python.
io_id
Returns the internal id of the Generated-IO.
str
parent_id
Returns the parent (generated) device id of the Generated-IO.
str
connected_parameter_id
Returns the Device-Parameter-ID of the connected Generated-IO if available.
str
connected_connector_id
Returns the Device-Connector-ID of the connected Generated-IO if available.
str
connected_element_path
Returns the Device-Element-Path of the connected Generated-IO if available.
str
demanded_description
Returns the description of the demanded Generated-IO if available.
str
demanded_properties
Returns the demanded properties of the demanded Generated-IO if available.
list
class
ScriptApplicationComposer.
ScriptModuleGeneratedInstRef
Bases: object
Interface providing necessary information and functionalitties for dealing with Module-DeviceGenerator-Generated-InstRefs in Python.
inst_ref_id
Returns the internal id of the demanded Generated-InstRef if available.
str
parent_id
Returns the demanded id of the Instance reference.
str
demanded_description
Returns the description of the demanded Generated-InstRef if available.
str
demanded_properties
Returns the demanded properties of the demanded Generated-InstRef if available.
list
class
ScriptApplicationComposer.
ScriptModuleGeneratedDeviceParameter
Bases: object
Interface providing necessary information and functionalities for dealing with Module-DeviceGenerator-Generated-Device-Parameters in Python.
target_id
Returns the (generated) device id for which a parameter is set/added.
str
internal_id
Returns the internal id of the Generated-Device-Parameter.
str
connected_parameter_id
connected_parameter_id.
str
connected_connector_id
Returns the Device-Connector-ID of the Generated-Device-Parameter if available.
str
connected_element_path
Returns the Device-Element-Path of the Generated-Device-Parameter if available.
str
add_parameter_name
Returns the parameter name of the added Generated-Device-Parameter.
str
add_parameter_type
Returns the parameter type of the added Generated-Device-Parameter.
str
set_parameter_value
Returns the parameter value of the set Generated-Device-Parameter.
str
class
ScriptApplicationComposer.
ScriptModuleToplevelInfo
Bases: object
Interface providing all neccessary information and functionalities for dealing with Module-ToplevelInfo.
get_home
Gets the home location of a toplevel module where the composer generates the applications.
It has the form "Device.AppName" or holds the special string "POU Pool".
string
gvl_name
Gets the name of the global variable list where the module instances will be declared.
str
get_standard_task_high
Returns the standard task info for the high priority task, or None` if this task was not enabled.
get_standard_task_medium
Returns the standard task info for the medium priority task, or None if this task was not enabled.
get_standard_task_low
Returns the standard task info for the low priority task, or None if this task was not enabled.
custom_tasks
Returns all defined custom tasks.
str
pragmas
Returns the compiler pragmas that are to be inserted before instances of the module function block.
list
class
ScriptApplicationComposer.
ScriptModuleToplevelInfoInstance
Bases: ScriptApplicationComposer.ScriptModuleToplevelInfo
Interface providing all neccessary information and functionalities for dealing with Module-ToplevelInfo-Instances.
set_home
stHome
Sets the home location of a toplevel module.
stHome (str) -- String describing the home location in the form "Device.AppName" or by the special string "POU Pool".
set_standard_task_high
stTaskName
Sets the Name of the standard high priority task.
stTastName (str) -- The desired task name.
set_standard_task_medium
stTaskName
Sets the Name of the standard medium priority task.
stTastName (str) -- The desired task name.
set_standard_task_low
stTaskName
Sets the Name of the standard low priority task.
stTastName (str) -- The desired task name.
class
ScriptApplicationComposer.
ScriptModuleStdTaskInfo
Bases: object
Interface providing all necessary information and functionallities for dealing with a StandardTaskInfo.
name
The name of the task.
str
description
Localized (multi-lingual) description of the task.
str
is_update_ios
Whether module IOs that are directly mapped (i.e. not mapped to physical IOs) are read and written in this task or not.
str
is_create_if_missing
Whether the task is created, if it did not exist yet, or not.
str
is_readonly
Whether the name can be changed by the user or not.
str
class
ScriptApplicationComposer.
ScriptModuleCustomTaskInfo
Bases: object
Interface providing all necessary information and functionalities for dealing with a CustomTaskInfo.
method_name
The name of the method that will be called from this task.
str
priority
The priority of the task (0 (lowest) to 31 (highest)).
int
interval
The task interval in milliseconds.
int
Whether several custom tasks may share one method or not.
bool
is_update_ios
Whether module IOs that are directly mapped (i.e. not to physical IOs) are read an written in this task or not.
bool
class
ScriptApplicationComposer.
ScriptModuleProxy
class
ScriptApplicationComposer.
ScriptModuleIECDecl
Bases: object
Interface providing necessary information and functionallities for dealing with module-bound Declarations in Python.
name
Gets the name of the declaration object.
str
is_fb
Whether this declaration is an FB or not.
bool
is_interface
Whether this declaration is an interface or not.
bool
is_struct
Whether this declaration is a struct or not.
bool
is_method
Whether this declaration is a method or not.
bool
is_union
Whether this declaration is an union or not.
bool
is_other
Whether this declaration is of an other type or not.
bool
class
ScriptApplicationComposer.
ScriptModuleDeclaration
Bases: ScriptApplicationComposer.ScriptApplicationComposerObjectMarker
Interface providing necessary information and functionalities dealing with Modules Declarations in Python.
This interface is equalling the type ModuleDeclObject in the application composer interface collection.
decltext
Set or Gets the declaration text of the corresponding ModuleDeclObject.
str