Resource Port Event
Quick Facts
| Property | Value |
|---|---|
| Class | CENPyOlpResourcePortEvent |
| Module | cenpylib.CENPyOlpResourcePortEvent |
| Package | cenpylib |
| Release | R2025.2.4 |
| Methods | 7 |
| Inherits from | CENPyOlpBuiltInEvent |
| Subclasses | Set Resource Port Event, Wait For Resource Port Event |
Inheritance
Quick Start
# Boilerplate Example
# Acquire the event object from the runtime context
resourcePortEvent = ... # provided by the frameworkMethod Index
| Method | Returns | Summary |
|---|---|---|
SetResource | — | Assigns a resource to this event. |
GetResource | CENPyOlpResource | Get the resource that is currently assigned to this event. |
AddResourcePortBool | — | Adds a port and a bool value for the port that this event should set. |
AddResourcePortByte | — | Adds a port and a byte value for the port that this event should set. |
AddResourcePortInt | — | Adds a port and an integer value for the port that this event should set. |
AddResourcePortInt16 | — | Adds a port and an 16 bit integer value for the port that this event should set. |
AddResourcePortFloat | — | Adds a port and a floating point value for the port that this event should set. |
Query Methods
GetResource
def GetResource() -> CENPyOlpResourceGet the resource that is currently assigned to this event.
Returns: CENPyOlpResource — Parent resource.
Mutation Methods
SetResource
def SetResource(resource: CENPyOlpResource)Assigns a resource to this event. The event can only set ports of the one resource that is currently assigned. Please note! In order to add resource ports and set their values, the resource must be set to a port event.
Parameters:
| Name | Type | Description |
|---|---|---|
resource | CENPyOlpResource | Resource that should be assigned to this event. |
AddResourcePortBool
def AddResourcePortBool(port: CENPyOlpPort, value: bool)Adds a port and a bool value for the port that this event should set. When the event is executed in simulation it will set the designated values to the ports that were added. If the port does not belong to the assigned resource it will not be added. If the port is not a bool input port it will not be added. If the port is already added its current value will be overwritten.
Parameters:
| Name | Type | Description |
|---|---|---|
port | CENPyOlpPort | The port to be added. |
value | bool | The value for the port. |
AddResourcePortByte
def AddResourcePortByte(port: CENPyOlpPort, value: int)Adds a port and a byte value for the port that this event should set. When the event is executed in simulation it will set the designated values to the ports that were added. If the port does not belong to the assigned resource it will not be added. If the port is not a byte input port it will not be added. If the port is already added its current value will be overwritten.
Parameters:
| Name | Type | Description |
|---|---|---|
port | CENPyOlpPort | The port to be added. |
value | int | The value for the port. |
AddResourcePortInt
def AddResourcePortInt(port: CENPyOlpPort, value: int)Adds a port and an integer value for the port that this event should set. When the event is executed in simulation it will set the designated values to the ports that were added. If the port does not belong to the assigned resource it will not be added. If the port is not a 32 - bit integer port it will not be added. If the port is already added its current value will be overwritten.
Parameters:
| Name | Type | Description |
|---|---|---|
port | CENPyOlpPort | The port to be added. |
value | int | The value for the port. |
AddResourcePortInt16
def AddResourcePortInt16(port: CENPyOlpPort, value: int)Adds a port and an 16 bit integer value for the port that this event should set. When the event is executed in simulation it will set the designated values to the ports that were added. If the port does not belong to the assigned resource it will not be added. If the port is not a 16 - bit integer port it will not be added. If the port is already added its current value will be overwritten.
Parameters:
| Name | Type | Description |
|---|---|---|
port | CENPyOlpPort | The port to be added. |
value | int | The value for the port. |
AddResourcePortFloat
def AddResourcePortFloat(port: CENPyOlpPort, value: float)Adds a port and a floating point value for the port that this event should set. When the event is executed in simulation it will set the designated values to the ports that were added. If the port does not belong to the assigned resource it will not be added. If the port is not a float input port it will not be added. If the port is already added its current value will be overwritten.
Parameters:
| Name | Type | Description |
|---|---|---|
port | CENPyOlpPort | The port to be added. |
value | float | The value for the port. |
Related Types
Version Notes
This class is documented as of release R2025.2.4.