Skip to content

Tools

Snmpscan

ScanResult dataclass

Snmpscan's result

Source code in pvi\Snmpscan.py
31
32
33
34
35
36
37
38
39
40
@dataclass
class ScanResult:
    """Snmpscan's result
    """
    target : str # CPU type
    AR : str # Automation Runtime Version
    ip : str # IP Address
    subnet : str # Subnet mask
    serial_number : str # hardware serial number
    status: str # Automation Runtime status

snmp_scan()

scans for CPUs with SNMP protocol activated

Returns:

Type Description
List[ScanResult]

list with scan results, namedtuple 'ScanResult'

Source code in pvi\Snmpscan.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
def snmp_scan()->List[ScanResult] :
    """scans for CPUs with SNMP protocol activated

    Returns:
        list with scan results, namedtuple 'ScanResult'
    """    

    global pviConnection, cpu_list, device

    device.errorChanged = deviceErrorChanged
    cpu_list.clear()
    pviConnection.start() 
    return cpu_list   

Anslscan

ScanResult dataclass

Anslscan's result

Source code in pvi\Anslscan.py
40
41
42
43
44
45
46
47
@dataclass
class ScanResult:
    """Anslscan's result
    """    
    target: str # CPU type
    AR: str  # Automation Runtime Version
    ip: str #IP address
    status: str # Automation Runtime status

ansl_scan(network)

Scan for CPU with ANSL protocol activated

Parameters:

Name Type Description Default
network

IP4 network, e.g. 192.168.100.0/24 or 192.168.100.0/255.255.255.0

required

Returns:

Type Description
List[ScanResult]

list with scan results, namedtuple('ScanResult', ['target','AR', 'ip','status'])

Source code in pvi\Anslscan.py
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
def ansl_scan( network : ipaddress.IPv4Network )->List[ScanResult] :
    """Scan for CPU with ANSL protocol activated

    Args:
        network : IP4 network, e.g. 192.168.100.0/24 or 192.168.100.0/255.255.255.0

    Returns:
        list with scan results, namedtuple('ScanResult', ['target','AR', 'ip','status'])
    """    
    global pviConnection, ip, cpu_list, network_to_scan
    network_to_scan = network
    cpu_list.clear()
    pviConnection.objectsArranged = objectsArranged
    pviConnection.start() 
    return cpu_list   

Inascan

ScanResult dataclass

Inascan's result

Source code in pvi\Inascan.py
39
40
41
42
43
44
45
46
47
@dataclass
class ScanResult: 
    """Inascan's result
    """
    target: str  # CPU type
    AR: str  # Automation Runtime Version
    ip: str  # IP address
    node: str  # INA node number
    status: str  # Automation Runtime status

ina_scan(network)

Scan for CPU with INA2000 protocol activated

Parameters:

Name Type Description Default
network

IP4 network, e.g. 192.168.100.0/24 or 192.168.100.0/255.255.255.0

required

Returns:

Type Description
List[ScanResult]

list with scan results, namedtuple('ScanResult', ['target','AR', 'ip', 'node', 'status'])

Source code in pvi\Inascan.py
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
def ina_scan( network : ipaddress.IPv4Network )->List[ScanResult] :
    """Scan for CPU with INA2000 protocol activated

    Args:
        network : IP4 network, e.g. 192.168.100.0/24 or 192.168.100.0/255.255.255.0

    Returns:
        list with scan results, namedtuple('ScanResult', ['target','AR', 'ip', 'node', 'status'])
    """    
    global pviConnection, ip, cpu_list, network_to_scan
    cpu_list.clear()
    network_to_scan = network
    pviConnection.objectsArranged = objectsArranged
    pviConnection.start() 
    return cpu_list