diff --git a/.gitattributes b/.gitattributes
index 9b904c2c99ff8842e6e1f8e0f2badc8b8a8b373b..76053c5bf40d264ee64647c1a63df6c5fbd6ad26 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1368,6 +1368,7 @@ StationTest/test/beamformertest/beamformertest_HBA_RCU96.sh -text
 StationTest/test/beamformertest/beamformertest_LBA_RCU192.sh -text
 StationTest/test/beamformertest/beamformertest_LBA_RCU96.sh -text
 StationTest/test/beamformertest/beamformertest_LBHLBL_RCU96.sh -text
+StationTest/test/envcontroltest/Makefile.am -text
 StationTest/test/envcontroltest/power_ctrl.py -text
 StationTest/test/envcontroltest/tempctrl_V100.py -text
 StationTest/test/hbatest/Makefile.am -text
diff --git a/StationTest/gold/Makefile.am b/StationTest/gold/Makefile.am
index 46aa24695c7dcfad3a14ecee01a2319f53a15a37..26223749baac7122ace1c5e6d28cc3dd0bcc0c27 100644
--- a/StationTest/gold/Makefile.am
+++ b/StationTest/gold/Makefile.am
@@ -1,9 +1,6 @@
 testdir		 =  $(prefix)/stationtest/gold
-test_SCRIPTS = 	prbs_dir_test.gold \
-				rsp_version.gold \
-				tbb_version.gold \
-				xst_160.gold \
-				xst_200_even.gold \
-				xst_200_odd.gold
+
+test_SCRIPTS = 	$(srcdir)/*.gold 
+test_SCRIPTS +=  $(srcdir)/*.m
 
 include $(top_srcdir)/Makefile.common
diff --git a/StationTest/subrackplustest.sh b/StationTest/subrackplustest.sh
index 72421aeea0ec85cb94633b2db18bd2bc432d99f3..cac50659d2bad21401e7ca58328692536e8961ab 100644
--- a/StationTest/subrackplustest.sh
+++ b/StationTest/subrackplustest.sh
@@ -1,56 +1,56 @@
-# !/bin/bash
-# subrackplustest.sh, version 1.0, date 16-01-2009,  M.J.Norden
-
-
-#export PYTHONPATH=/home/lofartest/subracktest/modules
-
-######## definieeren en printen van de variabelen ####################
-page=1
-tbbpage=1
-station=`hostname -s`
-let rspboards=`sed -n  's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
-let tbboards=`sed -n  's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
-
-echo "This station is "$station
-echo "The number of rspboards is "$rspboards
-echo "The number of tbboards is "$tbboards
-echo "The selected image page is "$page
-
-######## het resetten van RSP borden ####################
-# in de nieuwe swlevel is dit niet meer nodig    
-
-if [ $page != 0 ] ; then
-	for ((ind=0; ind < $rspboards; ind++)) do
-  		MACadr=$(printf "10:FA:00:00:%02x:00" $ind)
-  		sudo rsuctl3_reset -m $MACadr -p $page -x -q;
-      done
-    else 
-       echo "When the RSP flash action was sucessful please"
-       echo "set page to page=0 and reset the RSP boards"
-       echo "with ./restart_images.sh"
-fi       
-
-######## het opstarten van de RSP en TBBDriver ###########################
-
-eval "swlevel 2"
-
-####### terwijl RSPDriver opstart, start image 1 op in de TBB borden ###
-
-if [ $tbbpage != 0 ] ; then
-	tbbctl --config=$tbbpage 
-    else 
-       echo "When the TBB flash action was sucessful please"
-       echo "set page to page=0 and reset the TBB boards"
-       echo "with ./restart_tbb.sh"
-fi
-
-echo "wacht hier 50 seconden voor opstarten TBB en RSP borden"
-sleep 50
-
-######## het starten van de subrack test ####################
-cd /opt/stationtest
-python station_production.py -r $rspboards -t $tbboards
-
-
-
-
+# !/bin/bash
+# subrackplustest.sh, version 1.0, date 16-01-2009,  M.J.Norden
+
+
+#export PYTHONPATH=/home/lofartest/subracktest/modules
+
+######## definieeren en printen van de variabelen ####################
+page=1
+tbbpage=1
+station=`hostname -s`
+let rspboards=`sed -n  's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
+let tbboards=`sed -n  's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
+
+echo "This station is "$station
+echo "The number of rspboards is "$rspboards
+echo "The number of tbboards is "$tbboards
+echo "The selected image page is "$page
+
+######## het resetten van RSP borden ####################
+# in de nieuwe swlevel is dit niet meer nodig    
+
+if [ $page != 0 ] ; then
+	for ((ind=0; ind < $rspboards; ind++)) do
+  		MACadr=$(printf "10:FA:00:00:%02x:00" $ind)
+  		sudo rsuctl3_reset -m $MACadr -p $page -x -q;
+      done
+    else 
+       echo "When the RSP flash action was sucessful please"
+       echo "set page to page=0 and reset the RSP boards"
+       echo "with ./restart_images.sh"
+fi       
+
+######## het opstarten van de RSP en TBBDriver ###########################
+
+eval "swlevel 2"
+
+####### terwijl RSPDriver opstart, start image 1 op in de TBB borden ###
+
+if [ $tbbpage != 0 ] ; then
+	tbbctl --config=$tbbpage 
+    else 
+       echo "When the TBB flash action was sucessful please"
+       echo "set page to page=0 and reset the TBB boards"
+       echo "with ./restart_tbb.sh"
+fi
+
+echo "wacht hier 50 seconden voor opstarten TBB en RSP borden"
+sleep 50
+
+######## het starten van de subrack test ####################
+cd /opt/stationtest
+python station_production.py -r $rspboards -t $tbboards
+
+
+
+
diff --git a/StationTest/subracktest.sh b/StationTest/subracktest.sh
index 2c2c6682637ed11ed5480eb2f1aa735bd5a08038..58e720dc2de6f6363afb2c3ba02d65fc7b8387a0 100644
--- a/StationTest/subracktest.sh
+++ b/StationTest/subracktest.sh
@@ -1,190 +1,190 @@
-#!/bin/bash
-# version 1.4, date 12-02-2009,  M.J.Norden
-
-
-#export PYTHONPATH=/home/lofartest/subracktest/modules
-
-######## vragen subrack, batchnr en serienr ####################
-declare offset1
-declare offset2
-declare offset3
-declare offset4
-
-
-vraag1="welk subrack ga je testen [0, 1, 2, 3, 4, of 5] "
-echo -n "$vraag1"
-read subracknr
-
-vraag2="welk batchnummer staat er op het subrack "
-echo -n "$vraag2"
-read batchnr
-
-vraag3="welk serienummer staat er op het subrack "
-echo -n "$vraag3"
-read serienr
-
-case $subracknr in
-[0]*)
- offset1="00"
- offset2="01"
- offset3="02"
- offset4="03"
- ;;
-[1]*)
- offset1="04"
- offset2="05"
- offset3="06"
- offset4="07"
- ;;
-[2]*)
- offset1="08"
- offset2="09"
- offset3="0A"
- offset4="0B"
- ;;
-[3]*)
- offset1="0C"
- offset2="0D"
- offset3="0E"
- offset4="0F"
- ;;
-[4]*)
- offset1="10"
- offset2="11"
- offset3="12"
- offset4="13"
- ;;
-[5]*)
- offset1="14"
- offset2="15"
- offset3="16"
- offset4="17"
- ;;
-esac
-######## definieeren en printen van de variabelen ####################
-page=1
-station=`hostname -s`
-let rspboards=`sed -n  's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
-let tbboards=`sed -n  's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
-bphexfile=/localhome/firmware/images/bp3b_v5_5.hex
-aphexfile=/localhome/firmware/images/ap3b_v5_3.hex
-tphexfile=/localhome/firmware/images/tp10_12.hex
-mphexfile=/localhome/firmware/images/mp2_9.hex
-mplphexfile=/localhome/firmware/images/mp_lp.hex
-
-echo "This station is "$station
-echo "The number of rspboards is "$rspboards
-echo "The number of tbboards is "$tbboards
-echo "The selected image page is "$page
-echo "Het subrack nummer= "$subracknr
-echo "Het batch nummer= "$batchnr
-echo "Het serie nummer= "$serienr
-echo "The bp hex file is "$bphexfile
-echo "The ap hex file is "$aphexfile
-echo "The offset 1 is "$offset1
-echo "The offset 3 is "$offset3
-
-######## het flashen en resetten van RSP borden ####################
-
-eval "swlevel 1"
-for ((ind=$subracknr*4; ind < ($subracknr+1)*4; ind++)) do
-  MACadr=$(printf "10:FA:00:00:%02x:00" $ind)
-  #sudo rsuctl3 -w -q -p $page -b $bphexfile -a $aphexfile -m $MACadr -F
-  echo " rsp board = "$ind
-done
-
-if [ $page != 0 ] ; then
-	for ((ind=$subracknr*4; ind < ($subracknr+1)*4; ind++)) do
-  		MACadr=$(printf "10:FA:00:00:%02x:00" $ind)
-  		sudo rsuctl3_reset -m $MACadr -p $page -x -q;
-             #echo " rsp board = "$ind
-          done
-    else 
-       echo "When the RSP flash action was sucessful please"
-       echo "set page to page=0 and reset the RSP boards"
-       echo "with ./restart_images.sh"
-fi       
-
-######## het aanpassen van RSPDriver.conf  #########################
-
-sed -i "s/MAC_ADDR_0=10:FA:00:00:..:00/MAC_ADDR_0=10:FA:00:00:$offset1:00/g" /opt/lofar/etc/RSPDriver.conf
-sed -i "s/MAC_ADDR_1=10:FA:00:00:..:00/MAC_ADDR_1=10:FA:00:00:$offset2:00/g" /opt/lofar/etc/RSPDriver.conf
-sed -i "s/MAC_ADDR_2=10:FA:00:00:..:00/MAC_ADDR_2=10:FA:00:00:$offset3:00/g" /opt/lofar/etc/RSPDriver.conf
-sed -i "s/MAC_ADDR_3=10:FA:00:00:..:00/MAC_ADDR_3=10:FA:00:00:$offset4:00/g" /opt/lofar/etc/RSPDriver.conf
-
-######## het aanpassen van TBBDriver.conf  #########################
-
-sed -i "s/MAC_ADDR_0=10:FA:00:00:..:02/MAC_ADDR_0=10:FA:00:00:$offset1:02/g" /opt/lofar/etc/TBBDriver.conf
-sed -i "s/MAC_ADDR_1=10:FA:00:00:..:02/MAC_ADDR_1=10:FA:00:00:$offset3:02/g" /opt/lofar/etc/TBBDriver.conf
-
-let bn0=$subracknr*2
-let bn1=$bn0+1
-let bn2=$bn0*2
-let bn3=$bn1*2
-
-sed -i "s/MAC_ADDR_$bn0=10:FA:00:00:..:02/MAC_ADDR_$bn0=10:FA:00:00:00:02/g" /opt/lofar/etc/TBBDriver.conf
-sed -i "s/MAC_ADDR_$bn1=10:FA:00:00:..:02/MAC_ADDR_$bn1=10:FA:00:00:02:02/g" /opt/lofar/etc/TBBDriver.conf
-
-######## het opstarten van de TBBDriver ###########################
-
-sed -i "s/2:u:d:r::RSPDriver/#2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf
-
-eval "swlevel 2"
-
-echo "wacht even 50 seconden voor het opstarten van de TBB borden"
-sleep 50
-
-######## het flashen en resetten van TBB borden ####################
-
-if [ $tbboards != 0 ] ; then
-tbbctl --writeimage=0,$page,3.2,$tphexfile,$mphexfile
-tbbctl --writeimage=1,$page,3.2,$tphexfile,$mphexfile
-tbbctl --writeimage=0,0,3.0,$tphexfile,$mplphexfile
-tbbctl --writeimage=1,0,3.0,$tphexfile,$mplphexfile
-
-######## het opstarten van de RSPDriver en TBBDriver ###############
-
-
-sed -i "s/#2:u:d:r::RSPDriver/2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf
-sed -i "s/##2:u:d:r::RSPDriver/2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf
-
-eval "swlevel 2"
-
-######## het terugzetten van TBBDriver.conf  #########################
-
-sed -i "s/MAC_ADDR_0=10:FA:00:00:..:00/MAC_ADDR_0=10:FA:00:00:00:00/g" /opt/lofar/etc/RSPDriver.conf
-sed -i "s/MAC_ADDR_1=10:FA:00:00:..:00/MAC_ADDR_1=10:FA:00:00:01:00/g" /opt/lofar/etc/RSPDriver.conf
-sed -i "s/MAC_ADDR_2=10:FA:00:00:..:00/MAC_ADDR_2=10:FA:00:00:02:00/g" /opt/lofar/etc/RSPDriver.conf
-sed -i "s/MAC_ADDR_3=10:FA:00:00:..:00/MAC_ADDR_3=10:FA:00:00:03:00/g" /opt/lofar/etc/RSPDriver.conf
-
-sed -i "s/MAC_ADDR_0=10:FA:00:00:..:02/MAC_ADDR_0=10:FA:00:00:00:02/g" /opt/lofar/etc/TBBDriver.conf
-sed -i "s/MAC_ADDR_1=10:FA:00:00:..:02/MAC_ADDR_1=10:FA:00:00:02:02/g" /opt/lofar/etc/TBBDriver.conf
-
-sed -i "s/MAC_ADDR_$bn0=10:FA:00:00:..:02/MAC_ADDR_$bn0=10:FA:00:00:$offset1:02/g" /opt/lofar/etc/TBBDriver.conf
-sed -i "s/MAC_ADDR_$bn1=10:FA:00:00:..:02/MAC_ADDR_$bn1=10:FA:00:00:$offset3:02/g" /opt/lofar/etc/TBBDriver.conf
-
-######### het setten van de juiste ID in tbb_version.gold  #####################
-sed -i "s/0.......V/0   $bn2   V/g" /opt/stationtest/gold/tbb_version.gold
-sed -i "s/1.......V/1   $bn3   V/g" /opt/stationtest/gold/tbb_version.gold
-
-####### terwijl RSPDriver opstart, start image 1 op in de TBB borden ###
-
-if [ $page != 0 ] ; then
-	tbbctl --config=$page 
-	#tbbctl --config=9 --sel=0,1
-    else 
-       echo "When the TBB flash action was sucessful please"
-       echo "set page to page=0 and reset the TBB boards"
-       echo "with ./restart_tbb.sh"
-fi
-
-else
-   echo "No TBB boards are placed in the SUBRACK"
-fi
-
-echo "wacht hier 50 seconden voor opstarten TBB en RSP borden"
-sleep 50
-
-######## het starten van de subrack test ####################
-python subrack_production.py -b $batchnr -s $serienr
-
+#!/bin/bash
+# version 1.4, date 12-02-2009,  M.J.Norden
+
+
+#export PYTHONPATH=/home/lofartest/subracktest/modules
+
+######## vragen subrack, batchnr en serienr ####################
+declare offset1
+declare offset2
+declare offset3
+declare offset4
+
+
+vraag1="welk subrack ga je testen [0, 1, 2, 3, 4, of 5] "
+echo -n "$vraag1"
+read subracknr
+
+vraag2="welk batchnummer staat er op het subrack "
+echo -n "$vraag2"
+read batchnr
+
+vraag3="welk serienummer staat er op het subrack "
+echo -n "$vraag3"
+read serienr
+
+case $subracknr in
+[0]*)
+ offset1="00"
+ offset2="01"
+ offset3="02"
+ offset4="03"
+ ;;
+[1]*)
+ offset1="04"
+ offset2="05"
+ offset3="06"
+ offset4="07"
+ ;;
+[2]*)
+ offset1="08"
+ offset2="09"
+ offset3="0A"
+ offset4="0B"
+ ;;
+[3]*)
+ offset1="0C"
+ offset2="0D"
+ offset3="0E"
+ offset4="0F"
+ ;;
+[4]*)
+ offset1="10"
+ offset2="11"
+ offset3="12"
+ offset4="13"
+ ;;
+[5]*)
+ offset1="14"
+ offset2="15"
+ offset3="16"
+ offset4="17"
+ ;;
+esac
+######## definieeren en printen van de variabelen ####################
+page=1
+station=`hostname -s`
+let rspboards=`sed -n  's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
+let tbboards=`sed -n  's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
+bphexfile=/localhome/firmware/images/bp3b_v5_5.hex
+aphexfile=/localhome/firmware/images/ap3b_v5_3.hex
+tphexfile=/localhome/firmware/images/tp10_12.hex
+mphexfile=/localhome/firmware/images/mp2_9.hex
+mplphexfile=/localhome/firmware/images/mp_lp.hex
+
+echo "This station is "$station
+echo "The number of rspboards is "$rspboards
+echo "The number of tbboards is "$tbboards
+echo "The selected image page is "$page
+echo "Het subrack nummer= "$subracknr
+echo "Het batch nummer= "$batchnr
+echo "Het serie nummer= "$serienr
+echo "The bp hex file is "$bphexfile
+echo "The ap hex file is "$aphexfile
+echo "The offset 1 is "$offset1
+echo "The offset 3 is "$offset3
+
+######## het flashen en resetten van RSP borden ####################
+
+eval "swlevel 1"
+for ((ind=$subracknr*4; ind < ($subracknr+1)*4; ind++)) do
+  MACadr=$(printf "10:FA:00:00:%02x:00" $ind)
+  #sudo rsuctl3 -w -q -p $page -b $bphexfile -a $aphexfile -m $MACadr -F
+  echo " rsp board = "$ind
+done
+
+if [ $page != 0 ] ; then
+	for ((ind=$subracknr*4; ind < ($subracknr+1)*4; ind++)) do
+  		MACadr=$(printf "10:FA:00:00:%02x:00" $ind)
+  		sudo rsuctl3_reset -m $MACadr -p $page -x -q;
+             #echo " rsp board = "$ind
+          done
+    else 
+       echo "When the RSP flash action was sucessful please"
+       echo "set page to page=0 and reset the RSP boards"
+       echo "with ./restart_images.sh"
+fi       
+
+######## het aanpassen van RSPDriver.conf  #########################
+
+sed -i "s/MAC_ADDR_0=10:FA:00:00:..:00/MAC_ADDR_0=10:FA:00:00:$offset1:00/g" /opt/lofar/etc/RSPDriver.conf
+sed -i "s/MAC_ADDR_1=10:FA:00:00:..:00/MAC_ADDR_1=10:FA:00:00:$offset2:00/g" /opt/lofar/etc/RSPDriver.conf
+sed -i "s/MAC_ADDR_2=10:FA:00:00:..:00/MAC_ADDR_2=10:FA:00:00:$offset3:00/g" /opt/lofar/etc/RSPDriver.conf
+sed -i "s/MAC_ADDR_3=10:FA:00:00:..:00/MAC_ADDR_3=10:FA:00:00:$offset4:00/g" /opt/lofar/etc/RSPDriver.conf
+
+######## het aanpassen van TBBDriver.conf  #########################
+
+sed -i "s/MAC_ADDR_0=10:FA:00:00:..:02/MAC_ADDR_0=10:FA:00:00:$offset1:02/g" /opt/lofar/etc/TBBDriver.conf
+sed -i "s/MAC_ADDR_1=10:FA:00:00:..:02/MAC_ADDR_1=10:FA:00:00:$offset3:02/g" /opt/lofar/etc/TBBDriver.conf
+
+let bn0=$subracknr*2
+let bn1=$bn0+1
+let bn2=$bn0*2
+let bn3=$bn1*2
+
+sed -i "s/MAC_ADDR_$bn0=10:FA:00:00:..:02/MAC_ADDR_$bn0=10:FA:00:00:00:02/g" /opt/lofar/etc/TBBDriver.conf
+sed -i "s/MAC_ADDR_$bn1=10:FA:00:00:..:02/MAC_ADDR_$bn1=10:FA:00:00:02:02/g" /opt/lofar/etc/TBBDriver.conf
+
+######## het opstarten van de TBBDriver ###########################
+
+sed -i "s/2:u:d:r::RSPDriver/#2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf
+
+eval "swlevel 2"
+
+echo "wacht even 50 seconden voor het opstarten van de TBB borden"
+sleep 50
+
+######## het flashen en resetten van TBB borden ####################
+
+if [ $tbboards != 0 ] ; then
+tbbctl --writeimage=0,$page,3.2,$tphexfile,$mphexfile
+tbbctl --writeimage=1,$page,3.2,$tphexfile,$mphexfile
+tbbctl --writeimage=0,0,3.0,$tphexfile,$mplphexfile
+tbbctl --writeimage=1,0,3.0,$tphexfile,$mplphexfile
+
+######## het opstarten van de RSPDriver en TBBDriver ###############
+
+
+sed -i "s/#2:u:d:r::RSPDriver/2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf
+sed -i "s/##2:u:d:r::RSPDriver/2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf
+
+eval "swlevel 2"
+
+######## het terugzetten van TBBDriver.conf  #########################
+
+sed -i "s/MAC_ADDR_0=10:FA:00:00:..:00/MAC_ADDR_0=10:FA:00:00:00:00/g" /opt/lofar/etc/RSPDriver.conf
+sed -i "s/MAC_ADDR_1=10:FA:00:00:..:00/MAC_ADDR_1=10:FA:00:00:01:00/g" /opt/lofar/etc/RSPDriver.conf
+sed -i "s/MAC_ADDR_2=10:FA:00:00:..:00/MAC_ADDR_2=10:FA:00:00:02:00/g" /opt/lofar/etc/RSPDriver.conf
+sed -i "s/MAC_ADDR_3=10:FA:00:00:..:00/MAC_ADDR_3=10:FA:00:00:03:00/g" /opt/lofar/etc/RSPDriver.conf
+
+sed -i "s/MAC_ADDR_0=10:FA:00:00:..:02/MAC_ADDR_0=10:FA:00:00:00:02/g" /opt/lofar/etc/TBBDriver.conf
+sed -i "s/MAC_ADDR_1=10:FA:00:00:..:02/MAC_ADDR_1=10:FA:00:00:02:02/g" /opt/lofar/etc/TBBDriver.conf
+
+sed -i "s/MAC_ADDR_$bn0=10:FA:00:00:..:02/MAC_ADDR_$bn0=10:FA:00:00:$offset1:02/g" /opt/lofar/etc/TBBDriver.conf
+sed -i "s/MAC_ADDR_$bn1=10:FA:00:00:..:02/MAC_ADDR_$bn1=10:FA:00:00:$offset3:02/g" /opt/lofar/etc/TBBDriver.conf
+
+######### het setten van de juiste ID in tbb_version.gold  #####################
+sed -i "s/0.......V/0   $bn2   V/g" /opt/stationtest/gold/tbb_version.gold
+sed -i "s/1.......V/1   $bn3   V/g" /opt/stationtest/gold/tbb_version.gold
+
+####### terwijl RSPDriver opstart, start image 1 op in de TBB borden ###
+
+if [ $page != 0 ] ; then
+	tbbctl --config=$page 
+	#tbbctl --config=9 --sel=0,1
+    else 
+       echo "When the TBB flash action was sucessful please"
+       echo "set page to page=0 and reset the TBB boards"
+       echo "with ./restart_tbb.sh"
+fi
+
+else
+   echo "No TBB boards are placed in the SUBRACK"
+fi
+
+echo "wacht hier 50 seconden voor opstarten TBB en RSP borden"
+sleep 50
+
+######## het starten van de subrack test ####################
+python subrack_production.py -b $batchnr -s $serienr
+
diff --git a/StationTest/tbb_memory.sh b/StationTest/tbb_memory.sh
index 15254ce18e7d8a890869aa9f4f69d35fe5d9ceec..fcd0f60a6ff5fc4178d93553102877ea5f807952 100644
--- a/StationTest/tbb_memory.sh
+++ b/StationTest/tbb_memory.sh
@@ -1,31 +1,31 @@
-#!/bin/bash
-
-#
-# Get version info from the TBB boards and compare this with the expected golden result.
-#
-
-rm -f tbb_memory*.log
-rm -f tbb_memory*.diff
-
-if [ -e /opt/lofar/etc/RemoteStation.conf ]; then
-  let tbboards=`sed -n  's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
-else
-  echo "Could not find /opt/lofar/etc/RemoteStation.conf"
-  exit 1
-fi
-
-
-for ((ind=0; ind < $tbboards; ind++)) do
-        tbbctl --testddr=$ind > tbb_memory$ind.log
-      done
-
-for ((ind=0; ind < $tbboards; ind++)) do
-            diff tbb_memory$ind.log gold/tbb_memory$ind.gold > tbb_memory$ind.diff
-            if [ -e tbb_memory$ind.log ] && [ -e gold/tbb_memory$ind.gold ] && [ -e tbb_memory$ind.diff ] && ! [ -s tbb_memory$ind.diff ]; then
-              # The files exists AND has the diff size 0
-              echo "TBB memory ($ind) test went OK"
-            else
-              echo "TBB memory ($ind) test went wrong"
-            fi
-      done
-
+#!/bin/bash
+
+#
+# Get version info from the TBB boards and compare this with the expected golden result.
+#
+
+rm -f tbb_memory*.log
+rm -f tbb_memory*.diff
+
+if [ -e /opt/lofar/etc/RemoteStation.conf ]; then
+  let tbboards=`sed -n  's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
+else
+  echo "Could not find /opt/lofar/etc/RemoteStation.conf"
+  exit 1
+fi
+
+
+for ((ind=0; ind < $tbboards; ind++)) do
+        tbbctl --testddr=$ind > tbb_memory$ind.log
+      done
+
+for ((ind=0; ind < $tbboards; ind++)) do
+            diff tbb_memory$ind.log gold/tbb_memory$ind.gold > tbb_memory$ind.diff
+            if [ -e tbb_memory$ind.log ] && [ -e gold/tbb_memory$ind.gold ] && [ -e tbb_memory$ind.diff ] && ! [ -s tbb_memory$ind.diff ]; then
+              # The files exists AND has the diff size 0
+              echo "TBB memory ($ind) test went OK"
+            else
+              echo "TBB memory ($ind) test went wrong"
+            fi
+      done
+
diff --git a/StationTest/tbb_prbs_tester.sh b/StationTest/tbb_prbs_tester.sh
index 5b30e1022d0c2616264db38dca5818066520a686..df1addc5716d2326ff8b9b5e1cadec32a28fd577 100644
--- a/StationTest/tbb_prbs_tester.sh
+++ b/StationTest/tbb_prbs_tester.sh
@@ -1,48 +1,48 @@
-#!/bin/bash
-
-#
-# Test the LVDS interfaces between RCU -> RSP -> TBB using the Pseudo Random generator in the RCUs.
-#
-
-let rspboards=`sed -n  's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
-let nof_rcu=8*$rspboards
-
-rm -f *.log
-rm -f *.diff
-rm -f ./prbs/*.*
-
-
-# Set up RCU and RSP, make sure waveform generator is off
-rspctl --rcuprsg=1
-sleep 1
-rspctl --tbbmode=transient
-
-sleep 5
-# set up TBB
-nof_slices=10   # one slice contains 1024 transient (raw data) samples
-
-tbbctl --free
-tbbctl --alloc
-tbbctl --rec
-
-sleep 0.1
-
-# Freeze and get the captured data from TBB
-cd ./prbs
-tbbctl --stop
-for ((i = 0; i < $nof_rcu; i++)) do
-  tbbctl --readpage=$i,0,$nof_slices
-done
-cd ..
-# Verify the PRBS
-python prbs_dir_test.py
-
-
-echo ""
-diff prbs_dir_test.log ./gold/prbs_dir_test.gold > prbs_dir_test.diff
-if [ -e prbs_dir_test.log ] && [ -e ./gold/prbs_dir_test.gold ] && [ -e prbs_dir_test.diff ] && ! [ -s prbs_dir_test.diff ]; then
-  # The files exists AND has the diff size 0
-  echo "RCU -> RSP -> TBB interfaces test went OK"
-else
-  echo "RCU -> RSP -> TBB interfaces test went wrong"
-fi
+#!/bin/bash
+
+#
+# Test the LVDS interfaces between RCU -> RSP -> TBB using the Pseudo Random generator in the RCUs.
+#
+
+let rspboards=`sed -n  's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf`
+let nof_rcu=8*$rspboards
+
+rm -f *.log
+rm -f *.diff
+rm -f ./prbs/*.*
+
+
+# Set up RCU and RSP, make sure waveform generator is off
+rspctl --rcuprsg=1
+sleep 1
+rspctl --tbbmode=transient
+
+sleep 5
+# set up TBB
+nof_slices=10   # one slice contains 1024 transient (raw data) samples
+
+tbbctl --free
+tbbctl --alloc
+tbbctl --rec
+
+sleep 0.1
+
+# Freeze and get the captured data from TBB
+cd ./prbs
+tbbctl --stop
+for ((i = 0; i < $nof_rcu; i++)) do
+  tbbctl --readpage=$i,0,$nof_slices
+done
+cd ..
+# Verify the PRBS
+python prbs_dir_test.py
+
+
+echo ""
+diff prbs_dir_test.log ./gold/prbs_dir_test.gold > prbs_dir_test.diff
+if [ -e prbs_dir_test.log ] && [ -e ./gold/prbs_dir_test.gold ] && [ -e prbs_dir_test.diff ] && ! [ -s prbs_dir_test.diff ]; then
+  # The files exists AND has the diff size 0
+  echo "RCU -> RSP -> TBB interfaces test went OK"
+else
+  echo "RCU -> RSP -> TBB interfaces test went wrong"
+fi
diff --git a/StationTest/tbb_size.sh b/StationTest/tbb_size.sh
index 89950d40c88627f69b094d6798a88b05343e72c7..bb54250a43a44392a800a639cae54f3c215fe49e 100644
--- a/StationTest/tbb_size.sh
+++ b/StationTest/tbb_size.sh
@@ -1,16 +1,16 @@
-#!/bin/bash
-
-#
-# Get version info from the TBB boards and compare this with the expected golden result.
-#
-
-rm -f tbb_size.log
-rm -f tbb_size.diff
-tbbctl --size > tbb_size.log
-diff tbb_size.log gold/tbb_size.gold > tbb_size.diff
-if [ -e tbb_size.log ] && [ -e gold/tbb_size.gold ] && [ -e tbb_size.diff ] && ! [ -s tbb_size.diff ]; then
-  # The files exists AND has the diff size 0
-  echo "TBB memory size test went OK"
-else
-  echo "TBB memory size test went wrong"
-fi
+#!/bin/bash
+
+#
+# Get version info from the TBB boards and compare this with the expected golden result.
+#
+
+rm -f tbb_size.log
+rm -f tbb_size.diff
+tbbctl --size > tbb_size.log
+diff tbb_size.log gold/tbb_size.gold > tbb_size.diff
+if [ -e tbb_size.log ] && [ -e gold/tbb_size.gold ] && [ -e tbb_size.diff ] && ! [ -s tbb_size.diff ]; then
+  # The files exists AND has the diff size 0
+  echo "TBB memory size test went OK"
+else
+  echo "TBB memory size test went wrong"
+fi
diff --git a/StationTest/tbb_version.sh b/StationTest/tbb_version.sh
index 3f8e8063442719bd7d298c43fb08f16f6f8a912d..0295338c4e87a220df6c28292d54a6f38f94e29e 100644
--- a/StationTest/tbb_version.sh
+++ b/StationTest/tbb_version.sh
@@ -1,16 +1,16 @@
-#!/bin/bash
-
-#
-# Get version info from the TBB boards and compare this with the expected golden result.
-#
-
-rm -f tbb_version.log
-rm -f tbb_version.diff
-tbbctl --version > tbb_version.log
-diff tbb_version.log gold/tbb_version.gold > tbb_version.diff
-if [ -e tbb_version.log ] && [ -e gold/tbb_version.gold ] && [ -e tbb_version.diff ] && ! [ -s tbb_version.diff ]; then
-  # The files exists AND has the diff size 0
-  echo "TBB version test went OK"
-else
-  echo "TBB version test went wrong"
-fi
+#!/bin/bash
+
+#
+# Get version info from the TBB boards and compare this with the expected golden result.
+#
+
+rm -f tbb_version.log
+rm -f tbb_version.diff
+tbbctl --version > tbb_version.log
+diff tbb_version.log gold/tbb_version.gold > tbb_version.diff
+if [ -e tbb_version.log ] && [ -e gold/tbb_version.gold ] && [ -e tbb_version.diff ] && ! [ -s tbb_version.diff ]; then
+  # The files exists AND has the diff size 0
+  echo "TBB version test went OK"
+else
+  echo "TBB version test went wrong"
+fi
diff --git a/StationTest/test/Makefile.am b/StationTest/test/Makefile.am
index 3e5492f55f0a6ad9c93f10812d0d5b177eccfe20..6a781a30143b2bf3cdf14b8d21609eac93c558e7 100644
--- a/StationTest/test/Makefile.am
+++ b/StationTest/test/Makefile.am
@@ -1,3 +1,4 @@
-SUBDIRS = beamformertest hbatest hbatest/gold subbandstatistics systemnoise timing xcstatistics
+SUBDIRS = beamformertest hbatest hbatest/gold subbandstatistics \ 
+          systemnoise timing xcstatistics envcontroltest
 
 include $(top_srcdir)/Makefile.common
diff --git a/StationTest/test/envcontroltest/Makefile.am b/StationTest/test/envcontroltest/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..200e0b31f37b02d4de8aab6197b6da0000d0231a
--- /dev/null
+++ b/StationTest/test/envcontroltest/Makefile.am
@@ -0,0 +1,5 @@
+testdir	=  $(prefix)/stationtest/envcontroltest
+
+test_SCRIPTS = 	$(srcdir)/*.py
+
+include $(top_srcdir)/Makefile.common