#!/bin/bash

case $1 in
   config)
        cat <<'EOM'
graph_title Agilent voltage
graph_vlabel volt
graph_category environment
agilent_volt1.label Camera voltage (51V)
agilent_volt2.label Interlock voltage (24V)
agilent_volt3.label Bias voltage (90V)
EOM
        exit 0;;
esac

DATA220=`echo -e -n "meas:volt?\n" | nc 10.0.100.220 5025`
RC220=$?

if [ "$RC220" == "0" ] ; then
   echo agilent_volt1.value `printf %.3f ${DATA220}`
fi

DATA222=`echo -e -n "meas:volt?\n" | nc 10.0.100.222 5025`
RC222=$?

if [ "$RC222" == "0" ] ; then
   echo agilent_volt3.value `printf %.3f ${DATA222}`
fi

DATA224=`echo -e -n "meas:volt?\n" | nc 10.0.100.224 5025`
RC224=$?

if [ "$RC224" == "0" ] ; then
   echo agilent_volt2.value `printf %.3f ${DATA224}`
fi

