pgva
PGVA
PGVA driver class.
This is the main class that the user will interact with to control the PGVA-1 device.
Source code in src/pgva/pgva.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
__init__(config)
PGVA driver class constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
PGVAConfig
|
A ModbusTCP or ModbusSerial config type to allow the driver to connect to the correct communication interface |
required |
Returns:
| Type | Description |
|---|---|
|
None |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If a serial configuration is passed through PGVA. |
TypeError
|
If config is not a supported PGVAConfig type for this driver. |
Source code in src/pgva/pgva.py
get_error_word()
Gets the error word from the PGVA-1.
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary of error word |
get_internal_sensor_data()
Returns all the internal sensor data in mBar.
Returns:
| Type | Description |
|---|---|
dict
|
All current readings of internal sensors |
get_modbus_error_word()
Get the error word from the PGVA-1.
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary of modbus error word |
get_output_pressure()
Returns the output port pressure in mBar.
Returns:
| Type | Description |
|---|---|
int
|
Positive or negative pressure in mBar |
get_pressure_chamber()
Returns the current reading of the pressure chamber in mBar.
Returns:
| Type | Description |
|---|---|
int
|
Pressure chamber pressure in mBar |
get_status_word()
Gets the status word from the PGVA.
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary of the status word |
get_vacuum_chamber()
Returns the current reading of the vacuum chamber in mBar.
Returns:
| Type | Description |
|---|---|
int
|
Vacuum chamber pressure in mBar |
get_warning_word()
Gets the warning word from the PGVA-1.
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary of warning word |
print_driver_information()
Prints driver information to console.
Returns:
| Type | Description |
|---|---|
None
|
None |
set_output_pressure(pressure)
Sets the output pressure to PGVA.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
int
|
Pressure in mBar between -450 ... 450 |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
set_pressure_chamber(pressure)
Sets the internal pressure chamber.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
int
|
Range between 0 and 450 mBar |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
set_vacuum_chamber(vacuum)
Sets the internal vacuum chamber.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vacuum
|
int
|
Range between -450 and 0 mBar |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
toggle_pump(toggle)
Enable / Disables the pump.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
toggle
|
bool
|
1 for on, 0 for off |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
toggle_trigger(trigger)
Toggles the trigger.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trigger
|
bool
|
bool value for on or off |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
trigger_actuation_valve(actuation_time)
Opens the actuation valve for a certain amount of time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
actuation_time
|
int
|
Time in milliseconds |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in src/pgva/pgva.py
PGVASerialConfig
dataclass
Bases: PGVAConfig
Class PGVA-1 configuration for serial connection.
Attributes:
| Name | Type | Description |
|---|---|---|
com_port |
str
|
COM port of the serial connection. Ex: 'COM3' or '/dev/ttyUSB0' |
baudrate |
int
|
Baudrate of the serial connection. Ex: 9600, 19200, 115200 |
Source code in src/pgva/pgva_config.py
PGVATCPConfig
dataclass
Bases: PGVAConfig
Class for PGVA-1 configuration class for ModbusTCP connection.
Attributes:
| Name | Type | Description |
|---|---|---|
ip |
str
|
IP address of PGVA in string form. Ex: '192.168.0.1' |
port |
int
|
Default to 502, port of connunication for the PGVA-1 |