forked from EspecNorthAmerica/ChamberConnectLibrary
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.py
More file actions
37 lines (29 loc) · 934 Bytes
/
example.py
File metadata and controls
37 lines (29 loc) · 934 Bytes
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
'''
examples of using the chamberconnectlibrary
'''
from chamberconnectlibrary.watlowf4 import WatlowF4
LOOP_NAMES = ['Temperature', 'Humidity']
CONTROLLER = WatlowF4(
interface='RTU',
serialport='//./COM7',
baudrate=19200,
loop_names=LOOP_NAMES
)
print(CONTROLLER.process_controller())
print('\ncascade loops:')
for i in range(CONTROLLER.cascades):
print(CONTROLLER.get_loop(i+1, 'cascade', ['processvalue', 'setpoint']))
print('\nloops:')
for i in range(CONTROLLER.loops):
print(CONTROLLER.get_loop(i+1, 'loop', 'processvalue', 'setpoint'))
print('\nnamed loops:')
for name in LOOP_NAMES:
print(CONTROLLER.get_loop(name, ['processvalue', 'setpoint']))
for name in LOOP_NAMES:
print(CONTROLLER.set_loop(name, setpoint=60.0))
print('\noperations:')
print(CONTROLLER.get_operation())
CONTROLLER.set_operation('standby')
print('\nEvents:')
for i in range(8):
print(CONTROLLER.get_event(i+1))