|
1 # tv301sf.proto Uwe Hoppe Fritz-Haber-Institut der MPG 3/2014 |
|
2 # |
|
3 # Stream Device Protocol for the Agilent TV 301SF Navigator pumping system. |
|
4 |
|
5 locktimeout = 5000; |
|
6 outTerminator = CR; |
|
7 inTerminator = ""; |
|
8 replytimeout = 1500; |
|
9 readtimeout = 100; |
|
10 extrainput = Ignore; |
|
11 iWT = 175; |
|
12 |
|
13 ### Uses "Window Meanings" protocol |
|
14 # Format <STX>+<ADDR>+<WIN>+<COM>+<DATA>+<ETX>+<CRC> |
|
15 # Where |
|
16 # <ADDR> (Unit address) = 0x80 (for RS 232) |
|
17 # <ADDR> (Unit address) = 0x80 + device number (0 to 31) (for RS 485) |
|
18 # <WIN> (Window) = string of 3 numeric char indicating the window # ( ‘000’ #to ‘999’) |
|
19 # <COM> (Command) = 0x30 to read the window, 0x31 to write into the window |
|
20 # <DATA> = an alphanumeric ASCII string with the data to be written into the window. |
|
21 #ADDR = $1 |
|
22 RCOM = 0x30; |
|
23 WCOM = 0x31; |
|
24 |
|
25 getStartStop { WIN = "000"; #1=default=Start; 0=Stop |
|
26 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
27 in STX,$1,$WIN,"%b"ETX"%01<xor>"; |
|
28 } |
|
29 |
|
30 setStartStop { WIN = "000"; #1=default=Start; 0=Stop |
|
31 out STX,$1,$WIN,$WCOM,"%d",ETX"%01<xor>"; |
|
32 in STX,$1,ACK,ETX"%01<xor>"; |
|
33 @init { wait $iWT; getStartStop; } |
|
34 } |
|
35 |
|
36 getRemote { WIN = "008"; #1=default=Remote; 0=Serial |
|
37 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
38 in STX,$1,$WIN,"%b"ETX"%01<xor>"; |
|
39 } |
|
40 |
|
41 setRemote { WIN = "008"; #1=default=Remote; 0=Serial |
|
42 out STX,$1,$WIN,$WCOM,"%d",ETX"%01<xor>"; |
|
43 in STX,$1,ACK,ETX"%01<xor>"; |
|
44 @init { wait $iWT; getRemote; } |
|
45 } |
|
46 |
|
47 getRotFreqSetting { WIN = "120"; |
|
48 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
49 in STX,$1,$WIN,$RCOM,"%6d"ETX"%01<xor>"; |
|
50 } |
|
51 |
|
52 setRotFreqSetting { WIN = "120"; CDATA= "955"; |
|
53 out STX,$1,$WIN,$WCOM,"000%u",ETX"%01<xor>"; |
|
54 in STX,$1,ACK,ETX"%01<xor>"; |
|
55 @init { wait $iWT; getRotFreqSetting; wait $iWT; } |
|
56 } |
|
57 |
|
58 getVentValve { WIN = "122"; #1=default=ON=CLOSE; 0=OPEN=OFF |
|
59 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
60 in STX,$1,$WIN,"%b"ETX"%01<xor>"; |
|
61 } |
|
62 |
|
63 setVentValve { WIN = "122"; #1=default=ON=CLOSE; 0=OPEN=OFF |
|
64 out STX,$1,$WIN,$WCOM,"%d",ETX"%01<xor>"; |
|
65 in STX,$1,ACK,ETX"%01<xor>"; |
|
66 @init { wait $iWT; getVentValve; } |
|
67 } |
|
68 |
|
69 getVentValveOperation { WIN = "125"; #Automatic = 0 |
|
70 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
71 in STX,$1,$WIN,"%b"ETX"%01<xor>"; |
|
72 } |
|
73 |
|
74 setVentValveOperation { WIN = "125"; #Automatic = 0 |
|
75 out STX,$1,$WIN,$WCOM,"%d",ETX"%01<xor>"; |
|
76 in STX,$1,ACK,ETX"%01<xor>"; |
|
77 @init { wait $iWT; getVentValveOperation; } |
|
78 } |
|
79 |
|
80 getPumpCurrent { WIN = "200"; |
|
81 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
82 in STX,$1,$WIN,$RCOM,"%6d"ETX"%01<xor>"; |
|
83 } |
|
84 |
|
85 getPumpVoltage { WIN = "201"; |
|
86 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
87 in STX,$1,$WIN,$RCOM,"%6d"ETX"%01<xor>"; |
|
88 } |
|
89 |
|
90 getPumpPower { WIN = "202"; |
|
91 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
92 in STX,$1,$WIN,$RCOM,"%6d"ETX"%01<xor>"; |
|
93 } |
|
94 |
|
95 getDrivingFrequency { WIN = "203"; |
|
96 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
97 in STX,$1,$WIN,$RCOM,"%6d"ETX"%01<xor>"; |
|
98 } |
|
99 |
|
100 getPumpTemperature { WIN = "204"; |
|
101 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
102 in STX,$1,$WIN,$RCOM,"%6d"ETX"%01<xor>"; |
|
103 } |
|
104 |
|
105 getPumpStatus { WIN = "205"; |
|
106 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
107 in STX,$1,$WIN,$RCOM,"%6i"ETX"%01<xor>"; |
|
108 } |
|
109 |
|
110 getErrorCode { WIN = "206"; |
|
111 out STX,$1,$WIN,$RCOM,ETX"%01<xor>"; |
|
112 in STX,$1,$WIN,$RCOM,"%o"ETX"%01<xor>"; |
|
113 } |