Skip to content

Class definition

Station

Bases: PviObject

class representing station object

ANSL & INA2000: can be used but is not necessary SNMP specifies particular PLC see PVI documentation for more details

Source code in pvi\pvi_objects\Station.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class Station(PviObject):
    '''class representing station object

    ANSL & INA2000: can be used but is not necessary
    SNMP specifies particular PLC
    see PVI documentation for more details
    '''
    def __init__( self, parent : PviObject, name : str, **objectDescriptor: Union[str,int, float] ):
        '''
        Args:
            parent : device object  
            name : name of station in PVI hierarchy
            objectDescriptor :
                ANSL : ''
                INA2000 : ''
                SNMP : MAC address, e.g. CD="/CN=00-60-65-02-f0-2c"
        '''
        if parent.type != T_POBJ_TYPE.POBJ_DEVICE:
            raise PviError(12009, self)          
        super().__init__( parent, T_POBJ_TYPE.POBJ_STATION, name, **objectDescriptor)

    def __repr__(self):
        return f"Station( name={self._name}, linkID={self._linkID} )"

descriptor: dict property

errorChanged: Union[Callable[[PviObject, int], None], Callable[[int], None]] property writable

name: str property

objectName: str property

status: dict property writable

type: T_POBJ_TYPE property

__init__(parent, name, **objectDescriptor)

Parameters:

Name Type Description Default
parent

device object

required
name

name of station in PVI hierarchy

required
objectDescriptor

ANSL : '' INA2000 : '' SNMP : MAC address, e.g. CD="/CN=00-60-65-02-f0-2c"

{}
Source code in pvi\pvi_objects\Station.py
35
36
37
38
39
40
41
42
43
44
45
46
47
def __init__( self, parent : PviObject, name : str, **objectDescriptor: Union[str,int, float] ):
    '''
    Args:
        parent : device object  
        name : name of station in PVI hierarchy
        objectDescriptor :
            ANSL : ''
            INA2000 : ''
            SNMP : MAC address, e.g. CD="/CN=00-60-65-02-f0-2c"
    '''
    if parent.type != T_POBJ_TYPE.POBJ_DEVICE:
        raise PviError(12009, self)          
    super().__init__( parent, T_POBJ_TYPE.POBJ_STATION, name, **objectDescriptor)

kill()

Source code in pvi\pvi_objects\Object.py
262
263
264
265
266
267
268
269
def kill(self) -> None:
    if self._linkID != 0 and self._connection is not None:  
        self._connection._linkIDs.pop(self._linkID)
        self._connection._pviObjects.remove(self)
        self._result = PviXUnlink(self._hPvi, self._linkID)
        self._linkID = 0
        if self._result != 0 and self._result != 12045:
            raise PviError(self._result, self)