--- /dev/null
+#!/usr/bin/python
+
+## Had to add LD_LIBRARY_PATH to /etc/ld.so.conf.d/ipbus.conf afterwards: sudo ldconfig
+## Install IpBus uHal on the server maschine
+##
+
+import cgi
+import cgitb; cgitb.enable()
+import os
+import uhal
+import sys
+import json
+
+
+
+
+# Create instance of FieldStorage
+form = cgi.FieldStorage()
+
+# Get data from fields
+regName = form.getvalue('reg')
+
+if len(sys.argv) > 1:
+ regName = "CTRL"
+else:
+ print('Content-Type: application/json')
+ print('')
+
+if regName is None:
+ print "Invalid Register Name";
+else:
+
+ XmlPATH = "/home/hadaq/mRICH/ipBus/";
+ connectionFilePath = XmlPATH+"rich_DPB.xml";#sys.argv[1];
+ deviceId = "rich_DPB";
+ registerName = "rich."+regName;
+
+ uhal.disableLogging()
+ connectionMgr = uhal.ConnectionManager("file://" + connectionFilePath);
+ hw = connectionMgr.getDevice(deviceId);
+ node = hw.getNode(registerName)
+
+ reg = node.read();
+ hw.dispatch();
+
+ #print "Value =", hex(reg);
+
+ x = {}
+ x[regName] = hex(reg)
+
+ y = json.dumps(x)
+ print(y)
--- /dev/null
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use Time::HiRes qw( gettimeofday usleep time );
+use FileHandle;
+use Data::Dumper;
+use POSIX qw/floor ceil/;;
+use JSON::XS;
+
+use Dmon;
+
+my $fqa = Dmon::OpenQAFile();
+
+
+sub status {
+ my ($val) = shift(@_);
+
+ my $status = "";
+ if ($val == 0) {
+ $status = "OFF";
+ } else {
+ $status = "ON";
+ }
+
+ return $status;
+}
+
+
+while (1) {
+
+ my $test = qx(/dev/shm/dmon/code/getIpBus.py CTRL);
+ my $data = decode_json $test;
+
+ my $pulserVal = (hex($data->{CTRL}) >>1) & 0x1;
+
+ my $qastate = Dmon::OK;
+ # my $status = status($pulserVal);
+ Dmon::WriteQALog($fqa,"pulser", 40, $qastate, "Pulser", status($pulserVal) ,status($pulserVal));
+
+ my $extClkVal = (hex($data->{CTRL}) >> 0) & 0x1;
+ Dmon::WriteQALog($fqa,"extClk", 40, $qastate, "ext. Clock", status($extClkVal) ,status($extClkVal));
+ sleep 5;
+}