-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoxcryo.proto
executable file
·304 lines (299 loc) · 9.56 KB
/
oxcryo.proto
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
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# Adapted from the driver of James OHea (DLS)
Terminator = "";
ReadTimeout = 100;
PollPeriod = 100;
ReplyTimeout = 2000;
#MaxInput = 32;
# read status input
# 32 byte packet:
# 0: unsigned char Length = always 32, ignored
# 1: unsigned char Type
# 2,3: unsigned short GasSetPoint (centi-Kelvin)
# 4,5: unsigned short GasTemp (centi-Kelvin)
# 6,7: signed short GasError (centi-Kelvin)
# 8: unsigned char Runmode (enum, values 0..6)
# 9: unsigned char PhaseID (enum, values 0..10)
# 10,11: unsigned short RampRate (centi-Kelvin/s)
# 12,13: unsigned short TargetTemp (centi-Kelvin)
# 14,15: unsigned short EvapTemp (centi-Kelvin)
# 16,17: unsigned short SuctTemp (centi-Kelvin)
# 18,19: unsigned short TimeRemaining (minutes)
# 20: unsigned char GasFlow (deci-litres/min)
# 21: unsigned char GasHeat (%)
# 22: unsigned char EvapHeat (%)
# 23: unsigned char SuctHeat (%)
# 24: unsigned char LinePressure (centi-bar)
# 25: unsigned char Alarm (enum, values 0..16)
# 26,27: unsigned short RunTime (minutes)
# 28,29: unsigned short ControllerNumber
# 30: unsigned char SoftwareVersion
# 31: unsigned char EvapAdjust
# 32: unsigned char TurboMode
# 33: unsigned char HardwareType
# 34: unsigned char Level (%)
# 35: unsigned char ShutterTime (unused in module)
# 36: unsigned char UnusedOne (unused in module)
# 37: unsigned char UnusedTwo (unused in module)
# 38,39: unsigned short UnusedThree (unused in module)
# 39,40: unsigned short UnusedFour (unused in module)
#read { in "%0r%(\$1:TYPE.RVAL)0r%(\$1:SETPOINT.RVAL)02r"
# "%(\$1:TEMP.RVAL)02r%(\$1:ERROR.RVAL)2r"
# "%(\$1:RUNMODE.RVAL)0r%(\$1:PHASE.RVAL)0r%(\$1:RAMPRATE.RVAL)02r"
# "%(\$1:TARGETTEMP.RVAL)02r%(\$1:EVAPTEMP.RVAL)02r"
# "%(\$1:SUCTTEMP.RVAL)02r%(\$1:REMAINING.RVAL)02r%(\$1:GASFLOW.RVAL)0r"
# "%(\$1:GASHEAT.RVAL)0r%(\$1:EVAPHEAT.RVAL)0r%(\$1:SUCTHEAT.RVAL)0r"
# "%(\$1:BACKPRESS.RVAL)0r%(\$1:ALARMI.RVAL)0r%(\$1:RUNTIME.RVAL)02r"
# "%(\$1:CTRLNUM.RVAL)02r%(\$1:VER.RVAL)0r%(\$1:EVAPADJUST.RVAL)0r"
# "%(\$1:TURBOMODE.RVAL)0r%(\$1:HARDWARETYPE.RVAL)0r%(\$1:LEVEL.RVAL)0r"
# "%0r%0r%0r%02r%02r"; }
read { in "\xAA\xAB" # header \xAAAB,
"%02r" # Data Size 2 Bytes
"\x03\xe8%(\$1:DEVICETYPE.RVAL)02r" # 1000
"\x03\xe9%(\$1:DEVICESUBTYPE.RVAL)02r" # 1001
"\x03\xea%(\$1:DEVICEMINTEMP.RVAL)02r" # 1002
"\x03\xeb%(\$1:DEVICEMAXTEMP.RVAL)02r" # 1003
"%02r%(\$1:VER.RVAL)02r" # 1004
"%02r%02r" # 1005
"%02r%02r" # 1006
"\x03\xf2%02r" # 1010
"%02r%02r" # 1011
"%02r%02r" # 1012
"%02r%02r" # 1013
"%02r%02r" # 1014
"%02r%02r" # 1015
"%02r%02r" # 1016
"%02r%02r" # 1017
"%02r%02r" # 1018
"%02r%02r" # 1019
"%02r%02r" # 1020
"%02r%02r" # 1021
"%02r%02r" # 1022
"%02r%02r" # 1023
"%02r%02r" # 1024
"%02r%02r" # 1025
"%02r%02r" # 1026
"%02r%(\$1:CTRLNUM.RVAL)02r" # 1027
"%02r%02r" # 1028
"%02r%02r" # 1029
"%02r%02r" # 1030
"%02r%02r" # 1031
"%02r%02r" # 1032
"%02r%02r" # 1033
"%02r%02r" # 1034
"%02r%02r" # 1035
"%02r%02r" # 1036
"%02r%02r" # 1037
"%02r%02r" # 1040
"%02r%02r" # 1041
"%02r%02r" # 1042
"%02r%02r" # 1043
"%02r%02r" # 1044
"%02r%02r" # 1045
"%02r%02r" # 1046
"\x04\x1a%(\$1:SETPOINT.RVAL)02r" # 1050
"%02r%(\$1:TEMP.RVAL)02r" # 1051
"%02r%(\$1:ERROR.RVAL)02r" # 1052
"%02r%(\$1:RUNMODE.RVAL)02r" # 1053
"%02r%(\$1:PHASE.RVAL)02r" # 1054
"%02r%(\$1:RAMPRATE.RVAL)02r" # 1055
"%02r%(\$1:TARGETTEMP.RVAL)02r" # 1056
"%02r%(\$1:EVAPTEMP.RVAL)02r" # 1057
"%02r%(\$1:SUCTTEMP.RVAL)02r" # 1058
"%02r%(\$1:REMAINING.RVAL)02r" # 1059
"%02r%(\$1:GASFLOW.RVAL)02r" # 1060
"%02r%(\$1:GASHEAT.RVAL)02r" # 1061
"%02r%(\$1:EVAPHEAT.RVAL)02r" # 1062
"%02r%(\$1:SUCTHEAT.RVAL)02r" # 1063
"%02r%(\$1:BACKPRESS.RVAL)02r" # 1064
"%02r%(\$1:ALARMI.RVAL)02r" # 1065
"%02r%(\$1:RUNTIME.RVAL)02r" # 1066
"%02r%(\$1:EVAPADJUST.RVAL)02r" # 1067
"%02r%(\$1:TURBOMODE.RVAL)02r" # 1068
"%02r%02r" # 1069
"\x04\x2e%02r" # 1070
"%02r%02r" # 1071
"%02r%02r" # 1072
"%02r%02r" # 1073
"%02r%02r" # 1080
"%02r%02r" # 1081
"%02r%02r" # 1082
"%02r%02r" # 1083
"%02r%02r" # 1084
"%02r%02r" # 1085
"%02r%02r" # 1086
"\x04\x3f%02r" # 1087
"%02r%02r" # 1088
"%02r%02r" # 1089
"\x04\x42%02r" # 1090
"%02r%02r" # 1091
"%02r%02r" # 1092
"\x04\x45%02r" # 1093
"%02r%02r" # 1094
"%02r%02r" # 1095
"%02r%02r" # 1096
"%02r%02r" # 1097
"\x04\x4a%02r" # 1098
"\x04\x4c%02r" # 1100
"%02r%02r" # 1101
"%02r%02r" # 1102
"%02r%02r" # 1103
"%02r%02r" # 1104
"%02r%02r" # 1105
"%02r%02r" # 1106
"%02r%02r" # 1107
"%02r%02r" # 1108
"%02r%02r" # 1200
"%02r%02r" # 1201
"%02r%02r" # 1202
"%02r%(\$1:LEVEL.RVAL)02r" # 1203
"%02r%02r" # 1204
"%02r%02r" # 1205
"%02r%02r" # 1206
"%02r%02r" # 1207
"%02r%02r" # 1208
"%02r%02r" # 1209
"%02r%02r" # 1210
"%02r%02r" # 1211
"%02r%02r" # 1212
"%02r%02r" # 1300
"%02r%02r" # 1301
"%02r%02r" # 1302
"%02r%02r" # 1303
"%02r%02r" # 1304
"%02r%02r" # 1305
"%02r%02r" # 1306
"%02r%02r" # 1307
"%02r%02r" # 1308
"%02r%02r" # 1309
"%02r%02r" # 1310
"%02r%02r" # 1311
"%02r%02r" # 1312
"%02r%02r" # 1313
"%02r%02r" # 1314
"\x05\x78%02r" # 1400
"%02r%02r" # 1401
"%02r%02r" # 1402
"%02r%02r" # 1403
"%02r%02r" # 1404
"%02r%02r" # 1405
"%02r%02r" # 1406
"%02r%02r" # 1407
"%02r%02r" # 1408
"%02r%02r" # 1409
"%02r%02r" # 1410
"%02r%02r" # 1411
"%02r%02r" # 1412
"%02r%02r" # 1413
"%02r%02r" # 1414
"%02r%02r" # 1415
"%02r%02r" # 1416
"%02r%02r" # 1417
"%02r%02r" # 1418
"%02r%02r" # 1419
"%02r%02r" # 1420
"%02r%02r" # 1421
"%02r%02r" # 1422
"%02r%02r" # 1423
"%02r%02r" # 1424
"%02r%02r" # 1425
"%02r%02r" # 1426
"%02r%02r" # 1427
"%02r%02r" # 1428
"%02r%02r" # 1429
"%02r%02r" # 1430
"%02r%02r" # 1431
"%02r%02r" # 1432
"%02r%02r" # 1433
"%02r%02r" # 1500
"%02r%02r" # 1501
"%02r%02r" # 1502
"%02r%02r" # 1503
"%02r%02r" # 1504
"%02r%02r" # 1505
"%02r%02r" # 1506
"%02r%02r" # 1507
"%02r%02r" # 1508
"%02r%02r" # 1509
"%02r%02r" # 1510
"%02r%02r" # 1511
"%02r%02r" # 1512
"%02r%02r" # 1513
"%02r%02r" # 1514
"%02r%02r" # 1515
"%02r%02r" # 1600
"%02r%02r" # 1601
"%02r%02r" # 1602
"%02r%02r" # 1603
"%02r%02r" # 1604
"%02r%02r" # 1605
"%02r%02r" # 1606
"\x06\xa4%02r" # 1700
"%02r%02r" # 1701
"%02r%02r" # 1800
"%02r%02r" # 1801
"%02r%02r" # 1802
"%02r%02r" # 1803
"%02r%02r" # 1804
"%02r%02r" # 1805
"%02r%02r" # 1806
"%02r%02r" # 1807
"%02r%02r" # 1808
"%02r%02r" # 1809
"%02r%02r" # 1810
"%02r%02r" # 1811
"%02r%02r" # 1812
"%02r%02r" # 1813
"%02r%02r" # 1900
"%02r%02r" # 1901
"%02r%02r" # 1902
"%02r%02r" # 1903
"\x07\xd0%02r" # 2000
"%02r%02r" # 2001
"%02r%02r" # 2002
"%02r%(\$1:COLDHEADTEMP.RVAL)02r" # 2010
"%02r%(\$1:SHIELDTEMP.RVAL)02r" # 2011
"%02r%(\$1:VACGAUGE.RVAL)02r" # 2012
"%02r%(\$1:NOZZLETEMP.RVAL)02r" # 2013
"%02r%(\$1:SAMPLEHEAT.RVAL)02r" # 2014
"%02r%(\$1:COLDHEADHEAT.RVAL)02r" # 2015
"%02r%(\$1:SHIELDHEAT.RVAL)02r" # 2016
"%02r%(\$1:NOZZLEHEAT.RVAL)02r" # 2017
"%02r%02r" # 2018
"%02r%02r" # 2019
"%02r%02r" # 2020
"%02r%02r" # 2021
"%02r%02r" # 2022
"%02r%02r" # 2023
"%02r%02r" # 2024
"%02r%(\$1:SAMHOLDTEMP.RVAL)02r" # 2030
"%02r%(\$1:CRYOSTATTEMP.RVAL)02r" # 2031
"%02r%(\$1:SAMHOLDPRES.RVAL)02r" # 2032
"%02r%02r" # 2033
"%02r%(\$1:ELAPSED.RVAL)02r" # 2034
"%02r%(\$1:SUCTSETTEMP.RVAL)02r" # 2035
"%02r%(\$1:NOZZLESETTEMP.RVAL)02r" # 2036
"%02r%02r" # 2037
"%02r%02r" # 2038
"%02r%02r" # 2039
"%02r%02r" # 2040
"%02r%(\$1:COLLARTEMP.RVAL)02r" # 2041
"%02r%(\$1:VACSENSOR.RVAL)02r" # 2042
"%02r" # 16 bit sum checksum excluding header, length, checksum and footer bytes
"%02r";} # footer \xABAA
# structure of valid command packet is
# char command id
# char param 1
# char param 2
# short checkum 8 bit sum
restart { out "\x00\x0A\x00\x00\x00\x00%<sum8>"; }
ramp { out "\x00\x0B%(\$1:RRATEH.RVAL)r%(\$1:RRATEL.RVAL)r%(\$1:RTEMPH.RVAL)r%(\$1:RTEMPL.RVAL)r%<sum8>"; }
plat { out "\x00\x0C%(\$1:PTIMEH.RVAL)r%(\$1:PTIMEL.RVAL)r\x00\x00\%<sum8>"; }
hold { out "\x00\x0D\x00\x00\x00\x00%<sum8>"; }
cool { out "\x00\x0E%(\$1:CTEMPH.RVAL)r%(\$1:CTEMPL.RVAL)r\x00\x00%<sum8>"; }
end { out "\x00\x0F%(\$1:ERATEH.RVAL)r%(\$1:ERATEL.RVAL)r\x00\x00%<sum8>"; }
purge { out "\x00\x10\x00\x00\x00\x00%<sum8>"; }
pause { out "\x00\x11\x00\x00\x00\x00%<sum8>"; }
resume { out "\x00\x12\x00\x00\x00\x00%<sum8>"; }
stop { out "\x00\x13\x00\x00\x00\x00\x13"; }
turbo { out "\x00\x14\x00%(\$1:TURBO.RVAL)r\x00\x00%<sum8>"; }
#setstatusformat { out "\x03\x28%(\$1:SETSTATUSFORMAT.RVAL)r"; }