-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdemo.py
29 lines (20 loc) · 1.07 KB
/
demo.py
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
# -*- coding: utf-8 -*-
import logging
import time
from pylinkam import interface, sdk
logging.basicConfig(level=logging.DEBUG)
with sdk.SDKWrapper() as handle:
with handle.connect() as connection:
print(f"Name: {connection.get_controller_name()}")
print(f"Heater measurement: {connection.get_value(interface.StageValueType.HEATER1_TEMP)}")
print(f"Heater set-point before: {connection.get_value(interface.StageValueType.HEATER_SETPOINT)}")
print(f"Configuration: {connection.get_controller_config().to_mapping()}")
print(f"Status: {connection.get_status().to_mapping()}")
if not connection.set_value(interface.StageValueType.HEATER_SETPOINT, 25):
raise Exception('Something broke')
connection.enable_heater(True)
print(f"Heater set-point after: {connection.get_value(interface.StageValueType.HEATER_SETPOINT)}")
for _ in range(10):
print(f"Heater measurement: {connection.get_value(interface.StageValueType.HEATER1_TEMP)}")
time.sleep(1)
connection.enable_heater(False)