From db34edad5b1f2e95b5146bbc42c8f71bc5fe5563 Mon Sep 17 00:00:00 2001
From: blaakmeer <sdos@astron.nl>
Date: Thu, 3 Jun 2004 08:16:54 +0000
Subject: [PATCH] %[ER: 117]% RegisterAccess test implemented

---
 .gitattributes                                |   3 +
 MAC/APL/APLCommon/src/APLInterTaskPort.cc     |  62 +-
 MAC/APL/APLCommon/src/APLInterTaskPort.h      |  11 +-
 MAC/APL/Makefile.am                           |   4 +-
 MAC/APL/PAC/Makefile.am                       |   2 +-
 .../_VirtualTelescope/src/AVTLogicalDevice.cc |  54 +-
 .../_VirtualTelescope/src/AVTLogicalDevice.h  |   2 +-
 .../src/AVTLogicalDeviceScheduler.cc          |  67 +-
 .../src/AVTLogicalDeviceScheduler.h           |   2 +
 .../src/AVTStationBeamformer.cc               |  63 +-
 .../PAC/_VirtualTelescope/src/AVTUtilities.cc |   8 +-
 .../PAC/_VirtualTelescope/src/AVTUtilities.h  |   2 +-
 .../src/AVTVirtualTelescope.cc                |  28 +-
 .../src/LogicalDevice_Protocol.prot           |  36 +-
 MAC/APL/PAC/_VirtualTelescope/src/Makefile.am |  16 +-
 .../PAC/_VirtualTelescope/test/AVTTestMain.cc |   2 +-
 .../PAC/_VirtualTelescope/test/AVTTestTask.cc | 103 +--
 .../PAC/_VirtualTelescope/test/AVTTestTask.h  |   2 +-
 .../PAC/_VirtualTelescope/test/Makefile.am    |  14 +-
 MAC/APL/PIC/Makefile.am                       |   3 +
 MAC/APL/PIC/_RegisterAccess/Makefile.am       |   3 +
 MAC/APL/PIC/_RegisterAccess/test/ARATest.cc   |  52 ++
 MAC/APL/PIC/_RegisterAccess/test/ARATest.h    |  66 ++
 .../PIC/_RegisterAccess/test/ARATestAnswer.cc |  45 ++
 .../PIC/_RegisterAccess/test/ARATestAnswer.h  |  45 ++
 .../PIC/_RegisterAccess/test/ARATestMain.cc   |  53 ++
 .../PIC/_RegisterAccess/test/ARATestTask.cc   | 686 ++++++++++++++++++
 .../PIC/_RegisterAccess/test/ARATestTask.h    |  83 +++
 MAC/APL/PIC/_RegisterAccess/test/Makefile.am  |  40 +
 .../_RegisterAccess/test/PropertyDefines.h    | 371 ++++++++++
 MAC/APL/configure.in                          |   5 +-
 31 files changed, 1668 insertions(+), 265 deletions(-)
 create mode 100644 MAC/APL/PIC/Makefile.am
 create mode 100644 MAC/APL/PIC/_RegisterAccess/Makefile.am
 create mode 100644 MAC/APL/PIC/_RegisterAccess/test/ARATest.cc
 create mode 100644 MAC/APL/PIC/_RegisterAccess/test/ARATest.h
 create mode 100644 MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.cc
 create mode 100644 MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.h
 create mode 100644 MAC/APL/PIC/_RegisterAccess/test/ARATestMain.cc
 create mode 100644 MAC/APL/PIC/_RegisterAccess/test/ARATestTask.cc
 create mode 100644 MAC/APL/PIC/_RegisterAccess/test/ARATestTask.h
 create mode 100644 MAC/APL/PIC/_RegisterAccess/test/Makefile.am
 create mode 100644 MAC/APL/PIC/_RegisterAccess/test/PropertyDefines.h

diff --git a/.gitattributes b/.gitattributes
index 49de4471fdb..cfcf0dae396 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -149,6 +149,9 @@ MAC/APL/PAC/_VirtualTelescope/test/Makefile.am -text svneol=native#application/o
 MAC/APL/PAC/_VirtualTelescope/test/README -text svneol=native#application/octet-stream
 MAC/APL/PAC/_VirtualTelescope/test/avttest.ns.in -text svneol=native#application/octet-stream
 MAC/APL/PAC/_VirtualTelescope/test/avttest.top.in -text svneol=native#application/octet-stream
+MAC/APL/PIC/Makefile.am -text svneol=native#application/octet-stream
+MAC/APL/PIC/_RegisterAccess/Makefile.am -text svneol=native#application/octet-stream
+MAC/APL/PIC/_RegisterAccess/test/Makefile.am -text svneol=native#application/octet-stream
 MAC/APL/bootstrap -text svneol=native#application/octet-stream
 MAC/APL/configure.in -text svneol=native#application/octet-stream
 MAC/Config/Apc/ApcADCStatisticsType -text svneol=native#application/octet-stream
diff --git a/MAC/APL/APLCommon/src/APLInterTaskPort.cc b/MAC/APL/APLCommon/src/APLInterTaskPort.cc
index f989d40a9c3..f0afbd815b8 100644
--- a/MAC/APL/APLCommon/src/APLInterTaskPort.cc
+++ b/MAC/APL/APLCommon/src/APLInterTaskPort.cc
@@ -67,7 +67,7 @@ int APLInterTaskPort::close()
 /**
  * ::send
  */
-ssize_t APLInterTaskPort::send(const GCFEvent& e, void* /*buf*/, size_t /*count*/)
+ssize_t APLInterTaskPort::send(GCFEvent& e)
 {
   ssize_t returnValue(0);
   
@@ -113,58 +113,10 @@ ssize_t APLInterTaskPort::send(const GCFEvent& e, void* /*buf*/, size_t /*count*
   return returnValue;
 }
 
-/**
- * ::sendv
- */
-ssize_t APLInterTaskPort::sendv(const GCFEvent& e, const iovec /*buffers*/[], int /*n*/)
-{
-  ssize_t returnValue(0);
-  
-  if (SPP == getType())
-  {
-    if (F_EVT_INOUT(e) & F_IN)
-    {
-      LOFAR_LOG_ERROR(APL_LOGGER_ROOT, (
-          "Trying to send IN event on SPP "
-          "port '%s'; discarding this event.",
-         _name.c_str()));
-      returnValue=-1;
-    }
-  }
-  else if (SAP == getType())
-  {
-    if (F_EVT_INOUT(e) & F_OUT)
-    {
-      LOFAR_LOG_ERROR(APL_LOGGER_ROOT, (
-          "Trying to send OUT event on SAP "
-          "port '%s'; discarding this event.",
-         _name.c_str()));
-      returnValue=-1;
-    }
-  }
-  else if (MSPP == _type)
-  {
-     LOFAR_LOG_ERROR(APL_LOGGER_ROOT, (
-        "Trying to send event by means of the portprovider: %s (MSPP). "
-        "Not supported yet",
-         _name.c_str()));
-      returnValue=-1;
-  }
-
-  if(returnValue!=-1)
-  {
-    // send event using a timer event to exit the sending tasks event loop
-    m_toClientBuffer.reset(new unsigned char[e.length]); // reset deletes current contents, if any
-    memcpy(m_toClientBuffer.get(),(void*)&e,e.length);
-    returnValue=setTimer(0, 0, 0, 0, (void*)m_toClientBuffer.get());
-  }
-  return returnValue;
-}
-
 /**
  * ::sendBack
  */
-ssize_t APLInterTaskPort::sendBack(const GCFEvent& e, void* /*buf*/, size_t /*count*/)
+ssize_t APLInterTaskPort::sendBack(const GCFEvent& e)
 {
   ssize_t returnValue(0);
   
@@ -184,18 +136,10 @@ ssize_t APLInterTaskPort::recv(void* /*buf*/, size_t /*count*/)
   return 0;
 }
 
-/**
- * ::recvv
- */
-ssize_t APLInterTaskPort::recvv(iovec /*buffers*/[], int /*n*/)
-{
-  return 0;
-}
-
 GCFEvent::TResult APLInterTaskPort::dispatch(GCFEvent& event)
 {
   GCFEvent::TResult status = GCFEvent::NOT_HANDLED;
-  if(event.signal == F_TIMER_SIG)
+  if(event.signal == F_TIMER)
   {
     GCFTimerEvent& timerEvent=static_cast<GCFTimerEvent&>(event);
     if(m_toClientBuffer.get()!=0)
diff --git a/MAC/APL/APLCommon/src/APLInterTaskPort.h b/MAC/APL/APLCommon/src/APLInterTaskPort.h
index 1a56deeae40..35286d3e4fb 100644
--- a/MAC/APL/APLCommon/src/APLInterTaskPort.h
+++ b/MAC/APL/APLCommon/src/APLInterTaskPort.h
@@ -63,18 +63,11 @@ class APLInterTaskPort : public GCFRawPort
     /**
     * send/recv functions
     */
-    virtual ssize_t send (const GCFEvent& event, 
-                          void* buf = 0, 
-                          size_t count = 0);                          
-    virtual ssize_t sendv (const GCFEvent& event,
-                           const iovec buffers[], 
-                           int n);
+    virtual ssize_t send (GCFEvent& event);                          
     virtual ssize_t recv (void* buf, 
                           size_t count);
-    virtual ssize_t recvv (iovec buffers[], 
-                           int n);
                            
-    virtual ssize_t sendBack(const GCFEvent& e, void* buf=0, size_t count=0);
+    virtual ssize_t sendBack(const GCFEvent& e);
 
   protected:
     virtual GCFEvent::TResult   dispatch (GCFEvent& event);
diff --git a/MAC/APL/Makefile.am b/MAC/APL/Makefile.am
index 0a489cba80b..40352dcb568 100644
--- a/MAC/APL/Makefile.am
+++ b/MAC/APL/Makefile.am
@@ -1,5 +1,5 @@
 SUBDIRS= \
   APLCommon \
-  PAC
-
+  PIC
+  
 include $(lofar_sharedir)/Makefile.common
diff --git a/MAC/APL/PAC/Makefile.am b/MAC/APL/PAC/Makefile.am
index 13442d68742..e8bf7736b77 100644
--- a/MAC/APL/PAC/Makefile.am
+++ b/MAC/APL/PAC/Makefile.am
@@ -1,5 +1,5 @@
 SUBDIRS= \
-  BeamServer \
+#  BeamServer \
   VirtualTelescope
 
 include $(lofar_sharedir)/Makefile.common
diff --git a/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDevice.cc b/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDevice.cc
index 37b41dfd7fa..6fb504b5b55 100644
--- a/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDevice.cc
+++ b/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDevice.cc
@@ -105,23 +105,23 @@ GCFEvent::TResult AVTLogicalDevice::initial_state(GCFEvent& event, GCFPortInterf
   
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
     {
       GCFPVString status("Initial");
       m_properties.setValue("status",status);
       break;
     }
   
-    case F_CONNECTED_SIG:
+    case F_CONNECTED:
       break;
 
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
       break;
 
-    case F_TIMER_SIG:
+    case F_TIMER:
       break;
 
     default:
@@ -143,10 +143,10 @@ GCFEvent::TResult AVTLogicalDevice::idle_state(GCFEvent& event, GCFPortInterface
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
       
-    case F_ENTRY_SIG:
+    case F_ENTRY:
     {
       // open the server port to allow clients to connect
       m_logicalDeviceServerPort.open();
@@ -161,7 +161,7 @@ GCFEvent::TResult AVTLogicalDevice::idle_state(GCFEvent& event, GCFPortInterface
       break;
     }
   
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
       _disconnectedHandler(port);
       break;
     
@@ -186,17 +186,17 @@ GCFEvent::TResult AVTLogicalDevice::claiming_state(GCFEvent& event, GCFPortInter
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
       
-    case F_ENTRY_SIG:
+    case F_ENTRY:
     {
       GCFPVString status("Claiming");
       m_properties.setValue("status",status);
       break;
     }
   
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
       _disconnectedHandler(port);
       break;
       
@@ -229,10 +229,10 @@ GCFEvent::TResult AVTLogicalDevice::claimed_state(GCFEvent& event, GCFPortInterf
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
       
-    case F_ENTRY_SIG:
+    case F_ENTRY:
     {
       GCFPVString status("Claimed");
       m_properties.setValue("status",status);
@@ -246,7 +246,7 @@ GCFEvent::TResult AVTLogicalDevice::claimed_state(GCFEvent& event, GCFPortInterf
       break;
     }
     
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
       _disconnectedHandler(port);
       break;
    
@@ -285,20 +285,20 @@ GCFEvent::TResult AVTLogicalDevice::preparing_state(GCFEvent& event, GCFPortInte
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
       
-    case F_ENTRY_SIG:
+    case F_ENTRY:
     {
       GCFPVString status("Preparing");
       m_properties.setValue("status",status);
       break;
     }
     
-    case F_EXIT_SIG:
+    case F_EXIT:
       break;
       
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
       _disconnectedHandler(port);
       break;
       
@@ -343,10 +343,10 @@ GCFEvent::TResult AVTLogicalDevice::suspended_state(GCFEvent& event, GCFPortInte
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
       
-    case F_ENTRY_SIG:
+    case F_ENTRY:
     {
       GCFPVString status("Suspended");
       m_properties.setValue("status",status);
@@ -357,7 +357,7 @@ GCFEvent::TResult AVTLogicalDevice::suspended_state(GCFEvent& event, GCFPortInte
       break;
     }
   
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
       _disconnectedHandler(port);
       break;
     
@@ -400,9 +400,9 @@ GCFEvent::TResult AVTLogicalDevice::active_state(GCFEvent& event, GCFPortInterfa
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       
-    case F_ENTRY_SIG:
+    case F_ENTRY:
     {
       GCFPVString status("Active");
       m_properties.setValue("status",status);
@@ -416,7 +416,7 @@ GCFEvent::TResult AVTLogicalDevice::active_state(GCFEvent& event, GCFPortInterfa
       break;
     }
   
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
       _disconnectedHandler(port);
       break;
     
@@ -446,17 +446,17 @@ GCFEvent::TResult AVTLogicalDevice::releasing_state(GCFEvent& event, GCFPortInte
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
       
-    case F_ENTRY_SIG:
+    case F_ENTRY:
     {
       GCFPVString status("Releasing");
       m_properties.setValue("status",status);
       break;
     }
   
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
       _disconnectedHandler(port);
       break;
 
diff --git a/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDevice.h b/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDevice.h
index c0f544ffcbc..3837f378599 100644
--- a/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDevice.h
+++ b/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDevice.h
@@ -137,7 +137,7 @@ class AVTLogicalDevice : public GCFTask,
 /*******************************************
  * 
  * Remove the following abstract methods. Combine their implementations with the
- * F_INIT_SIG handling in their concrete_...ing_state methods that are entered
+ * F_INIT handling in their concrete_...ing_state methods that are entered
  * just before calling them
  * 
  * ********************************************/
diff --git a/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDeviceScheduler.cc b/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDeviceScheduler.cc
index cfd35b89060..3b3126e3716 100644
--- a/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDeviceScheduler.cc
+++ b/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDeviceScheduler.cc
@@ -98,14 +98,14 @@ GCFEvent::TResult AVTLogicalDeviceScheduler::initial_state(GCFEvent& event, GCFP
   
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
 //      m_beamServer.open();
       break;
 
-    case F_CONNECTED_SIG:
+    case F_CONNECTED:
       break;
     
     case LOGICALDEVICE_INITIALIZED:
@@ -130,10 +130,11 @@ GCFEvent::TResult AVTLogicalDeviceScheduler::initial_state(GCFEvent& event, GCFP
       if(findClientPort(port,clientName))
       {
         // send prepare message:
-        char prepareParameters[700];
-        AVTUtilities::encodeParameters(m_logicalDeviceMap[clientName].parameters,prepareParameters,700);
+        string prepareParameters;
+        AVTUtilities::encodeParameters(m_logicalDeviceMap[clientName].parameters,prepareParameters);
         
-        LOGICALDEVICEPrepareEvent prepareEvent(prepareParameters);
+        LOGICALDEVICEPrepareEvent prepareEvent;
+        prepareEvent.parameters=prepareParameters;
         // send prepare to Virtual Telescope. VT will send prepare to SBF and SRG
         port.send(prepareEvent);
 
@@ -201,7 +202,7 @@ GCFEvent::TResult AVTLogicalDeviceScheduler::initial_state(GCFEvent& event, GCFP
       break;
     }
         
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
     {
 /*      if(&port==&m_beamServer)
       {
@@ -219,7 +220,7 @@ GCFEvent::TResult AVTLogicalDeviceScheduler::initial_state(GCFEvent& event, GCFP
       break;
     }
     
-    case F_TIMER_SIG:
+    case F_TIMER:
     {
 /*
       if(&port==&m_beamServer)
@@ -252,20 +253,20 @@ void AVTLogicalDeviceScheduler::handlePropertySetAnswer(GCFEvent& answer)
 
   switch(answer.signal)
   {
-    case F_MYPLOADED_SIG:
+    case F_MYPLOADED:
     {
       // property set loaded, now load apc
       m_apcLDS.load(false);
       break;
     }
     
-    case F_APCLOADED_SIG:
+    case F_APCLOADED:
     {
       m_initialized=true;
       break;
     }
     
-    case F_VCHANGEMSG_SIG:
+    case F_VCHANGEMSG:
     {
       // check which property changed
       GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&answer);
@@ -305,10 +306,11 @@ void AVTLogicalDeviceScheduler::handlePropertySetAnswer(GCFEvent& answer)
               ldIt->second.parameters.push_back(parameters[9]); // angle2
 
               // send prepare message:
-              char prepareParameters[700];
-              AVTUtilities::encodeParameters(ldIt->second.parameters,prepareParameters,700);
+              string prepareParameters;
+              AVTUtilities::encodeParameters(ldIt->second.parameters,prepareParameters);
               
-              LOGICALDEVICEPrepareEvent prepareEvent(prepareParameters);
+              LOGICALDEVICEPrepareEvent prepareEvent;
+              prepareEvent.parameters=prepareParameters;
               // send prepare to Virtual Telescope. VT will send prepare to SBF and SRG
               ldIt->second.clientPort->send(prepareEvent);
             }
@@ -384,13 +386,7 @@ void AVTLogicalDeviceScheduler::handlePropertySetAnswer(GCFEvent& answer)
         if(frequency!=m_WGfrequency)
         {
           m_WGfrequency = frequency;
-          // send new settings
-          ABSWgsettingsEvent wgSettingsEvent(m_WGfrequency,static_cast<unsigned char>(m_WGamplitude),static_cast<unsigned char>(m_WGsamplePeriod));
-//          m_beamServer.send(wgSettingsEvent);
-          if(m_pBeamServer!=0)
-          {
-            m_pBeamServer->send(wgSettingsEvent);
-          }
+          sendWGsettings();
         }
       }      
       else if ((pPropAnswer->pValue->getType() == GCFPValue::LPT_UNSIGNED) &&
@@ -401,13 +397,7 @@ void AVTLogicalDeviceScheduler::handlePropertySetAnswer(GCFEvent& answer)
         if(amplitude!=m_WGamplitude)
         {
           m_WGamplitude = amplitude;
-          // send new settings
-          ABSWgsettingsEvent wgSettingsEvent(m_WGfrequency,static_cast<unsigned char>(m_WGamplitude),static_cast<unsigned char>(m_WGsamplePeriod));
-//          m_beamServer.send(wgSettingsEvent);
-          if(m_pBeamServer!=0)
-          {
-            m_pBeamServer->send(wgSettingsEvent);
-          }
+          sendWGsettings();
         }
       }      
       else if ((pPropAnswer->pValue->getType() == GCFPValue::LPT_UNSIGNED) &&
@@ -418,13 +408,7 @@ void AVTLogicalDeviceScheduler::handlePropertySetAnswer(GCFEvent& answer)
         if(samplePeriod!=m_WGsamplePeriod)
         {
           m_WGsamplePeriod = samplePeriod;
-          // send new settings
-          ABSWgsettingsEvent wgSettingsEvent(m_WGfrequency,static_cast<unsigned char>(m_WGamplitude),static_cast<unsigned char>(m_WGsamplePeriod));
-//          m_beamServer.send(wgSettingsEvent);
-          if(m_pBeamServer!=0)
-          {
-            m_pBeamServer->send(wgSettingsEvent);
-          }
+          sendWGsettings();
         }
       }      
       break;
@@ -434,3 +418,16 @@ void AVTLogicalDeviceScheduler::handlePropertySetAnswer(GCFEvent& answer)
   }  
 }
 
+void AVTLogicalDeviceScheduler::sendWGsettings()
+{
+  ABSWgsettingsEvent wgSettingsEvent;
+  wgSettingsEvent.frequency = m_WGfrequency;
+  wgSettingsEvent.amplitude = static_cast<unsigned char>(m_WGamplitude);
+  wgSettingsEvent.sample_period = static_cast<unsigned char>(m_WGsamplePeriod);
+  
+// m_beamServer.send(wgSettingsEvent);
+  if(m_pBeamServer!=0)
+  {
+    m_pBeamServer->send(wgSettingsEvent);
+  }
+}
diff --git a/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDeviceScheduler.h b/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDeviceScheduler.h
index 251e6926a8a..9b760388d3f 100644
--- a/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDeviceScheduler.h
+++ b/MAC/APL/PAC/_VirtualTelescope/src/AVTLogicalDeviceScheduler.h
@@ -78,6 +78,8 @@ class AVTLogicalDeviceScheduler : public GCFTask,
     AVTLogicalDeviceScheduler& operator=(const AVTLogicalDeviceScheduler&);
 
   private:
+    void sendWGsettings();
+
     static string m_schedulerTaskName;
     
 
diff --git a/MAC/APL/PAC/_VirtualTelescope/src/AVTStationBeamformer.cc b/MAC/APL/PAC/_VirtualTelescope/src/AVTStationBeamformer.cc
index 0ca1c926fb9..917c4bda2bc 100644
--- a/MAC/APL/PAC/_VirtualTelescope/src/AVTStationBeamformer.cc
+++ b/MAC/APL/PAC/_VirtualTelescope/src/AVTStationBeamformer.cc
@@ -110,15 +110,15 @@ GCFEvent::TResult AVTStationBeamformer::concrete_initial_state(GCFEvent& event,
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
       // open all ports
       m_beamServer.open();
       break;
 
-    case F_CONNECTED_SIG:
+    case F_CONNECTED:
     {
       // go to operational only if there is a connection with the beam server.
       if(_isBeamServerPort(port))
@@ -136,14 +136,14 @@ GCFEvent::TResult AVTStationBeamformer::concrete_initial_state(GCFEvent& event,
       break;
     }
 
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
       if(_isBeamServerPort(port))
       {
         m_beamServer.setTimer(2.0); // try again
       }
       break;
 
-    case F_TIMER_SIG:
+    case F_TIMER:
       if(_isBeamServerPort(port))
       {
         if(m_beamServerConnected)
@@ -211,7 +211,7 @@ GCFEvent::TResult AVTStationBeamformer::concrete_preparing_state(GCFEvent& event
       if(_isBeamServerPort(port))
       {
         // check the beam ID and status of the ACK message
-        ABSBeamalloc_AckEvent& ackEvent=static_cast<ABSBeamalloc_AckEvent&>(event);
+        ABSBeamallocAckEvent ackEvent(event);
         if(ackEvent.status==0)
         {
           m_beamID=ackEvent.handle;
@@ -227,7 +227,12 @@ GCFEvent::TResult AVTStationBeamformer::concrete_preparing_state(GCFEvent& event
 
           // point the new beam
           time_t time_arg(0);
-          ABSBeampointtoEvent beamPointToEvent(m_beamID,time_arg,m_directionType,m_directionAngle1,m_directionAngle2);
+          ABSBeampointtoEvent beamPointToEvent;
+          beamPointToEvent.handle = m_beamID;
+          beamPointToEvent.time   = time_arg;
+          beamPointToEvent.type   = m_directionType;
+          beamPointToEvent.angle1 = m_directionAngle1;
+          beamPointToEvent.angle2 = m_directionAngle2;
           m_beamServer.send(beamPointToEvent);
         }
         else
@@ -257,7 +262,7 @@ GCFEvent::TResult AVTStationBeamformer::concrete_releasing_state(GCFEvent& event
     case ABS_BEAMFREE_ACK:
     {
       // check the beam ID and status of the ACK message
-      ABSBeamfree_AckEvent& ackEvent=static_cast<ABSBeamfree_AckEvent&>(event);
+      ABSBeamfreeAckEvent ackEvent(event);
       if(ackEvent.handle==m_beamID)
       {
         stateFinished=true;
@@ -278,14 +283,14 @@ void AVTStationBeamformer::handlePropertySetAnswer(GCFEvent& answer)
 {
   switch(answer.signal)
   {
-    case F_MYPLOADED_SIG:
+    case F_MYPLOADED:
     {
       // property set loaded, now load apc
       m_APC.load(false);
       break;
     }
     
-    case F_VCHANGEMSG_SIG:
+    case F_VCHANGEMSG:
     {
       // check which property changed
       GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&answer);
@@ -305,12 +310,13 @@ void AVTStationBeamformer::handlePropertySetAnswer(GCFEvent& answer)
           if(parameters.size()==7)
           {
             // send prepare message:
-            char prepareParameters[700];
-            AVTUtilities::encodeParameters(parameters,prepareParameters,700);
+            string prepareParameters;
+            AVTUtilities::encodeParameters(parameters,prepareParameters);
             
             // send prepare to myself using a dummyport
             GCFDummyPort dummyPort(this,string("BF_command_dummy"),LOGICALDEVICE_PROTOCOL);
-            LOGICALDEVICEPrepareEvent prepareEvent(prepareParameters);
+            LOGICALDEVICEPrepareEvent prepareEvent;
+            prepareEvent.parameters = prepareParameters;
             dispatch(prepareEvent,dummyPort); // dummyport
           }
         }
@@ -342,7 +348,12 @@ void AVTStationBeamformer::handlePropertySetAnswer(GCFEvent& answer)
           m_directionType=newType;
           // send new direction
           time_t time_arg(0);
-          ABSBeampointtoEvent beamPointToEvent(m_beamID,time_arg,m_directionType,m_directionAngle1,m_directionAngle2);
+          ABSBeampointtoEvent beamPointToEvent;
+          beamPointToEvent.handle = m_beamID;
+          beamPointToEvent.time   = time_arg;
+          beamPointToEvent.type   = m_directionType;
+          beamPointToEvent.angle1 = m_directionAngle1;
+          beamPointToEvent.angle2 = m_directionAngle2;
           m_beamServer.send(beamPointToEvent);
         }
       }      
@@ -356,7 +367,12 @@ void AVTStationBeamformer::handlePropertySetAnswer(GCFEvent& answer)
           m_directionAngle1 = angle1;
           // send new direction
           time_t time_arg(0);
-          ABSBeampointtoEvent beamPointToEvent(m_beamID,time_arg,m_directionType,m_directionAngle1,m_directionAngle2);
+          ABSBeampointtoEvent beamPointToEvent;
+          beamPointToEvent.handle = m_beamID;
+          beamPointToEvent.time   = time_arg;
+          beamPointToEvent.type   = m_directionType;
+          beamPointToEvent.angle1 = m_directionAngle1;
+          beamPointToEvent.angle2 = m_directionAngle2;
           m_beamServer.send(beamPointToEvent);
         }
       }      
@@ -370,7 +386,12 @@ void AVTStationBeamformer::handlePropertySetAnswer(GCFEvent& answer)
           m_directionAngle2 = angle2;
           // send new direction
           time_t time_arg(0);
-          ABSBeampointtoEvent beamPointToEvent(m_beamID,time_arg,m_directionType,m_directionAngle1,m_directionAngle2);
+          ABSBeampointtoEvent beamPointToEvent;
+          beamPointToEvent.handle = m_beamID;
+          beamPointToEvent.time   = time_arg;
+          beamPointToEvent.type   = m_directionType;
+          beamPointToEvent.angle1 = m_directionAngle1;
+          beamPointToEvent.angle2 = m_directionAngle2;
           m_beamServer.send(beamPointToEvent);
         }
       }      
@@ -386,7 +407,7 @@ void AVTStationBeamformer::handleAPCAnswer(GCFEvent& answer)
 {
   switch(answer.signal)
   {
-    case F_APCLOADED_SIG:
+    case F_APCLOADED:
     {
       // used during startup to check if all necessary APC's have been loaded.
       // not used when loading the statistics APC's
@@ -467,7 +488,10 @@ void AVTStationBeamformer::concretePrepare(GCFPortInterface& /*port*/,string& pa
   
   
   LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("AVTStationBeamformer(%s)::allocate %d subbands: %s",getName().c_str(),n_subbands,tempLogStr));
-  ABSBeamallocEvent beamAllocEvent(spectral_window,n_subbands,subbandsArray);
+  ABSBeamallocEvent beamAllocEvent;
+  beamAllocEvent.spectral_window = spectral_window;
+  beamAllocEvent.n_subbands      = n_subbands;
+//  beamAllocEvent.subbands        = subbandsArray;
   m_beamServer.send(beamAllocEvent);
 }
 
@@ -498,7 +522,8 @@ void AVTStationBeamformer::concreteRelease(GCFPortInterface& /*port*/)
   // release my own resources
   
   // send release message to BeamFormer
-  ABSBeamfreeEvent beamFreeEvent(m_beamID);
+  ABSBeamfreeEvent beamFreeEvent;
+  beamFreeEvent.handle=m_beamID;
   m_beamServer.send(beamFreeEvent);
   
   // wait for the beamfree_ack event in the releasing state
diff --git a/MAC/APL/PAC/_VirtualTelescope/src/AVTUtilities.cc b/MAC/APL/PAC/_VirtualTelescope/src/AVTUtilities.cc
index 2e7b27c822a..ac25585773b 100644
--- a/MAC/APL/PAC/_VirtualTelescope/src/AVTUtilities.cc
+++ b/MAC/APL/PAC/_VirtualTelescope/src/AVTUtilities.cc
@@ -87,17 +87,17 @@ void AVTUtilities::decodeSubbandsParameter(const string& subbandsString, vector<
   } while(delim<subbandsStringLen);
 }
 
-void AVTUtilities::encodeParameters(const vector<string>& parameters,char *encodedParameters,unsigned int maxSize)
+void AVTUtilities::encodeParameters(const vector<string>& parameters,string& encodedParameters)
 {
-  memset(encodedParameters,0,maxSize);
+  encodedParameters="";
   vector<string>::const_iterator parameterIt=parameters.begin();
   while(parameterIt!=parameters.end())
   {
     if(parameterIt!=parameters.begin())
     {
-      strncat(encodedParameters,",",maxSize-strlen(encodedParameters));
+      encodedParameters += ",";
     }
-    strncat(encodedParameters,parameterIt->c_str(),maxSize-strlen(encodedParameters));
+    encodedParameters += (*parameterIt);
     
     ++parameterIt;
   }
diff --git a/MAC/APL/PAC/_VirtualTelescope/src/AVTUtilities.h b/MAC/APL/PAC/_VirtualTelescope/src/AVTUtilities.h
index bfab1737542..34bbd8fd94c 100644
--- a/MAC/APL/PAC/_VirtualTelescope/src/AVTUtilities.h
+++ b/MAC/APL/PAC/_VirtualTelescope/src/AVTUtilities.h
@@ -44,7 +44,7 @@ class AVTUtilities
     static void decodeCommand(const string& commandString, string& command, vector<string>& parameters);
     static void decodeParameters(const string& parametersString, vector<string>& parameters); 
     static void decodeSubbandsParameter(const string& subbandsString, vector<int>& subbands);
-    static void encodeParameters(const vector<string>& parameters,char *encodedParameters,unsigned int maxSize);
+    static void encodeParameters(const vector<string>& parameters,string& parameters);
     
   protected:
     // protected copy constructor
diff --git a/MAC/APL/PAC/_VirtualTelescope/src/AVTVirtualTelescope.cc b/MAC/APL/PAC/_VirtualTelescope/src/AVTVirtualTelescope.cc
index a7b2056ba63..0971b657166 100644
--- a/MAC/APL/PAC/_VirtualTelescope/src/AVTVirtualTelescope.cc
+++ b/MAC/APL/PAC/_VirtualTelescope/src/AVTVirtualTelescope.cc
@@ -93,16 +93,16 @@ GCFEvent::TResult AVTVirtualTelescope::concrete_initial_state(GCFEvent& event, G
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       m_stationBeamformer.start();
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
       // open all ports
       m_beamFormerClient.open();
       break;
 
-    case F_CONNECTED_SIG:
+    case F_CONNECTED:
     {
       // go to operational only if there is a connection with the beam former.
       if(_isBeamFormerClient(port))
@@ -120,14 +120,14 @@ GCFEvent::TResult AVTVirtualTelescope::concrete_initial_state(GCFEvent& event, G
       break;
     }
 
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
       if(_isBeamFormerClient(port))
       {
         m_beamFormerClient.setTimer(2.0); // try again
       }
       break;
 
-    case F_TIMER_SIG:
+    case F_TIMER:
       if(_isBeamFormerClient(port))
       {
         if(m_beamFormerConnected)
@@ -235,14 +235,14 @@ void AVTVirtualTelescope::handlePropertySetAnswer(GCFEvent& answer)
 {
   switch(answer.signal)
   {
-    case F_MYPLOADED_SIG:
+    case F_MYPLOADED:
     {
       // property set loaded, now load apc
       m_APC.load(false);
       break;
     }
     
-    case F_VCHANGEMSG_SIG:
+    case F_VCHANGEMSG:
     {
       // check which property changed
       GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&answer);
@@ -262,12 +262,13 @@ void AVTVirtualTelescope::handlePropertySetAnswer(GCFEvent& answer)
           if(parameters.size()==7)
           {
             // send prepare message:
-            char prepareParameters[700];
-            AVTUtilities::encodeParameters(parameters,prepareParameters,700);
+            string prepareParameters;
+            AVTUtilities::encodeParameters(parameters,prepareParameters);
             
             // send message to myself using a dummyport. VT will send it to SBF and SRG
             GCFDummyPort dummyPort(this,string("VT_command_dummy"),LOGICALDEVICE_PROTOCOL);
-            LOGICALDEVICEPrepareEvent prepareEvent(prepareParameters);
+            LOGICALDEVICEPrepareEvent prepareEvent;
+            prepareEvent.parameters = prepareParameters;
             dispatch(prepareEvent,dummyPort);
           }
         }
@@ -300,7 +301,7 @@ void AVTVirtualTelescope::handleAPCAnswer(GCFEvent& answer)
 {
   switch(answer.signal)
   {
-    case F_APCLOADED_SIG:
+    case F_APCLOADED:
     {
       apcLoaded();
       break;
@@ -334,9 +335,8 @@ void AVTVirtualTelescope::concretePrepare(GCFPortInterface& /*port*/,string& par
   
   // send prepare message to BeamFormer
   // all parameters are forwarded to the beamformer
-  char prepareParameters[700];
-  strncpy(prepareParameters,parameters.c_str(),700);
-  LOGICALDEVICEPrepareEvent prepareEvent(prepareParameters);
+  LOGICALDEVICEPrepareEvent prepareEvent;
+  prepareEvent.parameters = parameters;
   m_beamFormerClient.send(prepareEvent);
 }
 
diff --git a/MAC/APL/PAC/_VirtualTelescope/src/LogicalDevice_Protocol.prot b/MAC/APL/PAC/_VirtualTelescope/src/LogicalDevice_Protocol.prot
index 157083b8a18..b5cc9800341 100644
--- a/MAC/APL/PAC/_VirtualTelescope/src/LogicalDevice_Protocol.prot
+++ b/MAC/APL/PAC/_VirtualTelescope/src/LogicalDevice_Protocol.prot
@@ -23,15 +23,15 @@ autogen definitions protocol;
 
 description = "Protocol for LogicalDevice servers";
 prefix = "LOGICALDEVICE"; // for the signal names
+id = "(F_APL_PROTOCOL+1)";
 
 // specify extra include files
 // e.g.
 include = '<sys/time.h>';
 
 prelude = << PRELUDE_END
-enum {
-	LOGICALDEVICE_PROTOCOL = (F_APL_PROTOCOL+1)
-};
+// define namespace and enumerations here
+
 PRELUDE_END;
 
 //
@@ -45,8 +45,7 @@ event = {
 	dir = IN;
 	param = {
 		name = "name";
-		type = "char";
-		dim = "50";
+		type = "string";
 	};
 };
 
@@ -70,8 +69,7 @@ event = {
 	dir = IN;
 	param = {
 		name = "parameters";
-		type = "char";
-		dim = "700";
+		type = "string";
 	};
 };
 
@@ -83,14 +81,6 @@ event = {
 event = {
 	signal = RESUME;
 	dir = IN;
-//	param = {
-//		name = "seqnr";
-//		type = "unsigned int";
-//	};
-//	param = {
-//		name = "ping_time";
-//		type = "timeval";
-//	};
 };
 
 event = {
@@ -101,14 +91,6 @@ event = {
 event = {
 	signal = SUSPEND;
 	dir = IN;
-//	param = {
-//		name = "seqnr";
-//		type = "unsigned int";
-//	};
-//	param = {
-//		name = "ping_time";
-//		type = "timeval";
-//	};
 };
 
 event = {
@@ -119,14 +101,6 @@ event = {
 event = {
 	signal = RELEASE;
 	dir = IN;
-//	param = {
-//		name = "seqnr";
-//		type = "unsigned int";
-//	};
-//	param = {
-//		name = "ping_time";
-//		type = "timeval";
-//	};
 };
 
 event = {
diff --git a/MAC/APL/PAC/_VirtualTelescope/src/Makefile.am b/MAC/APL/PAC/_VirtualTelescope/src/Makefile.am
index 47ad7c48d54..cc8f0337111 100644
--- a/MAC/APL/PAC/_VirtualTelescope/src/Makefile.am
+++ b/MAC/APL/PAC/_VirtualTelescope/src/Makefile.am
@@ -7,7 +7,9 @@ SUFFIXES = .ph
 
 AVTLogicalDeviceServer_CPPFLAGS= \
 	-I$(top_srcdir)/APLCommon/src \
-	-I$(top_srcdir)/PAC/BeamServer/src
+	-I$(top_srcdir)/PAC/BeamServer/src \
+	-fmessage-length=0 \
+	-fdiagnostics-show-location=once
 
 AVTLogicalDeviceServer_SOURCES 		= \
 	AVTUtilities.cc \
@@ -17,7 +19,9 @@ AVTLogicalDeviceServer_SOURCES 		= \
 	AVTPropertySetAnswer.cc \
 	AVTStationBeamformer.cc \
 	AVTVirtualTelescope.cc \
-	AVTLogicalDeviceServerMain.cc
+	AVTLogicalDeviceServerMain.cc \
+	LogicalDevice_Protocol.cc \
+	ABS_Protocol.cc
 	
 AVTLogicalDeviceServer_LDADD		= \
 	$(top_builddir)/APLCommon/src/libaplcommon.la
@@ -25,13 +29,13 @@ AVTLogicalDeviceServer_DEPENDENCIES	= \
 	$(top_builddir)/APLCommon/src/libaplcommon.la
 
 BUILT_SOURCES = \
-  $(top_builddir)/PAC/BeamServer/src/ABS_Protocol.ph \
-  LogicalDevice_Protocol.ph \
+    $(top_builddir)/PAC/BeamServer/src/ABS_Protocol.ph \
+    LogicalDevice_Protocol.ph \
 	log4cplus.properties	
 
 EXTRA_DIST = \
-  $(top_builddir)/PAC/BeamServer/src/ABS_Protocol.ph \
-  LogicalDevice_Protocol.ph \
+    $(top_builddir)/PAC/BeamServer/src/ABS_Protocol.ph \
+    LogicalDevice_Protocol.ph \
 	log4cplus.properties
 	
 %.properties: $(MAC_CONFIG)/%.properties
diff --git a/MAC/APL/PAC/_VirtualTelescope/test/AVTTestMain.cc b/MAC/APL/PAC/_VirtualTelescope/test/AVTTestMain.cc
index ce70a2161a0..f61936611ff 100644
--- a/MAC/APL/PAC/_VirtualTelescope/test/AVTTestMain.cc
+++ b/MAC/APL/PAC/_VirtualTelescope/test/AVTTestMain.cc
@@ -41,7 +41,7 @@ int main(int argc, char* argv[])
       AVTTestTask::m_sBeamServerOnly=cmdLine.HasSwitch("-b");
     }
     
-    Suite s("MAC.APL.PAC VirtualTelescope Test",&cout);
+    Suite s("MAC.APL.PAC VirtualTelescope Test",&std::cout);
   
     boost::shared_ptr<AVTTest> avtTest(new AVTTest);
     s.addTest(avtTest.get());
diff --git a/MAC/APL/PAC/_VirtualTelescope/test/AVTTestTask.cc b/MAC/APL/PAC/_VirtualTelescope/test/AVTTestTask.cc
index 8fcdd159e84..1d5e9e60914 100644
--- a/MAC/APL/PAC/_VirtualTelescope/test/AVTTestTask.cc
+++ b/MAC/APL/PAC/_VirtualTelescope/test/AVTTestTask.cc
@@ -41,7 +41,7 @@ const double pi(asin(1)*2.0);
 double generateWave(int subband,double angle1,double angle2)
 {
   const double amplitude(subband==10?2e4:2e1);
-  return (amplitude*( (1+cos(angle1*pi))^2) * (1+cos(angle2*pi))^2 );
+  return (amplitude * pow(1.0+cos(angle1*pi),2.0) * pow(1.0+cos(angle2*pi),2.0) );
 }
 
 string AVTTestTask::m_taskName("AVTTest");
@@ -69,7 +69,7 @@ AVTTestTask::AVTTestTask(AVTTest& tester) :
   m_WGSETTINGS_received(false),
   m_WGENABLE_received(false),
   m_WGDISABLE_received(false),
-  m_statisticsTimerID(-1),
+  m_statisticsTimerID(0xffffffff),
   m_beamAngle1(0.0),
   m_beamAngle2(0.0),
   m_seqnr(0)
@@ -100,15 +100,15 @@ GCFEvent::TResult AVTTestTask::initial(GCFEvent& event, GCFPortInterface& /*p*/)
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
       m_beamServerProperties.load();
       m_beamserver.open(); // start listening
       break;
     
-    case F_MYPLOADED_SIG:
+    case F_MYPLOADED:
       if(m_sBeamServerOnly)
       {
         TRAN(AVTTestTask::beamServer);
@@ -135,11 +135,11 @@ GCFEvent::TResult AVTTestTask::propertiesLoaded(GCFEvent& event, GCFPortInterfac
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
       
-    case F_TIMER_SIG: // intentional fall through
-    case F_ENTRY_SIG:
+    case F_TIMER: // intentional fall through
+    case F_ENTRY:
       if(GCF_PML_ERROR==m_propertyLDSstatus.subscribe())
       {
         LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("AVTTestTask(%s): unable to subscribe to LogicalDeviceProperties",getName().c_str()));
@@ -170,10 +170,10 @@ GCFEvent::TResult AVTTestTask::test1(GCFEvent& event, GCFPortInterface& /*p*/)
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
       // ignore during first increments
       m_tester._avttest(true);
       TRAN(AVTTestTask::test2);
@@ -202,10 +202,10 @@ GCFEvent::TResult AVTTestTask::test2(GCFEvent& event, GCFPortInterface& p)
     status = GCFEvent::HANDLED;
     switch (event.signal)
     {
-      case F_INIT_SIG:
+      case F_INIT:
         break;
 
-      case F_ENTRY_SIG:
+      case F_ENTRY:
       {
         // SCHEDULE <vt_name>,<bf_name>,<srg_name>,<starttime>,<stoptime>,
         //          <frequency>,<subbands>,<direction>
@@ -224,7 +224,7 @@ GCFEvent::TResult AVTTestTask::test2(GCFEvent& event, GCFPortInterface& p)
         break;
       }
       
-      case F_VCHANGEMSG_SIG:
+      case F_VCHANGEMSG:
       {
         GCFPropValueEvent* pResponse = static_cast<GCFPropValueEvent*>(&event);
         assert(pResponse);
@@ -248,7 +248,7 @@ GCFEvent::TResult AVTTestTask::test2(GCFEvent& event, GCFPortInterface& p)
         break;
       }
       
-      case F_DISCONNECTED_SIG:
+      case F_DISCONNECTED:
       {
         m_tester._avttest(false);
         TRAN(AVTTestTask::test4);
@@ -278,10 +278,10 @@ GCFEvent::TResult AVTTestTask::test3(GCFEvent& event, GCFPortInterface& p)
     status=GCFEvent::HANDLED;
     switch (event.signal)
     {
-      case F_INIT_SIG:
+      case F_INIT:
         break;
   
-      case F_ENTRY_SIG:
+      case F_ENTRY:
       {
         m_WGSETTINGS_received=false;
         GCFPVDouble frequency(1000000.0);
@@ -302,7 +302,7 @@ GCFEvent::TResult AVTTestTask::test3(GCFEvent& event, GCFPortInterface& p)
         break;
       }
 
-      case F_TIMER_SIG:
+      case F_TIMER:
       {
         if(m_WGSETTINGS_received==true)
         {
@@ -317,7 +317,7 @@ GCFEvent::TResult AVTTestTask::test3(GCFEvent& event, GCFPortInterface& p)
         break;
       }
       
-      case F_DISCONNECTED_SIG:
+      case F_DISCONNECTED:
       {
         m_tester._avttest(false);
         TRAN(AVTTestTask::test4);
@@ -343,10 +343,10 @@ GCFEvent::TResult AVTTestTask::test4(GCFEvent& event, GCFPortInterface& /*p*/)
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
     {
 //      GCFPVString command(string("0"));
 //      if (m_propertySBFsubbandSelection.setValue(command) != GCF_NO_ERROR)
@@ -357,7 +357,7 @@ GCFEvent::TResult AVTTestTask::test4(GCFEvent& event, GCFPortInterface& /*p*/)
       break;
     }
     
-    case F_VCHANGEMSG_SIG:
+    case F_VCHANGEMSG:
     {
       GCFPropValueEvent* pResponse = static_cast<GCFPropValueEvent*>(&event);
       assert(pResponse);
@@ -377,7 +377,7 @@ GCFEvent::TResult AVTTestTask::test4(GCFEvent& event, GCFPortInterface& /*p*/)
       break;
     }
 
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
     {
       m_tester._avttest(false);
       TRAN(AVTTestTask::test5);
@@ -403,15 +403,15 @@ GCFEvent::TResult AVTTestTask::test5(GCFEvent& event, GCFPortInterface& /*p*/)
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
       m_tester._avttest(true);
       TRAN(AVTTestTask::test6);
       break;
 
-      case F_DISCONNECTED_SIG:
+      case F_DISCONNECTED:
       {
         m_tester._avttest(false);
         TRAN(AVTTestTask::test6);
@@ -441,10 +441,10 @@ GCFEvent::TResult AVTTestTask::test6(GCFEvent& event, GCFPortInterface& p)
     status=GCFEvent::HANDLED;
     switch (event.signal)
     {
-      case F_INIT_SIG:
+      case F_INIT:
         break;
   
-      case F_ENTRY_SIG:
+      case F_ENTRY:
       {
         m_BEAMPOINTTO_received=false;
         GCFPVString directionType(string("AZEL"));
@@ -465,7 +465,7 @@ GCFEvent::TResult AVTTestTask::test6(GCFEvent& event, GCFPortInterface& p)
         break;
       }
 
-      case F_TIMER_SIG:
+      case F_TIMER:
       {
         if(m_BEAMPOINTTO_received==true)
         {
@@ -476,7 +476,7 @@ GCFEvent::TResult AVTTestTask::test6(GCFEvent& event, GCFPortInterface& p)
         break;
       }
       
-      case F_DISCONNECTED_SIG:
+      case F_DISCONNECTED:
       {
         m_tester._avttest(false);
         TRAN(AVTTestTask::test7);
@@ -502,15 +502,15 @@ GCFEvent::TResult AVTTestTask::test7(GCFEvent& event, GCFPortInterface& /*p*/)
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
       m_tester._avttest(true);
       TRAN(AVTTestTask::test8);
       break;
 
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
     {
       m_tester._avttest(false);
       TRAN(AVTTestTask::test8);
@@ -536,15 +536,15 @@ GCFEvent::TResult AVTTestTask::test8(GCFEvent& event, GCFPortInterface& /*p*/)
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
       m_tester._avttest(true);
       TRAN(AVTTestTask::test9);
       break;
 
-    case F_DISCONNECTED_SIG:
+    case F_DISCONNECTED:
     {
       m_tester._avttest(false);
       TRAN(AVTTestTask::test9);
@@ -574,10 +574,10 @@ GCFEvent::TResult AVTTestTask::test9(GCFEvent& event, GCFPortInterface& p)
     status = GCFEvent::HANDLED;
     switch (event.signal)
     {
-      case F_INIT_SIG:
+      case F_INIT:
         break;
   
-      case F_ENTRY_SIG:
+      case F_ENTRY:
       {
         string cmd("RELEASE ");
         string devices(string(VTNAME));
@@ -590,7 +590,7 @@ GCFEvent::TResult AVTTestTask::test9(GCFEvent& event, GCFPortInterface& p)
         break;
       }
       
-      case F_VCHANGEMSG_SIG:
+      case F_VCHANGEMSG:
       {
         GCFPropValueEvent* pResponse = static_cast<GCFPropValueEvent*>(&event);
         assert(pResponse);
@@ -608,7 +608,7 @@ GCFEvent::TResult AVTTestTask::test9(GCFEvent& event, GCFPortInterface& p)
         break;
       }
 
-      case F_DISCONNECTED_SIG:
+      case F_DISCONNECTED:
       {
         m_tester._avttest(false);
         TRAN(AVTTestTask::finished);
@@ -635,10 +635,10 @@ GCFEvent::TResult AVTTestTask::finished(GCFEvent& event, GCFPortInterface& /*p*/
 
   switch (event.signal)
   {
-    case F_INIT_SIG:
+    case F_INIT:
       break;
 
-    case F_ENTRY_SIG:
+    case F_ENTRY:
       m_propertyLDSstatus.unsubscribe();
       GCFTask::stop();
       break;
@@ -661,7 +661,9 @@ GCFEvent::TResult AVTTestTask::handleBeamServerEvents(GCFEvent& event, GCFPortIn
   {
     case ABS_BEAMALLOC:
     {
-      ABSBeamalloc_AckEvent ack(0, SUCCESS);
+      ABSBeamallocAckEvent ack;
+      ack.handle=0;
+      ack.status=SUCCESS;
       p.send(ack);
       m_BEAMALLOC_received=true;
       break;
@@ -669,7 +671,9 @@ GCFEvent::TResult AVTTestTask::handleBeamServerEvents(GCFEvent& event, GCFPortIn
      
     case ABS_BEAMFREE:
     {
-      ABSBeamfree_AckEvent ack(0, SUCCESS);
+      ABSBeamfreeAckEvent ack;
+      ack.handle=0;
+      ack.status=SUCCESS;
       p.send(ack);
       m_BEAMFREE_received=true;
       break;
@@ -690,7 +694,8 @@ GCFEvent::TResult AVTTestTask::handleBeamServerEvents(GCFEvent& event, GCFPortIn
      
     case ABS_WGSETTINGS:
     {
-      ABSWgsettings_AckEvent ack(SUCCESS);
+      ABSWgsettingsAckEvent ack;
+      ack.status=SUCCESS;
       p.send(ack);
       m_WGSETTINGS_received=true;
       break;
@@ -704,7 +709,7 @@ GCFEvent::TResult AVTTestTask::handleBeamServerEvents(GCFEvent& event, GCFPortIn
       m_WGDISABLE_received=true;
       break;
 
-    case F_TIMER_SIG:
+    case F_TIMER:
     {
       GCFTimerEvent *pTimerEvent=static_cast<GCFTimerEvent*>(&event);
       if(pTimerEvent!=0)
@@ -753,17 +758,17 @@ GCFEvent::TResult AVTTestTask::beamServer(GCFEvent& event, GCFPortInterface& p)
     status = GCFEvent::HANDLED;
     switch (event.signal)
     {
-      case F_INIT_SIG:
+      case F_INIT:
         break;
 
-      case F_ENTRY_SIG:
+      case F_ENTRY:
         m_statisticsTimerID=m_beamserver.setTimer(3.0); // statistics update
         break;
       
-      case F_CONNECTED_SIG:
+      case F_CONNECTED:
         break;
               
-      case F_DISCONNECTED_SIG:
+      case F_DISCONNECTED:
         p.close();
         break;
               
diff --git a/MAC/APL/PAC/_VirtualTelescope/test/AVTTestTask.h b/MAC/APL/PAC/_VirtualTelescope/test/AVTTestTask.h
index b452f85fc0e..283358c4c94 100644
--- a/MAC/APL/PAC/_VirtualTelescope/test/AVTTestTask.h
+++ b/MAC/APL/PAC/_VirtualTelescope/test/AVTTestTask.h
@@ -94,7 +94,7 @@ class AVTTestTask : public GCFTask
     bool m_WGSETTINGS_received;
     bool m_WGENABLE_received;
     bool m_WGDISABLE_received;
-    long m_statisticsTimerID;
+    unsigned long m_statisticsTimerID;
     double m_beamAngle1;
     double m_beamAngle2;
     unsigned int m_seqnr;
diff --git a/MAC/APL/PAC/_VirtualTelescope/test/Makefile.am b/MAC/APL/PAC/_VirtualTelescope/test/Makefile.am
index 8d0d17ec6e2..929d0f44fb2 100644
--- a/MAC/APL/PAC/_VirtualTelescope/test/Makefile.am
+++ b/MAC/APL/PAC/_VirtualTelescope/test/Makefile.am
@@ -5,18 +5,20 @@ TESTS			= #avttest
 AUTOGEN = autogen
 SUFFIXES = .ph
 %.ph: %.prot
-	$(AUTOGEN) -L $(top_srcdir)/../MACCommon/autogen $< && \
-	chmod a+w $@
+	$(AUTOGEN) --writable -L $(top_srcdir)/../MACCommon/autogen -L $(top_builddir)/PAC/BeamServer/src $<
 
 avttest_CPPFLAGS= \
 	-I$(top_srcdir)/../GCF/GCFCommon/src \
-	-I$(top_srcdir)/PAC/BeamServer/src
+	-I$(top_srcdir)/PAC/BeamServer/src \
+	-fmessage-length=0
 
 avttest_SOURCES 		= \
 	AVTTestAnswer.cc \
 	AVTTest.cc \
 	AVTTestTask.cc \
-	AVTTestMain.cc
+	AVTTestMain.cc \
+	../src/LogicalDevice_Protocol.cc \
+	ABS_Protocol.cc
 	
 avttest_LDADD		= \
 	$(top_builddir)/APLCommon/src/libaplcommon.la
@@ -24,11 +26,15 @@ avttest_DEPENDENCIES	= \
 	$(top_builddir)/APLCommon/src/libaplcommon.la
 
 BUILT_SOURCES = \
+    $(top_builddir)/PAC/BeamServer/src/ABS_Protocol.ph \
+    $(top_builddir)/PAC/VirtualTelescope/src/LogicalDevice_Protocol.ph \
 	avttest.ns \
 	avttest.top \
 	log4cplus.properties	
 
 EXTRA_DIST = \
+    $(top_builddir)/PAC/BeamServer/src/ABS_Protocol.ph \
+    $(top_builddir)/PAC/VirtualTelescope/src/LogicalDevice_Protocol.ph \
 	avttest.ns \
 	avttest.top \
 	log4cplus.properties
diff --git a/MAC/APL/PIC/Makefile.am b/MAC/APL/PIC/Makefile.am
new file mode 100644
index 00000000000..98eda84d1cd
--- /dev/null
+++ b/MAC/APL/PIC/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS=RegisterAccess
+
+include $(lofar_sharedir)/Makefile.common
diff --git a/MAC/APL/PIC/_RegisterAccess/Makefile.am b/MAC/APL/PIC/_RegisterAccess/Makefile.am
new file mode 100644
index 00000000000..7e39845e1a3
--- /dev/null
+++ b/MAC/APL/PIC/_RegisterAccess/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS=test
+
+include $(lofar_sharedir)/Makefile.common
diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATest.cc b/MAC/APL/PIC/_RegisterAccess/test/ARATest.cc
new file mode 100644
index 00000000000..5b6b3bbba22
--- /dev/null
+++ b/MAC/APL/PIC/_RegisterAccess/test/ARATest.cc
@@ -0,0 +1,52 @@
+//#  ARATest.cc: Implementation of the RegisterAccess test
+//#
+//#  Copyright (C) 2002-2004
+//#  ASTRON (Netherlands Foundation for Research in Astronomy)
+//#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+//#
+//#  This program is free software; you can redistribute it and/or modify
+//#  it under the terms of the GNU General Public License as published by
+//#  the Free Software Foundation; either version 2 of the License, or
+//#  (at your option) any later version.
+//#
+//#  This program is distributed in the hope that it will be useful,
+//#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//#  GNU General Public License for more details.
+//#
+//#  You should have received a copy of the GNU General Public License
+//#  along with this program; if not, write to the Free Software
+//#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//#
+//#  $Id$
+
+#include "ARATest.h"
+
+ARATest::ARATest() :
+  Test(string("ARATest")),
+  m_testTask(*this)
+{
+}
+
+ARATest::~ARATest()
+{
+}
+
+void ARATest::run()
+{  
+  m_testTask.start();
+  
+  GCFTask::run();
+}
+
+void ARATest::avt_do_test(bool cond, const string& lbl,
+                          const char* fname, long lineno)
+{
+  do_test(cond,lbl,fname,lineno);
+}
+
+void ARATest::avt_do_fail(const string& lbl,
+                          const char* fname, long lineno)
+{
+  do_fail(lbl,fname,lineno);
+}
diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATest.h b/MAC/APL/PIC/_RegisterAccess/test/ARATest.h
new file mode 100644
index 00000000000..58d6e334c65
--- /dev/null
+++ b/MAC/APL/PIC/_RegisterAccess/test/ARATest.h
@@ -0,0 +1,66 @@
+//#  ARATest.h: Automatic test of the RegisterAccess application
+//#
+//#  Copyright (C) 2002-2004
+//#  ASTRON (Netherlands Foundation for Research in Astronomy)
+//#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+//#
+//#  This program is free software; you can redistribute it and/or modify
+//#  it under the terms of the GNU General Public License as published by
+//#  the Free Software Foundation; either version 2 of the License, or
+//#  (at your option) any later version.
+//#
+//#  This program is distributed in the hope that it will be useful,
+//#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//#  GNU General Public License for more details.
+//#
+//#  You should have received a copy of the GNU General Public License
+//#  along with this program; if not, write to the Free Software
+//#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//#
+//#  $Id$
+
+#ifndef ARATest_H
+#define ARATest_H
+
+//# Includes
+//# Common Includes
+#include "../../../APLCommon/src/test.h"
+
+//# GCF Includes
+
+//# RegisterAccess Includes
+#include "ARATestTask.h"
+
+// forward declaration
+
+
+// redefine the _test and _fail macros to get the correct file and linenumbers
+// in the output.
+#define _avttest(cond) avt_do_test(cond, #cond, __FILE__, __LINE__)
+#define _avtfail(str)  avt_do_fail(str, __FILE__, __LINE__)
+
+class ARATest : public Test
+{
+  public:
+    ARATest();
+    virtual ~ARATest();
+
+    virtual void run();
+    
+    void avt_do_test(bool cond, const string& lbl,
+                     const char* fname, long lineno);
+    void avt_do_fail(const string& lbl,
+                     const char* fname, long lineno);
+        
+  protected:
+    // protected copy constructor
+    ARATest(const ARATest&);
+    // protected assignment operator
+    ARATest& operator=(const ARATest&);
+    
+  private: 
+    
+    ARATestTask m_testTask;
+};
+#endif
diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.cc b/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.cc
new file mode 100644
index 00000000000..d7e8b100aea
--- /dev/null
+++ b/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.cc
@@ -0,0 +1,45 @@
+//#  ARATestAnswer.cc: Implementation of the ARATestAnswer object
+//#
+//#  Copyright (C) 2002-2004
+//#  ASTRON (Netherlands Foundation for Research in Astronomy)
+//#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+//#
+//#  This program is free software; you can redistribute it and/or modify
+//#  it under the terms of the GNU General Public License as published by
+//#  the Free Software Foundation; either version 2 of the License, or
+//#  (at your option) any later version.
+//#
+//#  This program is distributed in the hope that it will be useful,
+//#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//#  GNU General Public License for more details.
+//#
+//#  You should have received a copy of the GNU General Public License
+//#  along with this program; if not, write to the Free Software
+//#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//#
+//#  $Id$
+
+#include "ARATestAnswer.h"
+#include <GCF/GCF_Task.h>
+
+ARATestAnswer::ARATestAnswer() : 
+  m_dummyPort(),
+  m_task(0)
+{
+}
+
+ARATestAnswer::~ARATestAnswer()
+{
+}
+
+void ARATestAnswer::setTask(GCFTask* pTask)
+{
+  m_task=pTask;
+}
+
+void ARATestAnswer::handleAnswer(GCFEvent& answer)
+{
+  if(m_task!=0)
+    m_task->dispatch(answer,m_dummyPort);
+}
diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.h b/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.h
new file mode 100644
index 00000000000..d14babfc015
--- /dev/null
+++ b/MAC/APL/PIC/_RegisterAccess/test/ARATestAnswer.h
@@ -0,0 +1,45 @@
+//#  ARATestAnswer.h
+//#
+//#  Copyright (C) 2002-2004
+//#  ASTRON (Netherlands Foundation for Research in Astronomy)
+//#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+//#
+//#  This program is free software; you can redistribute it and/or modify
+//#  it under the terms of the GNU General Public License as published by
+//#  the Free Software Foundation; either version 2 of the License, or
+//#  (at your option) any later version.
+//#
+//#  This program is distributed in the hope that it will be useful,
+//#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//#  GNU General Public License for more details.
+//#
+//#  You should have received a copy of the GNU General Public License
+//#  along with this program; if not, write to the Free Software
+//#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//#
+//#  $Id$
+
+#ifndef ARATESTANSWER_H
+#define ARATESTANSWER_H
+
+#include <GCF/GCF_Answer.h>
+#include <GCF/GCF_Port.h>
+
+class GCFEvent;
+class GCFTask;
+
+class ARATestAnswer : public GCFAnswer
+{
+  public:
+    ARATestAnswer();
+    ~ARATestAnswer();
+
+    void setTask(GCFTask* t);
+    void handleAnswer(GCFEvent& answer);
+    
+  private:    
+    GCFPort  m_dummyPort;
+    GCFTask* m_task;
+};
+#endif
diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestMain.cc b/MAC/APL/PIC/_RegisterAccess/test/ARATestMain.cc
new file mode 100644
index 00000000000..1adce384fde
--- /dev/null
+++ b/MAC/APL/PIC/_RegisterAccess/test/ARATestMain.cc
@@ -0,0 +1,53 @@
+//#  ARATestMain.cc: Main entry for the Register Access test
+//#
+//#  Copyright (C) 2002-2004
+//#  ASTRON (Netherlands Foundation for Research in Astronomy)
+//#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+//#
+//#  This program is free software; you can redistribute it and/or modify
+//#  it under the terms of the GNU General Public License as published by
+//#  the Free Software Foundation; either version 2 of the License, or
+//#  (at your option) any later version.
+//#
+//#  This program is distributed in the hope that it will be useful,
+//#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//#  GNU General Public License for more details.
+//#
+//#  You should have received a copy of the GNU General Public License
+//#  along with this program; if not, write to the Free Software
+//#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//#
+//#  $Id$
+
+#include <CmdLine.h>
+#include <GCF/GCF_Task.h>
+#include "../../../APLCommon/src/suite.h"
+#include "ARATest.h"
+#include <boost/shared_ptr.hpp>
+
+int main(int argc, char* argv[])
+{
+  int retval=-1;
+  
+  {
+    GCFTask::init(argc, argv);
+
+    CCmdLine cmdLine;
+
+    // parse argc,argv 
+    if (cmdLine.SplitLine(argc, argv) > 0)
+    {
+      // no extra switches
+    }
+    
+    Suite s("MAC.APL.PIC RegisterAccess Test",&std::cout);
+  
+    boost::shared_ptr<ARATest> araTest(new ARATest);
+    s.addTest(araTest.get());
+    s.run();
+    retval=s.report();
+  }
+  return retval;
+}
+
diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.cc b/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.cc
new file mode 100644
index 00000000000..cbd2bf936a0
--- /dev/null
+++ b/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.cc
@@ -0,0 +1,686 @@
+//#  ARATestTask.cc: Implementation of the Virtual Telescope test
+//#
+//#  Copyright (C) 2002-2004
+//#  ASTRON (Netherlands Foundation for Research in Astronomy)
+//#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+//#
+//#  This program is free software; you can redistribute it and/or modify
+//#  it under the terms of the GNU General Public License as published by
+//#  the Free Software Foundation; either version 2 of the License, or
+//#  (at your option) any later version.
+//#
+//#  This program is distributed in the hope that it will be useful,
+//#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//#  GNU General Public License for more details.
+//#
+//#  You should have received a copy of the GNU General Public License
+//#  along with this program; if not, write to the Free Software
+//#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//#
+//#  $Id$
+
+#define PROPERTY_STATUS                     "status"
+#define PROPERTY_COMMAND                    "command"
+#define PROPERTIES_BOARD1                   "PIC_Rack1_SubRack1_Board1"
+#define PROPERTIES_BOARD1_ALERT             "PIC_Rack1_SubRack1_Board1_Alert"
+#define PROPERTIES_AP1                      "PIC_Rack1_SubRack1_Board1_AP1"
+#define PROPERTIES_AP1_RCU1                 "PIC_Rack1_SubRack1_Board1_AP1_RCU1"
+#define PROPERTIES_AP1_RCU1_MAINTENANCE     "PIC_Rack1_SubRack1_Board1_AP1_RCU1_Maintenance"
+#define PROPERTIES_STATION_PIC              "PIC"
+#define PROPERTIES_STATION_PIC_MAINTENANCE  "PIC_Maintenance"
+#define PROPERTIES_STATION_PAC              "PAC"
+
+#include <math.h>
+#include <GCF/GCF_PValue.h>
+#include <GCF/GCF_PVUnsigned.h>
+#include <GCF/GCF_PVString.h>
+#include <GCF/GCF_PVDouble.h>
+#include "../../../APLCommon/src/APL_Defines.h"
+#include "ARATest.h"
+#include "ARATestTask.h"
+#include "PropertyDefines.h" 
+
+#include <stdio.h>
+
+string ARATestTask::m_taskName("ARATest");
+
+ARATestTask::ARATestTask(ARATest& tester) :
+  GCFTask((State)&ARATestTask::initial, m_taskName),
+  m_tester(tester),
+  m_answer(),
+  m_test_passCounter(0),
+  m_psBP(string("ApcFPGAType"),string(PROPERTIES_AP1)),
+  m_psRCUmaintenance(string("ApcMaintenanceType"),string(PROPERTIES_AP1_RCU1_MAINTENANCE)),
+  m_psStationMaintenance(string("ApcMaintenanceType"),string(PROPERTIES_STATION_PIC_MAINTENANCE)),
+  m_psLDScommand(string("ApcLogicalDeviceScheduler"),string(PROPERTIES_STATION_PAC)),
+  m_psBoard1Alert(string("ApcAlertType"),string(PROPERTIES_BOARD1_ALERT)),
+  m_psBoard1(string("ApcBoardType"),string(PROPERTIES_BOARD1))
+{
+  m_answer.setTask(this);
+}
+
+ARATestTask::~ARATestTask()
+{
+}
+
+GCFEvent::TResult ARATestTask::initial(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::initial (%s)",getName().c_str(),evtstr(event)));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+      break;
+    
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::initial, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+
+  return status;
+}
+
+/* 
+ * Test case 1: Monitor FPGA registers. Goal: load secondary properties
+ */
+GCFEvent::TResult ARATestTask::test1(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test1 (%s)",getName().c_str(),evtstr(event)));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+    {
+      bool testOk = (GCF_NO_ERROR==m_psBP.requestValue(string(PROPERTY_STATUS)));
+      m_tester._avttest(testOk);
+      if(!testOk)
+      {
+        TRAN(ARATestTask::test2);
+      }
+      break;
+    }
+
+    case F_VGETRESP:
+    {
+      // check which property changed
+      GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event);
+      assert(pPropAnswer);
+      bool testOk = (
+        strstr(pPropAnswer->pPropName,PROPERTIES_AP1)!=0 &&
+        strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0 );
+      m_tester._avttest(testOk);
+      TRAN(ARATestTask::test2);
+      break;
+    }
+     
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test1, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+
+  return status;
+}
+
+/* 
+ * Test case 2: put 1 antenna in maintenance
+ */
+GCFEvent::TResult ARATestTask::test2(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test2 (%d)",getName().c_str(),event.signal));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+    {
+      GCFPVUnsigned inMaintenance(1);
+      bool testOk = (GCF_NO_ERROR==m_psRCUmaintenance.setValue(string(PROPERTY_STATUS),inMaintenance));
+      m_tester._avttest(testOk);
+      if(!testOk)
+      {
+        TRAN(ARATestTask::test3);
+      }
+      break;
+    }
+    
+    case F_VCHANGEMSG:
+    {
+      // check which property changed
+      GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event);
+      assert(pPropAnswer);
+      const GCFPVUnsigned* pInMaintenance = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+      bool testOk = (
+        strstr(pPropAnswer->pPropName,PROPERTIES_AP1_RCU1_MAINTENANCE)!=0 &&
+        strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0 &&
+        pInMaintenance->getValue()!=0 );
+      m_tester._avttest(testOk);
+      TRAN(ARATestTask::test3);
+      break;
+    }
+     
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test2, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+
+  return status;
+}
+
+/* 
+ * Test case 3: put station in maintenance
+ */
+GCFEvent::TResult ARATestTask::test3(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test3 (%d)",getName().c_str(),event.signal));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+    {
+      GCFPVUnsigned inMaintenance(1);
+      bool testOk = (GCF_NO_ERROR==m_psStationMaintenance.setValue(string(PROPERTY_STATUS),inMaintenance));
+      m_tester._avttest(testOk);
+      if(!testOk)
+      {
+        TRAN(ARATestTask::test4);
+      }
+      break;
+    }
+    
+    case F_VCHANGEMSG:
+    {
+      // check which property changed
+      GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event);
+      assert(pPropAnswer);
+      const GCFPVUnsigned* pInMaintenance = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+      bool testOk = (
+        strstr(pPropAnswer->pPropName,PROPERTIES_STATION_PIC_MAINTENANCE)!=0 &&
+        strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0 &&
+        pInMaintenance->getValue()!=0 );
+      m_tester._avttest(testOk);
+      TRAN(ARATestTask::test4);
+      break;
+    }
+     
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test3, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+
+  return status;
+}
+
+/* 
+ * Test case 4: put station out of maintenance
+ */
+GCFEvent::TResult ARATestTask::test4(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test4 (%d)",getName().c_str(),event.signal));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+    {
+      GCFPVUnsigned inMaintenance(0);
+      bool testOk = (GCF_NO_ERROR==m_psStationMaintenance.setValue(string(PROPERTY_STATUS),inMaintenance));
+      m_tester._avttest(testOk);
+      if(!testOk)
+      {
+        TRAN(ARATestTask::test5);
+      }
+      break;
+    }
+    
+    case F_VCHANGEMSG:
+    {
+      // check which property changed
+      GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event);
+      assert(pPropAnswer);
+      const GCFPVUnsigned* pInMaintenance = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+      bool testOk = (
+        strstr(pPropAnswer->pPropName,PROPERTIES_STATION_PIC_MAINTENANCE)!=0 &&
+        strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0 &&
+        pInMaintenance->getValue()==0 );
+      m_tester._avttest(testOk);
+      
+      // check maintenance status of antenna
+      testOk = (GCF_NO_ERROR==m_psRCUmaintenance.requestValue(string(PROPERTY_STATUS)));
+      m_tester._avttest(testOk);
+      if(!testOk)
+      {
+        TRAN(ARATestTask::test5);
+      }
+      break;
+    }
+     
+    case F_VGETRESP:
+    {
+      // check which property changed
+      GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event);
+      assert(pPropAnswer);
+      const GCFPVUnsigned* pInMaintenance = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+      bool testOk = (
+        strstr(pPropAnswer->pPropName,PROPERTIES_AP1_RCU1_MAINTENANCE)!=0 &&
+        strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0 &&
+        pInMaintenance->getValue()!=0 );
+      m_tester._avttest(testOk);
+      TRAN(ARATestTask::test5);
+      break;
+    }
+
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test4, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+
+  return status;
+}
+
+/* 
+ * Test case 5: put antenna out of maintenance
+ */
+GCFEvent::TResult ARATestTask::test5(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test5 (%d)",getName().c_str(),event.signal));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+    {
+      GCFPVUnsigned inMaintenance(0);
+      bool testOk = (GCF_NO_ERROR==m_psRCUmaintenance.setValue(string(PROPERTY_STATUS),inMaintenance));
+      m_tester._avttest(testOk);
+      if(!testOk)
+      {
+        TRAN(ARATestTask::test6);
+      }
+      break;
+    }
+    
+    case F_VCHANGEMSG:
+    {
+      // check which property changed
+      GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event);
+      assert(pPropAnswer);
+      const GCFPVUnsigned* pInMaintenance = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+      bool testOk = (
+        strstr(pPropAnswer->pPropName,PROPERTIES_AP1_RCU1_MAINTENANCE)!=0 &&
+        strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0 &&
+        pInMaintenance->getValue()==0 );
+      m_tester._avttest(testOk);
+      TRAN(ARATestTask::test6);
+      break;
+    }
+     
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test5, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+
+  return status;
+}
+
+/* 
+ * Test case 6: schedule maintenance of 1 antenna
+ */
+GCFEvent::TResult ARATestTask::test6(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test6 (%d)",getName().c_str(),event.signal));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+    {
+      m_test_passCounter=0;
+      // SCHEDULE MAINTENANCE <resource>,<starttime>,<stoptime>
+      string cmd("SCHEDULE MAINTENANCE");
+      string resource(string(PROPERTIES_AP1_RCU1)+string(","));
+      time_t rawtime;
+      tm * starttm;
+      tm * stoptm;
+      time ( &rawtime );
+      starttm = gmtime(&rawtime);
+      starttm = gmtime(&rawtime);
+      starttm->tm_sec+=10; // 10 seconds in the future
+      stoptm->tm_sec+=20; // 20 seconds in the future
+      char startTime[100];
+      char stopTime[100];
+      sprintf(startTime,"%02d-%02d-%04d %02d:%02d:%02d",starttm->tm_mday,starttm->tm_mon+1,starttm->tm_year+1900,starttm->tm_hour,starttm->tm_min,starttm->tm_sec);
+      sprintf(stopTime,"%02d-%02d-%04d %02d:%02d:%02d",stoptm->tm_mday,stoptm->tm_mon+1,stoptm->tm_year+1900,stoptm->tm_hour,stoptm->tm_min,stoptm->tm_sec);
+      GCFPVString command(cmd+resource+string(startTime)+","+string(stopTime));
+
+      bool testOk = (GCF_NO_ERROR==m_psLDScommand.setValue(string(PROPERTY_COMMAND),command));
+      m_tester._avttest(testOk);
+      if(!testOk)
+      {
+        TRAN(ARATestTask::test7);
+      }
+      printf("the resource will be put in maintenance in 10 seconds... Please wait\n");
+      
+      break;
+    }
+    
+    case F_VCHANGEMSG:
+    {
+      // check which property changed
+      GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event);
+      assert(pPropAnswer);
+      if(strstr(pPropAnswer->pPropName,PROPERTIES_AP1_RCU1_MAINTENANCE)!=0 &&
+        strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0)
+      {
+        const GCFPVUnsigned* pInMaintenance = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+        if(m_test_passCounter==0) // first pass: in maintenance
+        {
+          {
+            bool testOk = (pInMaintenance->getValue()!=0 );
+            m_tester._avttest(testOk);
+            if(!testOk)
+            {
+              TRAN(ARATestTask::test7);
+            }
+            else
+            {
+              printf("the resource will be put out of maintenance in 10 seconds... Please wait\n");
+            }
+          }
+          m_test_passCounter++;
+        }
+        else if(m_test_passCounter==1) // second pass: out of maintenance
+        {
+          bool testOk = (pInMaintenance->getValue()==0 );
+          m_tester._avttest(testOk);
+          TRAN(ARATestTask::test7);
+        }
+      }
+      break;
+    }
+    
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test6, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+  return status;
+}
+
+/* 
+ * Test case 7: schedule maintenance of entire station
+ */
+GCFEvent::TResult ARATestTask::test7(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test7 (%d)",getName().c_str(),event.signal));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+    {
+      m_test_passCounter=0;
+      // SCHEDULE MAINTENANCE <resource>,<starttime>,<stoptime>
+      string cmd("SCHEDULE MAINTENANCE");
+      string resource(string(PROPERTIES_STATION_PIC)+string(","));
+      time_t rawtime;
+      tm * starttm;
+      tm * stoptm;
+      time ( &rawtime );
+      starttm = gmtime(&rawtime);
+      starttm = gmtime(&rawtime);
+      starttm->tm_sec+=10; // 10 seconds in the future
+      stoptm->tm_sec+=20; // 20 seconds in the future
+      char startTime[100];
+      char stopTime[100];
+      sprintf(startTime,"%02d-%02d-%04d %02d:%02d:%02d",starttm->tm_mday,starttm->tm_mon+1,starttm->tm_year+1900,starttm->tm_hour,starttm->tm_min,starttm->tm_sec);
+      sprintf(stopTime,"%02d-%02d-%04d %02d:%02d:%02d",stoptm->tm_mday,stoptm->tm_mon+1,stoptm->tm_year+1900,stoptm->tm_hour,stoptm->tm_min,stoptm->tm_sec);
+      GCFPVString command(cmd+resource+string(startTime)+","+string(stopTime));
+
+      bool testOk = (GCF_NO_ERROR==m_psLDScommand.setValue(string(PROPERTY_COMMAND),command));
+      m_tester._avttest(testOk);
+      if(!testOk)
+      {
+        TRAN(ARATestTask::test8);
+      }
+      printf("the resource will be put in maintenance in 10 seconds... Please wait\n");
+      
+      break;
+    }
+    
+    case F_VCHANGEMSG:
+    {
+      // check which property changed
+      GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event);
+      assert(pPropAnswer);
+      if(strstr(pPropAnswer->pPropName,PROPERTIES_STATION_PIC_MAINTENANCE)!=0 &&
+        strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0)
+      {
+        const GCFPVUnsigned* pInMaintenance = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+        if(m_test_passCounter==0) // first pass: in maintenance
+        {
+          {
+            bool testOk = (pInMaintenance->getValue()!=0 );
+            m_tester._avttest(testOk);
+            if(!testOk)
+            {
+              TRAN(ARATestTask::test8);
+            }
+            else
+            {
+              printf("the resource will be put out of maintenance in 10 seconds... Please wait\n");
+            }
+          }
+          m_test_passCounter++;
+        }
+        else if(m_test_passCounter==1) // second pass: out of maintenance
+        {
+          bool testOk = (pInMaintenance->getValue()==0 );
+          m_tester._avttest(testOk);
+          TRAN(ARATestTask::test8);
+        }
+      }
+      break;
+    }
+    
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test7, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+  return status;
+}
+
+/* 
+ * Test case 8: simulate board defect
+ */
+GCFEvent::TResult ARATestTask::test8(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test8 (%d)",getName().c_str(),event.signal));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+    {
+      m_psBoard1Alert.subscribe(string(PROPERTY_STATUS));
+      
+      GCFPVUnsigned boardStatus(1);
+      bool testOk = (GCF_NO_ERROR==m_psBoard1.setValue(string(PROPERTY_STATUS),boardStatus));
+      m_tester._avttest(testOk);
+      if(!testOk)
+      {
+        TRAN(ARATestTask::test9);
+      }
+      break;
+    }
+    
+    case F_VCHANGEMSG:
+    {
+      // check which property changed
+      GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event);
+      assert(pPropAnswer);
+      if(strstr(pPropAnswer->pPropName,PROPERTIES_BOARD1)!=0 &&
+         strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0)
+      {
+        const GCFPVUnsigned* pStatus = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+        bool testOk = ( pStatus->getValue()!=0 );
+        m_tester._avttest(testOk);
+        if(!testOk)
+        {
+          TRAN(ARATestTask::test9);
+        }
+      }
+      else if(strstr(pPropAnswer->pPropName,PROPERTIES_BOARD1_ALERT)!=0 &&
+         strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0)
+      {
+        // check alert status
+        const GCFPVUnsigned* pStatus = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+        bool testOk = ( pStatus->getValue()!=0 );
+        m_tester._avttest(testOk);
+        TRAN(ARATestTask::test9);
+      }
+      break;
+    }
+     
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test8, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+
+  return status;
+}
+
+/* 
+ * Test case 9: simulate board defect fixed
+ */
+GCFEvent::TResult ARATestTask::test9(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test9 (%d)",getName().c_str(),event.signal));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+    {
+      m_psBoard1Alert.subscribe(string(PROPERTY_STATUS));
+      
+      GCFPVUnsigned boardStatus(0);
+      bool testOk = (GCF_NO_ERROR==m_psBoard1.setValue(string(PROPERTY_STATUS),boardStatus));
+      m_tester._avttest(testOk);
+      if(!testOk)
+      {
+        m_psBoard1Alert.unsubscribe(string(PROPERTY_STATUS));
+        TRAN(ARATestTask::finished);
+      }
+      break;
+    }
+    
+    case F_VCHANGEMSG:
+    {
+      // check which property changed
+      GCFPropValueEvent* pPropAnswer = static_cast<GCFPropValueEvent*>(&event);
+      assert(pPropAnswer);
+      if(strstr(pPropAnswer->pPropName,PROPERTIES_BOARD1)!=0 &&
+         strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0)
+      {
+        const GCFPVUnsigned* pStatus = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+        bool testOk = ( pStatus->getValue()==0 );
+        m_tester._avttest(testOk);
+        if(!testOk)
+        {
+          m_psBoard1Alert.unsubscribe(string(PROPERTY_STATUS));
+          TRAN(ARATestTask::finished);
+        }
+      }
+      else if(strstr(pPropAnswer->pPropName,PROPERTIES_BOARD1_ALERT)!=0 &&
+         strstr(pPropAnswer->pPropName,PROPERTY_STATUS)!=0)
+      {
+        // check alert status
+        const GCFPVUnsigned* pStatus = static_cast<const GCFPVUnsigned*>(pPropAnswer->pValue);
+        bool testOk = ( pStatus->getValue()==0 );
+        m_tester._avttest(testOk);
+        m_psBoard1Alert.unsubscribe(string(PROPERTY_STATUS));
+        TRAN(ARATestTask::finished);
+      }
+      break;
+    }
+     
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::test9, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+
+  return status;
+}
+
+
+
+
+/* 
+ * End of all tests
+ */
+GCFEvent::TResult ARATestTask::finished(GCFEvent& event, GCFPortInterface& /*p*/)
+{
+  LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::finished (%s)",getName().c_str(),evtstr(event)));
+  GCFEvent::TResult status = GCFEvent::HANDLED;
+
+  switch (event.signal)
+  {
+    case F_INIT:
+      break;
+
+    case F_ENTRY:
+      GCFTask::stop();
+      break;
+
+    default:
+      LOFAR_LOG_TRACE(VT_STDOUT_LOGGER,("ARATestTask(%s)::finished, default",getName().c_str()));
+      status = GCFEvent::NOT_HANDLED;
+      break;
+  }
+
+  return status;
+}
+
diff --git a/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.h b/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.h
new file mode 100644
index 00000000000..254e95a0a53
--- /dev/null
+++ b/MAC/APL/PIC/_RegisterAccess/test/ARATestTask.h
@@ -0,0 +1,83 @@
+//#  ARATestTask.h: Automatic test of the RegisterAccess application
+//#
+//#  Copyright (C) 2002-2004
+//#  ASTRON (Netherlands Foundation for Research in Astronomy)
+//#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+//#
+//#  This program is free software; you can redistribute it and/or modify
+//#  it under the terms of the GNU General Public License as published by
+//#  the Free Software Foundation; either version 2 of the License, or
+//#  (at your option) any later version.
+//#
+//#  This program is distributed in the hope that it will be useful,
+//#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//#  GNU General Public License for more details.
+//#
+//#  You should have received a copy of the GNU General Public License
+//#  along with this program; if not, write to the Free Software
+//#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//#
+//#  $Id$
+
+#ifndef ARATestTask_H
+#define ARATestTask_H
+
+//# Includes
+//# Common Includes
+
+//# GCF Includes
+#include <GCF/GCF_Task.h>
+#include <GCF/GCF_PropertySet.h>
+#include <boost/shared_ptr.hpp>
+
+#include "ARATestAnswer.h"
+
+// forward declaration
+class GCFEvent;
+class ARATest;
+
+class ARATestTask : public GCFTask
+{
+  public:
+    ARATestTask(ARATest& tester);
+    virtual ~ARATestTask();
+
+  protected:
+    // protected copy constructor
+    ARATestTask(const ARATestTask&);
+    // protected assignment operator
+    ARATestTask& operator=(const ARATestTask&);
+    
+  private: 
+    GCFEvent::TResult initial(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult test1(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult test2(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult test3(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult test4(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult test5(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult test6(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult test7(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult test8(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult test9(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult test10(GCFEvent& e, GCFPortInterface& p);
+    GCFEvent::TResult finished(GCFEvent& e, GCFPortInterface& p);
+    
+    
+    static string m_taskName;
+    
+    ARATest&        m_tester;
+    ARATestAnswer   m_answer;
+    
+    int             m_test_passCounter;
+    
+    GCFPropertySet m_psBP;
+    GCFPropertySet m_psRCUmaintenance;
+    GCFPropertySet m_psStationMaintenance;
+    GCFPropertySet m_psLDScommand;
+    GCFPropertySet m_psBoard1Alert;
+    GCFPropertySet m_psBoard1;
+    
+};
+
+#endif
diff --git a/MAC/APL/PIC/_RegisterAccess/test/Makefile.am b/MAC/APL/PIC/_RegisterAccess/test/Makefile.am
new file mode 100644
index 00000000000..87f43ffe467
--- /dev/null
+++ b/MAC/APL/PIC/_RegisterAccess/test/Makefile.am
@@ -0,0 +1,40 @@
+noinst_PROGRAMS 		= aratest
+
+TESTS			= #aratest
+
+AUTOGEN = autogen
+SUFFIXES = .ph
+%.ph: %.prot
+	$(AUTOGEN) --writable -L $(top_srcdir)/../MACCommon/autogen $<
+
+aratest_CPPFLAGS= \
+	-I$(top_srcdir)/../GCF/GCFCommon/src \
+	-fmessage-length=0
+
+aratest_SOURCES 		= \
+	ARATestAnswer.cc \
+	ARATest.cc \
+	ARATestTask.cc \
+	ARATestMain.cc
+	
+aratest_LDADD		= \
+	$(top_builddir)/APLCommon/src/libaplcommon.la
+aratest_DEPENDENCIES	= \
+	$(top_builddir)/APLCommon/src/libaplcommon.la
+
+BUILT_SOURCES = \
+	log4cplus.properties	
+
+EXTRA_DIST = \
+	log4cplus.properties
+	
+%.properties: $(MAC_CONFIG)/%.properties
+	cp $< $@
+	
+%.ns: %.ns.in
+	cp $< $@
+
+%.top: %.top.in
+	cp $< $@
+
+include $(lofar_sharedir)/Makefile.common
diff --git a/MAC/APL/PIC/_RegisterAccess/test/PropertyDefines.h b/MAC/APL/PIC/_RegisterAccess/test/PropertyDefines.h
new file mode 100644
index 00000000000..d0e64d0a181
--- /dev/null
+++ b/MAC/APL/PIC/_RegisterAccess/test/PropertyDefines.h
@@ -0,0 +1,371 @@
+//#  PropertyDefines.h: common defines for the AVT package
+//#
+//#  Copyright (C) 2002-2004
+//#  ASTRON (Netherlands Foundation for Research in Astronomy)
+//#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+//#
+//#  This program is free software; you can redistribute it and/or modify
+//#  it under the terms of the GNU General Public License as published by
+//#  the Free Software Foundation; either version 2 of the License, or
+//#  (at your option) any later version.
+//#
+//#  This program is distributed in the hope that it will be useful,
+//#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//#  GNU General Public License for more details.
+//#
+//#  You should have received a copy of the GNU General Public License
+//#  along with this program; if not, write to the Free Software
+//#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//#
+//#  $Id$
+
+#ifndef PropertyDefines_H
+#define PropertyDefines_H
+
+#define SBFAPCNAME        "ApcStationBeamformer"
+#define VTAPCNAME         "ApcVirtualTelescope"
+
+#define VTNAME            "VT1"
+#define SBFNAME           "BF1"
+#define SRGNAME           "SRG1"
+#define BSNAME            "BeamServer"
+#define LDSNAME           "LogicalDeviceScheduler"
+
+
+#define PROPERTY_LDS_COMMAND          "LogicalDeviceScheduler_command"
+#define PROPERTY_LDS_STATUS           "LogicalDeviceScheduler_status"
+#define PROPERTY_LDS_WG_FREQUENCY     "LogicalDeviceScheduler_WaveFormGenerator_frequency"
+#define PROPERTY_LDS_WG_AMPLITUDE     "LogicalDeviceScheduler_WaveFormGenerator_amplitude"
+#define PROPERTY_LDS_WG_SAMPLEPERIOD  "LogicalDeviceScheduler_WaveFormGenerator_samplePeriod"
+#define PROPERTY_VT_COMMAND           "VT1_command"
+#define PROPERTY_VT_STATUS            "VT1_status"
+#define PROPERTY_SBF_COMMAND          "VT1_BF1_command"
+#define PROPERTY_SBF_STATUS           "VT1_BF1_status"
+#define PROPERTY_SBF_DIRECTIONTYPE    "VT1_BF1_directionType"
+#define PROPERTY_SBF_DIRECTIONANGLE1  "VT1_BF1_directionAngle1"
+#define PROPERTY_SBF_DIRECTIONANGLE2  "VT1_BF1_directionAngle2"
+
+#define GCF_READWRITE_PROP (GCF_READABLE_PROP | GCF_WRITABLE_PROP)
+
+const TProperty propertiesLDS[] =
+{
+  {"command", GCFPValue::LPT_STRING, GCF_READWRITE_PROP, ""},
+  {"status", GCFPValue::LPT_STRING, GCF_READWRITE_PROP, ""},
+  {"WaveFormGenerator_frequency", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, "1500000.0"},
+  {"WaveFormGenerator_amplitude", GCFPValue::LPT_UNSIGNED, GCF_READWRITE_PROP, "128"},
+  {"WaveFormGenerator_samplePeriod", GCFPValue::LPT_UNSIGNED, GCF_READWRITE_PROP, "2"},
+};
+
+const TPropertySet propertySetLDS = 
+{
+  5, "LogicalDeviceScheduler", propertiesLDS
+};
+
+const TProperty primaryPropertiesVT[] =
+{
+  {"command", GCFPValue::LPT_STRING, GCF_READWRITE_PROP, ""},
+  {"status", GCFPValue::LPT_STRING, GCF_READWRITE_PROP, ""},
+  {"startTime", GCFPValue::LPT_INTEGER, GCF_READWRITE_PROP, "0"},
+};
+
+const TPropertySet primaryPropertySetVT = 
+{
+  3, "VT1", primaryPropertiesVT
+};
+
+const TProperty primaryPropertiesSBF[] =
+{
+  {"command", GCFPValue::LPT_STRING, GCF_READWRITE_PROP, ""},
+  {"status", GCFPValue::LPT_STRING, GCF_READWRITE_PROP, ""},
+  {"directionType",   GCFPValue::LPT_STRING, GCF_READWRITE_PROP, "LMN"},
+  {"directionAngle1", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, "0.0"},
+  {"directionAngle2", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, "0.0"},
+};
+
+const TPropertySet primaryPropertySetSBF = 
+{
+  5, "VT1_BF1", primaryPropertiesSBF
+};
+
+const TProperty propertiesBeamServer[] =
+{
+  {"power000_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power000_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power001_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power001_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power002_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power002_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power003_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power003_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power004_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power004_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power005_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power005_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power006_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power006_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power007_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power007_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power008_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power008_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power009_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power009_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power010_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power010_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power011_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power011_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power012_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power012_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power013_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power013_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power014_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power014_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power015_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power015_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power016_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power016_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power017_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power017_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power018_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power018_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power019_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power019_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power020_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power020_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power021_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power021_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power022_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power022_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power023_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power023_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power024_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power024_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power025_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power025_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power026_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power026_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power027_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power027_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power028_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power028_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power029_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power029_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power030_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power030_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power031_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power031_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power032_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power032_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power033_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power033_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power034_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power034_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power035_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power035_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power036_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power036_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power037_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power037_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power038_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power038_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power039_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power039_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power040_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power040_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power041_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power041_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power042_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power042_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power043_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power043_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power044_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power044_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power045_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power045_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power046_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power046_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power047_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power047_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power048_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power048_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power049_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power049_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power050_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power050_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power051_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power051_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power052_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power052_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power053_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power053_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power054_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power054_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power055_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power055_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power056_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power056_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power057_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power057_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power058_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power058_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power059_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power059_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power060_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power060_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power061_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power061_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power062_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power062_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power063_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power063_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power064_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power064_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power065_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power065_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power066_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power066_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power067_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power067_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power068_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power068_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power069_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power069_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power070_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power070_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power071_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power071_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power072_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power072_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power073_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power073_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power074_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power074_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power075_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power075_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power076_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power076_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power077_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power077_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power078_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power078_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power079_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power079_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power080_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power080_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power081_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power081_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power082_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power082_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power083_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power083_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power084_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power084_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power085_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power085_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power086_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power086_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power087_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power087_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power088_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power088_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power089_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power089_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power090_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power090_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power091_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power091_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power092_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power092_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power093_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power093_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power094_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power094_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power095_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power095_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power096_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power096_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power097_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power097_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power098_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power098_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power099_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power099_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power100_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power100_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power101_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power101_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power102_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power102_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power103_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power103_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power104_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power104_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power105_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power105_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power106_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power106_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power107_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power107_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power108_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power108_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power109_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power109_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power110_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power110_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power111_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power111_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power112_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power112_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power113_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power113_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power114_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power114_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power115_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power115_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power116_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power116_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power117_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power117_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power118_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power118_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power119_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power119_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"power120_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power120_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power121_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power121_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power122_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power122_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power123_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power123_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power124_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power124_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power125_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power125_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power126_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power126_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power127_x", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  {"power127_y", GCFPValue::LPT_DOUBLE, GCF_READWRITE_PROP, ""},
+  
+  {"seqnr", GCFPValue::LPT_UNSIGNED, GCF_READWRITE_PROP, ""},
+};
+
+const TPropertySet propertySetBeamServer = 
+{
+  257, "BeamServer", propertiesBeamServer
+};
+
+
+#endif
diff --git a/MAC/APL/configure.in b/MAC/APL/configure.in
index 41efa695626..b2a03b2abd0 100644
--- a/MAC/APL/configure.in
+++ b/MAC/APL/configure.in
@@ -1,7 +1,7 @@
 dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
-AC_INIT(PAC/VirtualTelescope/src/AVTLogicalDevice.h)
+AC_INIT(APLCommon/src/APL_Defines.h)
 dnl AC_CONFIG_AUX_DIR(config)
 dnl AM_CONFIG_HEADER(config/config.h)
 AM_CONFIG_HEADER(config.h)
@@ -73,5 +73,8 @@ PAC/VirtualTelescope/src/Makefile
 PAC/VirtualTelescope/test/Makefile
 PAC/VirtualTelescope/Makefile
 PAC/Makefile
+PIC/RegisterAccess/test/Makefile
+PIC/RegisterAccess/Makefile
+PIC/Makefile
 Makefile
 )
-- 
GitLab