class
ScriptDeviceParameters.
ScriptDeviceConnectorSet
class
ScriptDeviceParameters.
ScriptConnector
Bases: object
A connector.
This is implemented by the ScriptDeviceConnector instances returned by the ScriptDeviceConnectorSet as well as by ScriptExplicitConnectorObject.
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.
Return type
int
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.
Return type
str
interface_name
Get an internationalized version of the interface name for presentation purposes.
Return type
str
connector_id
The unique connector id.
Return type
int
host_path
Get the id of the next connector towards the host.
-1, if the attached device is the controlling host.
Return type
int
connector_role
Get whether this connector is a parent or child connector.
Return type
ConnectorRole
is_explicit
Get whether a separate node should be shown in the user interface for this connector.
Return type
bool
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.
Return type
get_device_object
Get an instance of the device object this connector belongs to.
Return type
Returns
The device object.
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.
Version added
3.5.6.0
Return type
list
Returns
A python tuple containing strings declaring the additional interfaces.
class
ScriptDeviceParameters.
ScriptDeviceConnector
Bases: ScriptDeviceParameters.ScriptConnector
A device connector as contained in the ScriptDeviceConnectorSet.
parent
Gets the ScriptDeviceConnectorSet defining this connector.
Return type
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.
Version added
3.5.8.0
Return type
bool
class
ScriptDeviceParameters.
ScriptDeviceParameterSet
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.
parent
Gets the parent.
This is either a device object, a connector object, or an explicit connector object.
Return type
obj
get_device_object
Gets the device object or explicit connector object defining this parameter set.
Return type
by_id
id
Gets the ScriptDeviceParameter with the specified id.
Return type
class
ScriptDeviceParameters.
ScriptMappableDeviceParameterSet
Bases: ScriptDeviceParameters.ScriptDeviceParameterSet
Extension interface for the ScriptDeviceParameterSet returned by ScriptDeviceObject.device_parameters().
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.
Return type
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.
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.
Return type
obj
parameter
Gets the parameter defining this data element.
This will return the same instance if called on the ScriptDeviceParameter.
Return type
identifier
Unique identifier of this data element within it's parent element.
Return type
str
visible_name
Internationalized name of the data element (this is the name used in the user interface).
Return type
str
description
Internationalized description of the data element.
Return type
str
unit
Internationalized unit of the data element. To be used by the presentation layer.
Return type
str
bit_size
Get the size of this parameters value in bits.
Return type
long
user_comment
Get or set a specified user comment.
Return type
str
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.
Return type
bool
is_range_type
True, if the elements value must be within a certain range.
If this is true, the element implements the ScriptRangeDataElement interface.
Return type
bool
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.
Return type
bool
is_union
Gets a value indicating whether this ScriptDataElement is an union.
Return type
bool
can_access_online
Gets a value indicating whether this ScriptDataElement can be read online.
If this is true, the element additionally implements ScriptValueDataElement.
Return type
bool
is_mappable_io
Gets a value indicating whether this ScriptDataElement is a mappable input or output.
Version added
3.5.8.0
Return type
bool
Returns
True if is a mappable input or output; otherwise, False.
io_mapping
Gets the io mapping of this data element.
Version added
3.5.8.0
Return type
ScriptMapping
Returns
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
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: ScriptDeviceParameters.ScriptDataElement
Data element representing values of basic member elements which can be read and written.
default_value
Get the default value for this data element.
If the string is empty, then no explicit defaultvalue has been set.
Return type
str
value
Set/get the value for this element as a string representation.
Invalid values are accepted, but cause the error flag to be set.
Raises
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.
Return type
str
base_type
Gets the base type of this data element, or None if the type is a compound type.
Return 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.
Parameters
nTimeOut (int) -- The timeout.
Return type
str
Returns
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.
Parameters
value (str) -- The value.
class
ScriptDeviceParameters.
ScriptRangeDataElement
Bases: ScriptDeviceParameters.ScriptValueDataElement
Data element representing values with a limited range.
min_value
Get the minimal value for this element as a string representation.
Raises
InvalidOperationException -- Thrown if this element is not a range type element (equivalent to IsRangeType == False).
Return type
str
max_value
Get the maximum value for this element as a string representation.
Raises
InvalidOperationException -- Thrown if this element is not a range type element (equivalent to IsRangeType == False).
Return type
str
class
ScriptDeviceParameters.
ScriptEnumerationDataElement
Bases: ScriptDeviceParameters.ScriptValueDataElement
Data element representing enumeration values.
enum_value
Set/get the current value for this element as an enumeration value.
Raises
InvalidOperationException -- Thrown if this element is not a valid enumeration element.
Return type
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.
Raises
InvalidOperationException -- Thrown if this element is not a valid enumeration element.
Return type
list
value_index
Gets or sets the index of the current value within the allowed_values array.
Return type
int
Returns
-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.
Parameters
nTimeout (int) -- The timeout in milliseconds.
Return type
Returns
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.
Parameters
value (ScriptEnumerationValue) -- The value.
class
ScriptDeviceParameters.
ScriptEnumerationValue
Bases: object
Defines one element of an enumeration.
parent
Gets the defining ScriptEnumerationDataElement.
Return type
identifier
Unique identifier of this enumeration value within its enumeration element.
This is the value to use with the ScriptValueDataElement.value property.
Return type
str
visible_name
Internationalized name of the enumeration value. To be used by the presentation layer.
Return type
str
description
Internationalized description of the enumeration value. To be used by the presentation layer.
Return type
str
value
Gets the value.
Return type
str
index
Gets the index of this value within the ScriptEnumerationDataElement.allowed_values list.
Return type
str
class
ScriptDeviceParameters.
ScriptDeviceParameter
Bases: ScriptDeviceParameters.ScriptDataElement
id
Each parameter has a unique id within it's parameter list. This is also returned as the identifier in the underlying DataElement.
Return type
long
name
Internationalized name of the data element. To be used by the presentation layer.
Return type
str
offline_access_rights
Get the allowed access to this parameter in offline mode.
Return type
AccessRight
online_access_rights
Get the allowed access to this parameter in online mode.
Return type
AccessRight
downloaded_with_ioconfig
Get whether this parameter will be downloaded with the IO-Config.
Return type
bool
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.
Return type
ChannelType
diagnostic_type
Get or set the diagnostic type of this parameter.
Return type
DiagType
type_string
Returns a string which fully describes the type.
Return type
str
section
Gets the section of the parameter.
The sections are purely informative and help to structure the device parameters in user interfaces.
Return type
str
iec_type
Gets the iec type of this parameter, or None if none is defined.
Return type
str
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.
Return type
str
get_device_object
Gets the device object associated with this parameter.
Return type
disable_mapping
Get whether this parameter will be in the task mapping list for the io drivers.
Version added
3.5.12.20
Return type
bool
class
ScriptDeviceParameters.
ScriptIoVariableMapping
Bases: object
Represents a single variable mapping.
Id
Gets the identifier.
Return type
long
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.
Return type
str
default_variable
Gets the default variable, if defined in the device description.
The default variable, if existing, is defined in the device description.
Return type
str
mapping_creates_variable
Gets a value indicating whether this ScriptIoVariableMapping creates a new variable.
This is the opposite of maps_to_existing_variable.
Return type
bool
Returns
True if it creates a new variable; otherwise, False.
maps_to_existing_variable
Gets a value indicating whether this ScriptIoVariableMapping maps to an existing variable.
This is the opposite of mapping_creates_variable.
Return type
bool
Returns
True if it maps to an existing variable; otherwise, False.
class
ScriptDeviceParameters.
ScriptIoMapping
Bases: ScriptDeviceParameters.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.
automatic_iec_address
Gets or sets a value indicating whether this ScriptIoMapping has automatically assigned IEC addresses.
Return type
bool
Returns
True if the IEC addresses are automatically assigned; otherwise, False.
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.
Return type
str
Returns
The manually assigned IEC address, or the automatically assigned address if the IEC address is automatically assigned.