my $write;
my $load;
my $relative;
+my $on;
+my $off;
Getopt::Long::Configure(qw(gnu_getopt));
GetOptions(
mdc_voltage.pl (-board|-b) 0x8nnn (-channel|c) (0|1) (-relative|-r) (-7..7) [(-write|-w)]
change setting relative to the setting in file
+mdc_voltage.pl (-board|-b) 0xnnnn (--on|--off)
+ switches board on/off
+
Reads the current voltage setting from configuration file.
Sets the current voltage (optionally changes configuration file if -w is set).
Board needs to be a valid OEP address, or FFFF to show/load all channels.
if(defined $relative && ($relative < -7 || $relative > 7)) {
die "Wrong relative number (-7-7)\n";
}
+
+#Switch boards on/off
+if((defined $on || defined $off) && defined $board) {
+ if(defined $on && defined $off) {$on = 2;}
+ my $ret = MDCPower::power_switch($board,$on//0);
+ die "Board not found.\n" if $ret == -1;
+ }
#Load all settings
-if(defined $load && !defined $board) {
+elsif(defined $load && !defined $board) {
my $ret = MDCPower::set_all_voltages();
}