$port->databits(8);
$port->stopbits(1);
$port->handshake("xoff");
-$port->handshake("none") if $ser_type eq "HMP";
+$port->handshake("none") if $ser_type eq "HMP" or $ser_type eq "PST";
$port->write_settings;
# debug output
while ( my $command = shift(@new_command) ) {
$port->lookclear;
usleep(1000);
+ usleep(20000) if $ser_type eq "PST";
$command = uri_unescape($command);
$port->write("$command\r\n");
# print "i sent the command: $command\n";
#print "\n\nokay.\n";
usleep(1000);
+ usleep(20000) if $ser_type eq "PST";
if($command =~ m/\?/) {
# print "waiting...\n";
READBACK: for (my $i = 0; ($i<500) ;$i++) {
$a = $port->lookfor(3);
- if ($a =~ m/\d/) {
+ if (defined $a and $a ne "" and $a =~ m/\d/) {
print $a."&";
last READBACK;
}
usleep(1000);
+ usleep(20000) if $ser_type eq "PST";
}
}
else {
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";
+ if(type=="HMP") new_commands.push("INST OUT"+chan+"&OUTP ON");
+ if(type=="PST") new_commands.push(":OUTP:STAT ON");
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";
+ if(type=="PST") new_commands.push(":OUTP:STAT OFF");
forceShowReadings = 1;
}
for(i=0;i<channels;i++) {
document.getElementById("form_v"+(i+1)).value=e[i*3];
document.getElementById("form_c_lim"+(i+1)).value=e[i*3+1];
- document.getElementById("form_v_lim"+(i+1)).value=e[i*3+1];
+ document.getElementById("form_v_lim"+(i+1)).value=e[i*3+2];
}
updateTask = setTimeout("communication()",updaterate);
}
cmds +="&INST OUT"+i+"&SOUR:VOLT%3F&SOUR:CURR%3F&VOLT:PROT%3F";
}
if(type=="PST") {
- cmd="%2AIDN%3F";
+ cmds="&%2AIDN%3F";
for(i=1;i<=channels;i++)
cmds +="&:CHAN"+i+":VOLT%3F&:CHAN"+i+":CURR%3F&:CHAN"+i+":PROT:VOLT%3F";
}