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.
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.
str
interface_name
Get an internationalized version of the interface name for presentation purposes.
str
connector_id
The unique connector id.
int
host_path
Get the id of the next connector towards the host.
-1, if the attached device is the controlling host.
int
connector_role
Get whether this connector is a parent or child connector.
ConnectorRole
is_explicit
Get whether a separate node should be shown in the user interface for this connector.
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.
get_device_object
Get an instance of the device object this connector belongs to.
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.
3.5.6.0
list
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.
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
driver_info
Get the driver info of the device connector.
3.5.15.0
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.
obj
get_device_object
Gets the device object or explicit connector object defining this parameter set.
by_id
id
Gets the ScriptDeviceParameter with the specified id.
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.
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.
obj
parameter
Gets the parameter defining this data element.
This will return the same instance if called on the ScriptDeviceParameter.
identifier
Unique identifier of this data element within it's parent element.
str
visible_name
Internationalized name of the data element (this is the name used in the user interface).
str
description
Internationalized description of the data element.
str
unit
Internationalized unit of the data element. To be used by the presentation layer.
str
bit_size
Get the size of this parameters value in bits.
long
user_comment
Get or set a specified user comment.
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.
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.
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.
bool
is_union
Gets a value indicating whether this ScriptDataElement is an union.
bool
can_access_online
Gets a value indicating whether this ScriptDataElement can be read online.
If this is true, the element additionally implements ScriptValueDataElement.
bool
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.
io_mapping
Gets the io mapping of this data element.
3.5.8.0
ScriptMapping
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.
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.
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
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: ScriptDeviceParameters.ScriptValueDataElement
Data element representing values with a limited range.
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
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: ScriptDeviceParameters.ScriptValueDataElement
Data element representing enumeration values.
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.
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
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.
parent
Gets the defining ScriptEnumerationDataElement.
identifier
Unique identifier of this enumeration value within its enumeration element.
This is the value to use with the ScriptValueDataElement.value property.
str
visible_name
Internationalized name of the enumeration value. To be used by the presentation layer.
str
description
Internationalized description of the enumeration value. To be used by the presentation layer.
str
value
Gets the value.
str
index
Gets the index of this value within the ScriptEnumerationDataElement.allowed_values list.
str
class
ScriptDeviceParameters.
ScriptDeviceParameter
Bases: ScriptDeviceParameters.ScriptDataElement
A device parameter.
id
Each parameter has a unique id within it's parameter list. This is also returned as the identifier in the underlying DataElement.
long
name
Internationalized name of the data element. To be used by the presentation layer.
str
offline_access_rights
Get the allowed access to this parameter in offline mode.
AccessRight
online_access_rights
Get the allowed access to this parameter in online mode.
AccessRight
downloaded_with_ioconfig
Get whether this parameter will be downloaded with the IO-Config.
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.
ChannelType
diagnostic_type
Get or set the diagnostic type of this parameter.
DiagType
type_string
Returns a string which fully describes the type.
str
section
Gets the section of the parameter.
The sections are purely informative and help to structure the device parameters in user interfaces.
str
iec_type
Gets the iec type of this parameter, or None if none is defined.
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.
str
get_device_object
Gets the device object associated with this parameter.
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.
Id
Gets the identifier.
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.
str
default_variable
Gets the default variable, if defined in the device description.
The default variable, if existing, is defined in the device description.
str
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.
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: 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.
bool
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.
str
The manually assigned IEC address, or the automatically assigned address if the IEC address is automatically assigned.