class
ScriptIecLanguageObjectContainer.
PouType
value
class
ScriptIecLanguageObjectContainer.
DutType
value
class
ScriptIecLanguageObjectContainer.
SpecialPouType
value
Bases: Enum
Defines the type of special POUs (with implicit checks) which have to be created.
3.5.12.10
none
= 1
No special POU.
check_bounds
= 2
Bound checks.
Appropriate handling of bound violations; such handling includes setting flags or changing field indices.
check_pointer
= 3
Pointer checks.
check_range_unsigned
= 4
Check range unsigned.
check_range_signed
= 5
Check range signed.
check_div_real_64
= 6
Check division real 64 bit.
check_div_real_32
= 7
Check division real 32 bit.
check_div_int_64
= 8
Check division real 64 bit.
check_div_int_32
= 9
Check division real 32 bit.
check_l_range_unsigned
= 10
L-range checks unsigned.
check_l_range_signed
= 11
L-range checks signed.
class
ScriptIecLanguageObjectContainer.
ScriptIecLanguageObjectContainer
Bases: object
This allows objects to create POU like objects, the methods will be available in the project root as well as applications, and folders below them.
The extended settings and specializations which are available in the “Add Object” dialog, but not available in this interface, can be implemented by direct access of the textual declaration part via ScriptObjectWithTextualDeclaration - for example, setting derived interfaces, or persistent or constant GVLs.
3.5.9.0
create_pou
type: SpecialPouType
Creates a POU with implicit checks according to the specified type.
Adding a check function will provoke a full recompile and prohibit an online change.
3.5.12.10
type (SpecialPouType) – The SpecialPouType which should be created.
Exception – Any exception which might occur (e. G. if an object with the same name already exists within the same namespace or the object cannot be created under this parent.
The ScriptObject of the newly created POU.
create_gvl
name
Creates a GVL with the specified name.
name (str) – The name.
Exception – Any exception which might occur (e. G. if the name is not an IEC identifier, or an object with the same name already exists within the same namespace, or the language guid is not valid, or the object cannot be created under this parent.
The ScriptObject of the newly created GVL.
create_dut
name
type=DutType.Structure
baseType=None
Creates a DUT with the specified name and type.
As with manual object creation in the UI, enums will get the attribute ‘strict’ with compiler versions >= 3.5.7.0, and additionally the attribute ‘qualified_only’ with compiler version 3.5.8.0.
name (str) – The name.
type (DutType) – The type.
baseType (str) – The base type. This optional parameter is necessary for for Alias types, optional for STRUCTs and enums, and currently not allowed for unions.
Exception – Any exception which might occur (e. G. if the name is not an IEC identifier, or an object with the same name already exists within the same namespace, or the language guid is not valid, or the object cannot be created under this parent.
The ScriptObject of the newly created DUT.
create_interface
name
baseInterfaces='__System.IQueryInterface'
Creates an interface with the specified name.
name (str) – The name.
baseInterfaces (str) – The base interfaces (comma separated).
Exception – Any exception which might occur (e. G. if the name is not an IEC identifier, or an object with the same name already exists within the same namespace, or the language guid is not valid, or the object cannot be created under this parent.
The ScriptObject of the newly created interface.
create_persistentvars
name
Creates a persistent GVL with the specified name.
name (str) – The name.
Exception – Any exception which might occur (e. G. if the name is not an IEC identifier, or an object with the same name already exists within the same namespace, or the language guid is not valid, or the object cannot be created under this parent.
The ScriptObject of the newly created persistent GVL.
class
ScriptIecLanguageObjectContainer.
ScriptIecLanguageMemberContainer
Bases: object
This allows objects to create POU like member objects, the methods will be available on POUs, Interfaces, GVLs, and folders below them.
The extended settings and specializations which are available in the “Add Object” dialog, but not available in this interface, can be implemented by direct access of the textual declaration part via ScriptObjectWithTextualDeclaration - for example, setting derived interfaces, or persistent or constant GVLs.
3.5.9.0
See also: ScriptTreeObject
create_property
name
return_type='int'
language=None
Creates a property with the specified name and type.
name (str) – The name.
return_type (str) – The return type.
language (Guid or None) – The language for the getter and setter. Optional, the default is structured text. It is illegal to specify a language for interface properties.
Exception – Any exception which might occur (e. G. if the name is not an IEC identifier, or an object with the same name already exists within the same namespace, or the language guid is not valid, or the object cannot be created under this parent.
The ScriptObject of the newly created property.
create_method
name
return_type=None
language=None
Creates a method with the specified name and type.
Methods cannot be added to GVLs or Functions.
name (str) – The name.
return_type (str) – The return type.
language (Guid or None) – The language for the getter and setter. Optional, the default is structured text.
Exception – Any exception which might occur (e. G. if the name is not an IEC identifier, or an object with the same name already exists within the same namespace, or the language guid is not valid, or the object cannot be created under this parent.
The ScriptObject of the newly created method.
create_action
name
language=None
Creates an action with the specified name and type.
Actions cannot be added to GVLs or Functions.
name (str) – The name.
language (Guid or None) – The language for the getter and setter. Optional, the default is structured text.
Exception – Any exception which might occur (e. G. if the name is not an IEC identifier, or an object with the same name already exists within the same namespace, or the language guid is not valid, or the object cannot be created under this parent.
The ScriptObject of the newly created action.
create_transition
name
language=None
Creates an transition with the specified name and type.
Transitions cannot be added to GVLs or Functions.
name (str) – The name.
language (Guid or None) – The language for the getter and setter. Optional, the default is structured text.
Exception – Any exception which might occur (e. G. if the name is not an IEC identifier, or an object with the same name already exists within the same namespace, or the language guid is not valid, or the object cannot be created under this parent.
The ScriptObject of the newly created transition.
class
ScriptIecLanguageObjectContainer.
ScriptImplementationLanguage
Bases: object
Defines the Guids for the standard IEC 61131-3 languages and those available as CODESYS extensions.
An instance of this interface will be injected with the name “ImplementationLanguages”.
3.5.9.0
property
st
Gets the language guid for ST / Structured Text.
Guid
property
cfc
Gets the language guid for CFC / Continous Flow Chart (free layout FUP).
Guid
property
page_oriented_cfc
Gets the language guid for Page oriented CFC / Continous Flow Chart (free layout FUP).
Guid
property
fbd
Gets the language guid for FBD / Function Block Diagram (FBS).
Guid
property
instruction_list
Gets the language guid for IL / Instruction List (AWL).
Guid
property
ladder
Gets the language guid for LD / Ladder Diagram (KOP).
Guid
property
sfc
Gets the language guid for SFC / Secuential Function Chart (AS).
Currently, SFC cannot be used for ScriptIecLanguageObjectContainer.create_pou() with PouType.Function, ScriptIecLanguageMemberContainer.create_method(), ScriptIecLanguageMemberContainer.create_property() and ScriptIecLanguageMemberContainer.create_transition().
Guid
property
uml_statechart
Gets the language guid for the uml statechart.
The UML AddOn needs to be installed for this language. See also: http://store.codesys.com/codesys-uml.html
Guid