Index: trunk/FACT++/src/agilentctrl.cc
===================================================================
--- trunk/FACT++/src/agilentctrl.cc	(revision 17668)
+++ trunk/FACT++/src/agilentctrl.cc	(revision 17669)
@@ -24,4 +24,8 @@
 class ConnectionAgilent : public Connection
 {
+public:
+    static string fMode;
+
+private:
     bool fIsVerbose;
     bool fDebugRx;
@@ -285,4 +289,6 @@
 };
 
+string ConnectionAgilent::fMode;
+
 // ------------------------------------------------------------------------
 
@@ -303,5 +309,5 @@
     ConnectionDimAgilent(ba::io_service& ioservice, MessageImp &imp) :
         ConnectionAgilent(ioservice, imp),
-        fDim("AGILENT_CONTROL/DATA", "F:1;F:1;F:1;F:1",
+        fDim("AGILENT_CONTROL_"+fMode+"/DATA", "F:1;F:1;F:1;F:1",
              "|U_nom[V]: Nominal output voltage"
              "|U_mes[V]: Measured output voltage"
@@ -418,5 +424,5 @@
 public:
     StateMachineAgilent(ostream &out=cout) :
-        StateMachineAsio<T>(out, "AGILENT_CONTROL"), fAgilent(*this, *this)
+        StateMachineAsio<T>(out, "AGILENT_CONTROL_"+S::fMode), fAgilent(*this, *this)
     {
         // State names
@@ -481,5 +487,9 @@
         fAgilent.SetInterval(conf.Get<uint16_t>("interval"));
 
-        SetEndpoint(conf.Get<string>("addr"));
+        SetEndpoint(conf.Get<string>("addr.", S::fMode));
+
+        const std::vector<std::string> opts = conf.GetWildcardOptions("addr.*");
+        for (auto it=opts.begin(); it!=opts.end(); it++)
+            conf.Get<string>(*it);
 
         return -1;
@@ -502,5 +512,6 @@
     control.add_options()
         ("no-dim",    po_bool(),         "Disable dim services")
-        ("addr,a",    var<string>("10.0.100.220:5025"),  "network address of Agilent")
+        ("mode,m",    var<string>()->required(), "Mode (e.g. 24V, 50V, 80V)")
+        ("addr.*",    var<string>(),     "Network address of Agilent specified by mode")
         ("debug-rx",  po_bool(false),    "Enable raw debug output wehen receiving data")
         ("interval",  var<uint16_t>(15), "Interval in seconds in which the Agilent status is requested")
@@ -508,5 +519,9 @@
         ;
 
+    po::positional_options_description p;
+    p.add("mode", 1); // The first positional options
+
     conf.AddOptions(control);
+    conf.SetArgumentPositions(p);
 }
 
@@ -523,5 +538,5 @@
 {
     cout <<
-        "The agilentctrl controls the FACT camera power supply.\n\n"
+        "The agilentctrl controls the FACT Agilent power supplies.\n\n"
         "\n"
         "The default is that the program is started without user intercation. "
@@ -530,6 +545,6 @@
         "help message about the usuage can be brought to the screen.\n"
         "\n"
-        "Usage: agilentctrl [-c type] [OPTIONS]\n"
-        "  or:  agilentctrl [OPTIONS]\n";
+        "Usage: agilentctrl [-c type] [OPTIONS] mode\n"
+        "  or:  agilentctrl [OPTIONS] mode\n";
     cout << endl;
 }
@@ -550,4 +565,6 @@
         return 127;
 
+    ConnectionAgilent::fMode = conf.Get<string>("mode");
+
     //try
     {
