//PWRSPLY:/path/to/device:speed:Name:Type:Channels
-//type can be HMP, PSP
+//type can be HMP, PSP, PST
PWRSPLY:/dev/ttyUSB0:38400:HMP4030:HMP:3
-PWRSPLY:/dev/ttyUSB1:2400:PSP-405:PSP:1
\ No newline at end of file
+PWRSPLY:/dev/ttyUSB1:2400:PSP-405:PSP:1
+PWRSPLY:/dev/ttyUSB0:9600:PST3202:PST:3
var value = parseFloat(document.getElementById("form_v"+chan).value);
var command;
if(type=="HMP") command = "INST OUT"+chan+"&VOLT "+value.toFixed(3);
+ if(type=="PST") command = ":CHAN"+chan+":VOLT "+value.toFixed(3);
new_commands.push(command);
forceShowReadings = 1;
}
var value = parseInt(document.getElementById("form_v_lim"+chan).value);
var command;
if(type=="HMP") command = "INST OUT"+chan+"&VOLT:PROT "+value.toFixed(3);
+ if(type=="PST") command = ":CHAN"+chan+":PROT:VOLT "+value.toFixed(3);
new_commands.push(command);
forceShowReadings = 1;
}
var value = parseFloat(document.getElementById("form_c_lim"+chan).value);
var command;
if(type=="HMP") command = "INST OUT"+chan+"&CURR "+value.toFixed(3);
+ if(type=="PST") command = ":CHAN"+chan+":PROT:CURR "+value.toFixed(3);
new_commands.push(command);
forceShowReadings = 1;
}
function turn_on(chan) {
if (chan > channels) return;
if(type=="HMP") new_commands.push("INST OUT"+chan+"&OUTP ON");
+ if(type=="PST") command = ":OUTP:STAT 1";
forceShowReadings = 1;
}
function turn_off(chan) {
if (chan > channels) return;
if(type=="HMP") new_commands.push("INST OUT"+chan+"&OUTP OFF");
+ if(type=="PST") command = ":OUTP:STAT 0";
forceShowReadings = 1;
}
}
else if(readSettingsRequest == 1) {
readSettingsRequest = 0;
- cmds = "&SYST:MIX&%2AIDN%3F";
- for(i=1;i<=channels;i++)
- cmds +="&INST OUT"+i+"&SOUR:VOLT%3F&SOUR:CURR%3F&VOLT:PROT%3F";
+ if(type=="HMP") {
+ cmds = "&SYST:MIX&%2AIDN%3F";
+ for(i=1;i<=channels;i++)
+ cmds +="&INST OUT"+i+"&SOUR:VOLT%3F&SOUR:CURR%3F&VOLT:PROT%3F";
+ }
+ if(type=="PST") {
+ cmd="%2AIDN%3F";
+ for(i=1;i<=channels;i++)
+ cmds +="&:CHAN"+i+":VOLT%3F&:CHAN"+i+":CURR%3F&:CHAN"+i+":PROT:VOLT%3F";
+ }
getdata('pwr.pl?'+ser_dev+'&'+type+"&"+speed+cmds,updatesettings);
}
else if(document.getElementById("showreadings").checked || forceShowReadings) {
forceShowReadings = 0;
cmds = "";
- for(i=1;i<=channels;i++)
- cmds +="&INST OUT"+i+"&MEAS:VOLT%3F&MEAS:CURR%3F&OUTP:STAT%3F";
+ if(type=="HMP") {
+ for(i=1;i<=channels;i++)
+ cmds +="&INST OUT"+i+"&MEAS:VOLT%3F&MEAS:CURR%3F&OUTP:STAT%3F";
+ }
+ if(type=="PST") {
+ for(i=1;i<=channels;i++)
+ cmds +="&:CHAN"+i+":MEAS:VOLT%3F&:CHAN"+i+":MEAS:CURR%3F&OUTP:STAT%3F";
+ }
getdata('pwr.pl?'+ser_dev+'&'+type+"&"+speed+cmds,updatereads);
}
else {
$executable = "htdocs/tools/vxi/vxi11_cmd";
}
-my $envstring = $ENV{'QUERY_STRING'};
-$envstring =~ s/%20/ /g;
-
-my @new_command = split('&',$envstring);
+my @new_command = split('&',$ENV{'QUERY_STRING'});
my $dev_ip = shift(@new_command);
my $cmds = shift(@new_command);