-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclient.py
More file actions
42 lines (32 loc) · 1014 Bytes
/
client.py
File metadata and controls
42 lines (32 loc) · 1014 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
38
39
40
41
42
"""
Created on Wed Feb 28 13:30:33 2024
@author: Marcus Edwards, Biswas
"""
import MultiPyVu as mpv
import time
from enum import Enum, auto
class MVUInstrumentList(Enum):
DYNACOOL = auto()
PPMS = auto()
PPMSMVU = auto()
VERSALAB = auto()
MPMS3 = auto()
OPTICOOL = auto()
na = auto()
mpv.instrument.InstrumentList = MVUInstrumentList
with mpv.Client() as client:
client.open()
print('client accepted')
# A basic loop that demonstrates communication between
# client/server
for t in range(5):
# Polls MultiVu for the temperature, field, and their
# respective states
T, sT = client.get_temperature()
F, sF = client.get_field()
# Relay the information from MultiVu
message = f'The temperature is {T}, status is {sT}; '
message += f'the field is {F}, status is {sF}. '
print(message)
# collect data at roughly 2s intervals
time.sleep(2)