$c .= "\n";
print $port "$c";
my $x = "";
- for my $i (0..10) {
+ for my $i (0..20) {
$x .= <$port>//'';
if($x && (substr($x,-1) eq "\n" || substr($x,-1) eq "\r" || length($x)>=10) ) {
chomp $x;
return $x;
}
- usleep(1000);
+ usleep(10000);
}
return;
}
my ($s) = @_;
$s //= "";
my $FSR = 0.002; #Full Sclae Range is set to +-4.096V; LSB Size is 2mV
- if (substr($s,0,1) ne 'A') {die 'not a correct Answer from DCDC board'}
+ if (substr($s,0,1) ne 'A') {die "not a correct Answer from DCDC board: $s\n"}
my $command = hex(substr($s,5,1));
my $ch = hex(substr($s,4,1));
my $outp = hex(substr($s,3,1));