class
ScriptDeviceParameters.
ScriptDeviceConnectorSet
iterable=()
/
class
ScriptDeviceParameters.
ScriptConnector
Bases: object
A connector.
This is implemented by the ScriptDeviceConnector instances returned by the ScriptDeviceConnectorSet as well as by ScriptExplicitConnectorObject.
property
module_type
Id of the connector. This id is used by the driver on the runtime system.
The Id’s of matching parent and child connectors are different. Therefore in order to find a matching device for a given parent connector use the ConnectorType Property instead.
int
property
interface
The unique typename of a connector, eg. “Common.PCI”.
A parent connector may be connected to a child connector, if this connector type matches.
str
property
interface_name
Get an internationalized version of the interface name for presentation purposes.
str
property
connector_id
The unique connector id.
int
property
host_path
Get the id of the next connector towards the host.
-1, if the attached device is the controlling host.
int
property
connector_role
Get whether this connector is a parent or child connector.
property
is_explicit
Get whether a separate node should be shown in the user interface for this connector.
bool
property
host_parameters
Get the host parameter set of this connector.
The returned list is read-only which means you can’t add, insert or remove parameters or clear it. The list of available parameters is defined in the device description.
get_device_object
Get an instance of the device object this connector belongs to.
The device object.
property
additional_interfaces
Gets the additional interfaces of the connector.
This may be useful to find out which child connector of the current parent connector is actually valid.
3.5.6.0
list
A python tuple containing strings declaring the additional interfaces.
class
ScriptDeviceParameters.
ScriptDeviceConnector
Bases: ScriptConnector
A device connector as contained in the ScriptDeviceConnectorSet.
property
parent
Gets the ScriptDeviceConnectorSet defining this connector.
property
io_always_mapping
Gets a value indicating whether this ScriptDeviceConnector is always mapping the I/Os belonging to this connector, even if they’re not used in the IEC code.
By default, I/Os which are not used in the IEC code are not updated in the I/O task. For debugging and other purposes, this behaviour can be overridden with this property.
3.5.8.0
bool
property
driver_info
Get the driver info of the device connector.
3.5.15.0
class
ScriptDeviceParameters.
ScriptDeviceParameterSet
iterable=()
/
Bases: list
A device parameter set.
The list is read-only which means you can’t add, insert or remove parameters or clear it. The list of available parameters is defined in the device description.
property
parent
Gets the parent.
This is either a ScriptDeviceObject, a ScriptConnector, or a ScriptExplicitConnectorObject.
obj
get_device_object
Gets the device object or explicit connector object defining this parameter set.
by_id
id: int
Gets the ScriptDeviceParameter with the specified id.
class
ScriptDeviceParameters.
ScriptMappableDeviceParameterSet
iterable=()
/
Bases: ScriptDeviceParameterSet
Extension interface for the ScriptDeviceParameterSet returned by ScriptDeviceObject.device_parameters().
property
io_always_mapping
Gets a value indicating whether this ScriptMappableDeviceParameterSet is always mapping the I/Os belonging to device parameter set (not part of any connectors), even if they’re not used in the IEC code.
By default, I/Os which are not used in the IEC code are not updated in the I/O task. For debugging and other purposes, this behaviour can be overridden with this property.
bool
class
ScriptDeviceParameters.
ScriptDataElement
Bases: object
A data element of an online parameter.
Notice that instances of this interface usually also implement at least one of the related interfaces ScriptCompoundDataElement, ScriptValueDataElement, ScriptDeviceParameter, ScriptCompoundDataElement, ScriptEnumerationDataElement, ScriptRangeDataElement, which contain additional useful members, e. G. ScriptValueDataElement.value. Which interface applies can be determined via the properties has_sub_elements, is_range_type, is_enumeration, is_union and parameter.
property
parent
Gets the parent.
This property returns either the parent ScriptDataElement (which may be the ScriptDeviceParameter), or the ScriptDeviceParameterSet if the current element is the device parameter.
obj
property
parameter
Gets the parameter defining this data element.
This will return the same instance if called on the ScriptDeviceParameter.
property
identifier
Unique identifier of this data element within it’s parent element.
str
property
visible_name
Internationalized name of the data element (this is the name used in the user interface).
str
property
description
Internationalized description of the data element.
str
property
unit
Internationalized unit of the data element. To be used by the presentation layer.
str
property
bit_size
Get the size of this parameters value in bits.
int
property
user_comment
Get or set a specified user comment.
str
property
has_sub_elements
Get information whether this element is a compound type.
True for structs, arrays, bitfields, … - in this case, the element implements ScriptCompoundDataElement. If this is False, the element implements ScriptPrimitiveTypeDataElement. The properties is_enumeration and has_sub_elements are mutually exclusive, only one of them can be true at the same time.
bool
property
is_range_type
True, if the elements value must be within a certain range.
If this is true, the element implements the ScriptRangeDataElement interface.
bool
property
is_enumeration
True if this element is defined as an enumeration. It then also implements ScriptEnumerationDataElement.
The properties is_enumeration and has_sub_elements are mutually exclusive, only one of them can be true at the same time.
bool
property
is_union
Gets a value indicating whether this ScriptDataElement is an union.
bool
property
can_access_online
Gets a value indicating whether this ScriptDataElement can be read online.
If this is true, the element additionally implements ScriptValueDataElement.
bool
property
is_mappable_io
Gets a value indicating whether this ScriptDataElement is a mappable input or output.
3.5.8.0
bool
True if is a mappable input or output; otherwise, False.
property
io_mapping
Gets the io mapping of this data element.
3.5.8.0
The mapping, or None if no mapping exists (e. G. the data element is a device parameter and not an input or output).
class
ScriptDeviceParameters.
ScriptCompoundDataElement
iterable=()
/
Bases: list
Data element representing compound values which cannot be read or written, but they have subelements which can be modified (if they’re not ScriptCompoundDataElements themselves).
Implementations of this interface also implement ScriptDataElement and sometimes also ScriptDeviceParameter.
class
ScriptDeviceParameters.
ScriptValueDataElement
Bases: ScriptDataElement
Data element representing values of basic member elements which can be read and written.
property
default_value
Get the default value for this data element.
If the string is empty, then no explicit defaultvalue has been set.
str
property
value
Set/get the value for this element as a string representation.
Invalid values are accepted, but cause the error flag to be set.
InvalidOperationException – Thrown if this element is a compound type (struct, array, …) - in other words, when ScriptDataElement.has_sub_elements is True - in that case, you need to set the values of the sub elements.
str
property
base_type
Gets the base type of this data element, or None if the type is a compound type.
str
read_online_value
nTimeOut=1000
Get the online value with the specified timeout.
You need to check ScriptDataElement.can_access_online before using this property.
nTimeOut (int) – The timeout.
str
The read value.
write_online_value
value
Writes the specified value to the device.
You need to check ScriptDataElement.can_access_online before using this property.
value (str) – The value.
class
ScriptDeviceParameters.
ScriptRangeDataElement
Bases: ScriptValueDataElement
Data element representing values with a limited range.
property
min_value
Get the minimal value for this element as a string representation.
InvalidOperationException – Thrown if this element is not a range type element (equivalent to IsRangeType == False).
str
property
max_value
Get the maximum value for this element as a string representation.
InvalidOperationException – Thrown if this element is not a range type element (equivalent to IsRangeType == False).
str
class
ScriptDeviceParameters.
ScriptEnumerationDataElement
Bases: ScriptValueDataElement
Data element representing enumeration values.
property
enum_value
Set/get the current value for this element as an enumeration value.
InvalidOperationException – Thrown if this element is not a valid enumeration element.
property
allowed_values
Set/get the current value for this element as an enumeration value.
Invalid values are accepted, but cause the error flag to be set.
InvalidOperationException – Thrown if this element is not a valid enumeration element.
list[ScriptEnumerationValue]
property
value_index
Gets or sets the index of the current value within the allowed_values array.
int
-1 if the current value is not a valid enumeration value.
read_online_enum_value
nTimeout=1000
Get_online_enum_values the specified n timeout.
You need to check ScriptDataElement.can_access_online before using this property.
nTimeout (int) – The timeout in milliseconds.
Teh enumeration value.
write_online_value
value
Writes the specified value to the device.
You need to check ScriptDataElement.can_access_online before using this property.
value (ScriptEnumerationValue) – The value.
class
ScriptDeviceParameters.
ScriptEnumerationValue
Bases: object
Defines one element of an enumeration.
property
parent
Gets the defining ScriptEnumerationDataElement.
property
identifier
Unique identifier of this enumeration value within its enumeration element.
This is the value to use with the ScriptValueDataElement.value property.
str
property
visible_name
Internationalized name of the enumeration value. To be used by the presentation layer.
str
property
description
Internationalized description of the enumeration value. To be used by the presentation layer.
str
property
value
Gets the value.
str
property
index
Gets the index of this value within the ScriptEnumerationDataElement.allowed_values list.
str
class
ScriptDeviceParameters.
ScriptDeviceParameter
Bases: ScriptDataElement
A device parameter.
property
id
Each parameter has a unique id within it’s parameter list. This is also returned as the identifier in the underlying DataElement.
int
property
name
Internationalized name of the data element. To be used by the presentation layer.
str
property
offline_access_rights
Get the allowed access to this parameter in offline mode.
property
online_access_rights
Get the allowed access to this parameter in online mode.
property
downloaded_with_ioconfig
Get whether this parameter will be downloaded with the IO-Config.
bool
property
channel_type
If this parameter represents an IO channel, returns whether it is an input or an output channel. Otherwise this property returns ChannelType.None.
property
diagnostic_type
Get or set the diagnostic type of this parameter.
property
type_string
Returns a string which fully describes the type.
str
property
section
Gets the section of the parameter.
The sections are purely informative and help to structure the device parameters in user interfaces.
str
property
iec_type
Gets the iec type of this parameter, or None if none is defined.
str
property
param_type
get information about the original paramtype (e.g. “std:uint” or “localtypes:struct”).
Usually, this is the best method to describe the type of an parameter - however, in old projects, this value might not be accurate or even empty.
str
get_device_object
Gets the device object associated with this parameter.
property
disable_mapping
Get whether this parameter will be in the task mapping list for the io drivers.
3.5.12.20
bool
class
ScriptDeviceParameters.
ScriptIoVariableMapping
Bases: object
Represents a single variable mapping.
property
Id
Gets the identifier.
int
property
variable
Gets or sets the variable for the mapping.
The string must be a valid IEC variable expression. If it’s an unqualified expression, a new variable with the given name will be created. Qualified expressions define a mapping to an existing variable.
str
property
default_variable
Gets the default variable, if defined in the device description.
The default variable, if existing, is defined in the device description.
str
property
mapping_creates_variable
Gets a value indicating whether this ScriptIoVariableMapping creates a new variable.
This is the opposite of maps_to_existing_variable.
bool
True if it creates a new variable; otherwise, False.
property
maps_to_existing_variable
Gets a value indicating whether this ScriptIoVariableMapping maps to an existing variable.
This is the opposite of mapping_creates_variable.
bool
True if it maps to an existing variable; otherwise, False.
class
ScriptDeviceParameters.
ScriptIoMapping
Bases: ScriptIoVariableMapping
Describing the I/O Mapping options. This object also represents the first actual mapping for the variable.
Currently the device IO mapping editor UI allows only a single mapping to be configured, so we’ll implicitly handle this mapping similar to what the device IO mapping editor does. When an output variable (or a member thereof) is a struct, either the struct itself or its components may be mapped, but not both, as the semantics of the colliding mappings is not clear.
property
automatic_iec_address
Gets or sets a value indicating whether this ScriptIoMapping has automatically assigned IEC addresses.
bool
True if the IEC addresses are automatically assigned; otherwise, False.
property
manual_iec_address
Gets or sets the manually assigned IEC address.
Setting this to None will set automatic_iec_address to True, setting this to an address will set automatic_iec_address to False.
str
The manually assigned IEC address, or the automatically assigned address if the IEC address is automatically assigned.