-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.py
More file actions
58 lines (56 loc) · 1.45 KB
/
Copy pathconstants.py
File metadata and controls
58 lines (56 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
"""Constants file"""
# -----------------------------
# DPC3000 COMMANDS LIST
# -----------------------------
CHECK = "@check\r"
READPRESS = "@ReadPress:bar\r"
SETPRESS = "@SetPress:"
STOP = "@Stop\r"
VENT = "@Vent\r"
TICKPRESS = "@TickPress\r" # ErrUnknCmd
TICKVAC = "@TickVac\r"
READMODE = "@ReadMode\r"
SETMODE = "@SetMode:" # SetMode:{Mode} Control, Measure, Vent
READSTATUS = "@ReadStatus\r"
READSTATUS_BIN = "@ReadStatus:bin\r"
PRECISSION = 0.1 # bar
# -----------------------------
# DPC3000 error codes
# -----------------------------
PRESS_ERRORCODES = {
"CER": "Communication Error",
"PER": "Parameter Error",
"VER": "Value Error",
"TER": "Timeout",
"FER": "Format Error",
"SER": "Command Error",
"ErrUnknCmd": "Unknown Command",
"ErrFunction": "Error Function",
"ErrParameter": "Parameter Error",
}
PRESS_ERRORS = [
"CER",
"PER",
"VER",
"TER",
"FER",
"SER",
"ErrUnknCmd",
"ErrFunction",
"ErrParameter",
]
MODES = ["Control", "Measure", "Vent"]
# -----------------------------
# DPC3000 status
# -----------------------------
PRESS_STATUS = {
1: "Pressure is within the tolerance band",
2: "Fine control (PI control) completed",
4: "Coarse control completed",
8: "Venting valve is open",
16: "Controller is in overload state",
32: "Zero offset compensation is active",
64: "Controller timeout",
128: "Controller is in stop state",
}
# -----------------------------