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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
| <html>
<head>
<script language="JavaScript">
<!--hide
var tabName="instruments";
instrHelpWindow = null;
var selectdev;
var instr="";
function getHelp() {
if (!instrHelpWindow || instrHelpWindow.closed)
instrHelpWindow = window.open('/webhelp/Find_and_Query_Instruments.htm', 'help', 'scrollbars=yes,toolbar=yes,resizable=yes,width=800,height=600,screenX=100,screenY=100,left=100,top=100');
if(instrHelpWindow) instrHelpWindow.focus();
}
//-----------------------------------------------------------
// removes leading and trailing spaces
function RemoveSpaces(theValue) {
// remove leading spaces
while(''+ theValue.charAt(0) == ' ')
theValue= theValue.substring(1,theValue.length);
// remove trailing spaces
while(''+theValue.charAt(theValue.length-1) == ' ')
theValue= theValue.substring(0,theValue.length-1);
return theValue;
}
// scrutinize the timeout entry: all digits must
// be digits, contains only [0-9], and timeout >= 1
function CheckTO(formObj) {
formObj.timeout.value = RemoveSpaces(formObj.timeout.value);
var val = parseFloat(formObj.timeout.value, 10);
if (isNaN(val)) {
alert ('Timeout: '+formObj.timeout.value+' is not a valid number.');
formObj.timeout.select(); formObj.timeout.focus();
return false;
} else {
if(val < 1 || val > 60) {
alert ('Value for Timeout (sec) must be >= 1 and <= 60');
formObj.timeout.select(); formObj.timeout.focus();
return false;
} else {
formObj.timeout.value = parseInt(val + 0.5);
}
}
return true;
}
// make sure a device is selected from the list
function TestSelect(form) {
selectdev = form.devices.selectedIndex;
if (selectdev == -1) {
alert ('Please select a SICL address from the list');
return false;
}
else { instr = form.devices.options[selectdev].value;
}
return true;
}
// gWhichButton values: 'n'one |'f'ind |'w'rite|'r'ead|'q'uery|
// 'd'evclear|'s'tbread|'i'dn?|'e'rror|'c'learhist|'t'oexpire
function FindDevices(form) {
form.responsearea.value = "\n Looking for instruments...";
form.whichbutton.value = 'find';
form.submit();
}
function ClearClick(form) {
form.whichbutton.value = 'clearhist';
form.responsearea.value='';
form.submit();
}
function DevClearClick(form) {
if(TestSelect(form) && CheckTO(form)) {
form.whichbutton.value = 'devclear';
form.responsearea.value='';
form.submit();
}
}
function ReadSTBClick(form) {
if(TestSelect(form) && CheckTO(form)) {
form.whichbutton.value = 'stbread';
form.responsearea.value='';
form.submit();
}
}
function SendClick(form) {
if(TestSelect(form) && CheckTO(form)) {
var cmd = form.instrcmd.value;
if(cmd != '') {
form.whichbutton.value = 'write';
form.responsearea.value='';
form.submit();
}
}
}
function EnterClick(form) {
if(TestSelect(form) && CheckTO(form)) {
form.whichbutton.value = 'read';
form.responsearea.value='';
form.submit();
}
}
function QueryClick(form) {
if(TestSelect(form) && CheckTO(form)) {
var cmd = form.instrcmd.value;
if(cmd != '') {
form.whichbutton.value = 'query';
form.responsearea.value='';
form.submit();
}
}
}
function IdnClick(form) {
if(TestSelect(form) && CheckTO(form)) {
form.whichbutton.value = 'idn';
form.responsearea.value='';
form.submit();
}
}
function ErrClick(form) {
if(TestSelect(form) && CheckTO(form)) {
form.whichbutton.value = 'error';
form.responsearea.value='';
form.submit();
}
}
function SetForm(form) {
if(form.responsearea) {
form.responsearea.scrollTop = form.responsearea.scrollHeight;
}
if(form.devices) {
form.devices.scrollTop = 0;
}
}
function ClrAllTOClick(form) {
form.whichbutton.value = 'toexpire';
if (confirm("Are you sure you want to clear all pending operations on instruments connected to the E5810 " +
"(all timeouts will expire immediately)? This may affect others who are using the E5810.") ) {
form.responsearea.value='';
form.submit();
} else {
return;
}
}
//-->
</script>
<style>
<!--
input.redbuttontext {color : #cc0000}
-->
</style>
<title>Find and Control Instruments</title>
</head>
<BODY onload="SetForm(document.deviceform);" onUnload="document.deviceform.whichbutton.value='none';"
BGCOLOR="#ffffff" TOPMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0"
MARGINHEIGHT="0" ALINK="#003399" LINK="#003399" VLINK="#003399">
<BASEFONT FACE="Verdana,Arial,Helvetica" SIZE="3">
<CENTER>
<h1>
<font face="Helvetica,Arial,Times" size="5" color="#336699" >
<B>Find and Control Instruments<br>Connected to your E5810</B>
</font>
</h1>
</CENTER>
<form method="GET" name="deviceform">
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr align="center" valign="top">
<td valign="top" align="center">
<table width="92%" border="0" cellspacing="0" cellpadding="0">
<tr align="center" valign="top">
<td valign="top" align="center" colspan="3">
<table width="100%" border="2" cellspacing="0" cellpadding="2" bgcolor="#cccccc">
<tr align="center" valign="top">
<td valign="top" align="center">
<table width="98%" border="0" cellspacing="0" cellpadding="2" bgcolor="#cccccc">
<tr valign="top">
<td>
<table width="100%" border="2" cellspacing="1" cellpadding="5">
<font face="Arial,Helvetica, sans-serif", size="3">
<tr>
<th bgcolor="#336699" width="25%">
<font color="#FFFFFF" size="3">
Instruments<br>Connected
</font>
</th>
<th bgcolor="#336699" width="75%">
<font color="#FFFFFF" size="3">
Control Panel for<br>Selected Instrument
</font>
<INPUT TYPE="HIDDEN"
NAME="whichbutton"
VALUE="idn">
</th>
</tr>
<tr valign="top">
<td rowspan="2">
<table width="100%" border="0" cellspacing="3" cellpadding="5">
<font face="Arial,Helvetica, sans-serif", size="3">
<tr valign="top">
<td align="center">
<b>(SICL Addresses)</b></td>
</tr>
<tr valign="top">
<td align="center">
<select name="devices" size="14">
<option style="font-family:monospace">COM1,488
<option style="font-family:monospace" SELECTED>gpib0,3
</select>
</td>
</tr>
<tr valign="top">
<td align="center">
<input type="button" name="find" value=" Find "
onClick="FindDevices(document.deviceform);"
onMouseOver="window.status='Find instruments connected to E5810 via GPIB or RS-232'; return true;"
onMouseOut="window.status=''; return true;">
</td>
</tr>
</table>
</td>
<td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="3" valign="top">
<font face="Arial,Helvetica, sans-serif", size="2">
<tr align="center">
<td nowrap width="34%" align="right" valign="top">
Timeout (sec)
<input type="text" size="4" maxlength="4" name="timeout" value="5">
</td>
<td width="33%" nowrap align="center">
<input type="button" name="cleardev" value="Device Clear"
onClick="DevClearClick(document.deviceform);"
onMouseOver="window.status='Send Device Clear to selected instrument'; return true;"
onMouseOut="window.status=''; return true;">
</td>
<td nowrap align="left">
<input type="button" name="idn" value=" *IDN? "
onClick="IdnClick(document.deviceform);"
onMouseOver="window.status='Send *IDN? query to selected instrument'; return true;"
onMouseOut="window.status=''; return true;">
</td>
</tr>
<tr align="center">
<td nowrap align="right">
<input type="button" name="clearhist" value="Clear History"
onClick="ClearClick(document.deviceform);"
onMouseOver="window.status='Clear history window'; return true;"
onMouseOut="window.status=''; return true;">
</td>
<td width="33%" nowrap align="center">
<input type="button" name="readstb" value=" Read STB "
onClick="ReadSTBClick(document.deviceform);"
onMouseOver="window.status='Read status byte of selected instrument'; return true;"
onMouseOut="window.status=''; return true;">
</td>
<td nowrap align="left">
<input type="button" name="err" value="SYST:ERR?"
onClick="ErrClick(document.deviceform);"
onMouseOver="window.status='Send :SYST:ERR? query to selected instrument'; return true;"
onMouseOut="window.status=''; return true;">
</td>
</tr>
<tr>
<td align="center" colspan="3" bgcolor="#cccccc">
<textarea name="responsearea" rows="10" cols="40" wrap="OFF">
>*IDN?
<HEWLETT-PACKARD,53131A,0,3944
>*IDN?
<HEWLETT-PACKARD,53131A,0,3944
>*IDN?
<HEWLETT-PACKARD,53131A,0,3944
</textarea>
</td>
</tr>
<tr>
<td colspan="2" nowrap align="center">
<b>Instrument Command</b></td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="text" size="42" maxlength="38" name="instrcmd" value="300">
</td>
</tr>
<tr>
<td nowrap align="center" colspan="3">
<input type="button" name="sendcmd" value=" Send "
onClick="SendClick(document.deviceform);"
onMouseOver="window.status='Send command to selected instrument'; return true;"
onMouseOut="window.status=''; return true;">
<input type="button" name="readcmd" value="Receive"
onClick="EnterClick(document.deviceform);"
onMouseOver="window.status='Enter response from instrument'; return true;"
onMouseOut="window.status=''; return true;">
<input type="button" name="querycmd" value=" Query "
onClick="QueryClick(document.deviceform);"
onMouseOver="window.status='Query selected instrument'; return true;"
onMouseOut="window.status=''; return true;"><br><br>
</td>
</tr>
</font>
</table>
</td>
</tr>
<tr align="center">
<td colspan="3" align="center">
<input type="button" class="redbuttontext" name="toclear" value="Clear ALL Pending Operations"
onClick="ClrAllTOClick(document.deviceform);"
onMouseOver="window.status='Clear pending operations on instruments connected to E5810'; return true;"
onMouseOut="window.status=''; return true;">
</td>
</tr>
</table>
</td></tr></table>
</td></tr></table>
</td></tr></table>
</td></tr></table>
</form>
</body>
</html> |