Resource
Quick Facts
| Property | Value |
|---|---|
| Class | CENPyOlpResource |
| Module | cenpylib.CENPyOlpResource |
| Package | cenpylib |
| Release | R2025.2.4 |
| Methods | 14 |
Quick Start
# Boilerplate Example
resource = ... # obtained from the runtime context
result = resource.GetName()Method Index
| Method | Returns | Summary |
|---|---|---|
GetName | str | Get the resource name. |
GetManufacturer | str | Get the resource manufacturer. |
GetSeries | str | Get the resource series. |
GetModel | str | Get the resource model. |
GetItemType | int | Get the item type of the resource as unsigned integer. |
GetItemSubType | int | Get the item sub type of the resource as unsigned integer. |
GetAllPorts | list[CENPyOlpPort] | Get all ports that are currently active in this resource. |
GetPorts | list[CENPyOlpPort] | Get all ports of a specific value type and direction that are currently active in this resource. |
GetAttributeByName | CENPyOlpAttribute | Get access to the attribute by name. |
GetValueOfIntegerAttributeByName | int | Get access to the integer attribute by name. |
GetValueOfFloatAttributeByName | float | Get access to the float attribute by name. |
GetValueOfStringAttributeByName | str | Get access to the string attribute by name. |
GetValueOfBoolAttributeByName | bool | Get access to the bool attribute by name. |
GetHomePositions | list[CENPyOlpHomePosition] | Get all home positions of this resource |
Query Methods
GetName
def GetName() -> strGet the resource name.
Returns: str — Resource name.
GetManufacturer
def GetManufacturer() -> strGet the resource manufacturer.
Returns: str — Resource manufacturer.
GetSeries
def GetSeries() -> strGet the resource series.
Returns: str — Resource series.
GetModel
def GetModel() -> strGet the resource model.
Returns: str — Resource model.
GetItemType
def GetItemType() -> intGet the item type of the resource as unsigned integer.
Returns: int — Item type of the resource as unsigned integer.
GetItemSubType
def GetItemSubType() -> intGet the item sub type of the resource as unsigned integer.
Returns: int — Item sub type of the resource as unsigned integer.
GetAllPorts
def GetAllPorts() -> list[CENPyOlpPort]Get all ports that are currently active in this resource.
Returns: list[CENPyOlpPort] — List of CENPyOlpPort objects, found ports.
GetPorts
def GetPorts(valueType: int, direction: int) -> list[CENPyOlpPort]Get all ports of a specific value type and direction that are currently active in this resource.
Parameters:
| Name | Type | Description |
|---|---|---|
valueType | int | Desired value type for the ports. |
direction | int | Desired direction for the ports. |
Returns: list[CENPyOlpPort] — List of CENPyOlpPort objects, found ports with specified value type and direction.
GetAttributeByName
def GetAttributeByName(attributeName: str) -> CENPyOlpAttributeGet access to the attribute by name.
Parameters:
| Name | Type | Description |
|---|---|---|
attributeName | str | Name of attribute to search for. |
Returns: CENPyOlpAttribute — Attribute object.
GetValueOfIntegerAttributeByName
def GetValueOfIntegerAttributeByName(name: str) -> intGet access to the integer attribute by name.
Parameters:
| Name | Type | Description |
|---|---|---|
name | str | Name of attribute to search for. |
Returns: int — Value of the attribute.
GetValueOfFloatAttributeByName
def GetValueOfFloatAttributeByName(name: str) -> floatGet access to the float attribute by name.
Parameters:
| Name | Type | Description |
|---|---|---|
name | str | Name of attribute to search for. |
Returns: float — Value of the attribute.
GetValueOfStringAttributeByName
def GetValueOfStringAttributeByName(name: str) -> strGet access to the string attribute by name.
Parameters:
| Name | Type | Description |
|---|---|---|
name | str | Name of attribute to search for. |
Returns: str — Value of the attribute.
GetValueOfBoolAttributeByName
def GetValueOfBoolAttributeByName(name: str) -> boolGet access to the bool attribute by name.
Parameters:
| Name | Type | Description |
|---|---|---|
name | str | Name of attribute to search for. |
Returns: bool — Value of the attribute.
GetHomePositions
def GetHomePositions() -> list[CENPyOlpHomePosition]Get all home positions of this resource
Returns: list[CENPyOlpHomePosition] — List of CENPyOlpHomePosition objects, representing home positions of this resource.
Related Types
Version Notes
This class is documented as of release R2025.2.4.