Index: fact/BIASctrl/Crate.h
===================================================================
--- fact/BIASctrl/Crate.h	(revision 11205)
+++ fact/BIASctrl/Crate.h	(revision 11361)
@@ -32,8 +32,8 @@
 	DimService *BiasCurrent;
 
+
 	int DAC[MAX_NUM_BOARDS][NUM_CHANNELS];		// Voltage in DAC units
 	double Volt[MAX_NUM_BOARDS][NUM_CHANNELS];	// Voltage in Volt
 	float Current[MAX_NUM_BOARDS][NUM_CHANNELS];
-
 	std::vector<unsigned char> Communicate(std::string);
 	void ClearVoltageArrays();
Index: fact/BIASctrl/History.txt
===================================================================
--- fact/BIASctrl/History.txt	(revision 11205)
+++ fact/BIASctrl/History.txt	(revision 11361)
@@ -13,2 +13,3 @@
 3/6/2011	Fixed bug in channel addressing from board numbers above 7.
 28/6/2011	Adapted for compilation under ubuntu
+12/7/2011	Default voltages implemented for pixel command.
Index: fact/BIASctrl/User.cc
===================================================================
--- fact/BIASctrl/User.cc	(revision 11205)
+++ fact/BIASctrl/User.cc	(revision 11361)
@@ -15,5 +15,5 @@
 								const char *Help;
   } CommandList[] = 
-   {{"pixel", &User::cmd_hv, 2, "<pixel id> <v>", "Change bias of pixel"},
+   {{"pixel", &User::cmd_hv, 2, "<pixel id> <volt|default>", "Change bias of pixel"},
 	{"channel", &User::cmd_hv, 2, "<channel range> <v>", "Change bias of (all) channels of active crate"},
     {"gs", &User::cmd_gs, 1, "[crate] <volt>", "Global voltage set active crate"},
@@ -50,4 +50,10 @@
   if (fStatusRefreshRate < MIN_RATE || fStatusRefreshRate > MAX_RATE)  fStatusRefreshRate = 1;
 
+  vector<string> Text = Tokenize(GetConfig("DefaultVoltage", ""), " \t");
+  
+  for (unsigned int i=0; i<Text.size(); i++) {
+	DefaultVoltage.push_back(atof(Text[i].c_str()));
+  }
+
   // Open devices
   for (unsigned int i=0; i<Boards.size(); i++) {
@@ -194,4 +200,5 @@
   double Double;
   struct Range Crt, Chan;
+  unsigned int PixelID = 0;
   vector< map<unsigned int, double> > Voltages (Crates.size());
 
@@ -203,9 +210,13 @@
 	  // Skip if first character is not digit
 	  if (isdigit(Parameter[n][0] == 0)) continue;
+	  
+	  // Extract pixel ID
+	  PixelID = atoi(Parameter[n].c_str());
+
 	  // Skip if pixel ID not existing 
-	  if (PixMap->Pixel_to_HVcrate(atoi(Parameter[n].c_str())) == PixMap->PM_ERROR_CODE) continue;
-
-      Crt.Min = Crt.Max = PixMap->Pixel_to_HVcrate(atoi(Parameter[n].c_str()));
-      Chan.Min = Chan.Max = PixMap->Pixel_to_HVboard(atoi(Parameter[n].c_str()))*NUM_CHANNELS + PixMap->Pixel_to_HVchannel(atoi(Parameter[n].c_str()));
+	  if (PixMap->Pixel_to_HVcrate(PixelID) == PixMap->PM_ERROR_CODE) continue;
+
+      Crt.Min = Crt.Max = PixMap->Pixel_to_HVcrate(PixelID);
+      Chan.Min = Chan.Max = PixMap->Pixel_to_HVboard(PixelID)*NUM_CHANNELS + PixMap->Pixel_to_HVchannel(PixelID);
 	}
 	// Channel identification
@@ -225,6 +236,12 @@
 	// Convert voltage value and check format 
 	if (!ConvertToDouble(Parameter[n+1], &Double)) {
-	  PrintMessage("Error: Wrong number format for voltage setting\n");
-	  continue;
+	  if (Match(Parameter[0], "pixel") && Match(Parameter[n+1], "default")) {
+		if (PixelID < DefaultVoltage.size()) Double = DefaultVoltage[PixelID];
+		else Double = 0;
+	  }
+	  else {
+		PrintMessage("Error: Wrong number format for voltage setting\n");
+		continue;
+	  }
 	}
 
Index: fact/BIASctrl/User.h
===================================================================
--- fact/BIASctrl/User.h	(revision 11205)
+++ fact/BIASctrl/User.h	(revision 11361)
@@ -35,4 +35,5 @@
 
 	std::vector<class Crate *> Crates;
+	std::vector<double> DefaultVoltage;
 
 	void commandHandler();
