diff --git a/eibApp/latex/EIB.out b/eibApp/latex/EIB.out index 9f53715..ebb8bee 100644 --- a/eibApp/latex/EIB.out +++ b/eibApp/latex/EIB.out @@ -3,5 +3,8 @@ \BOOKMARK [1][-]{section.2}{Startup}{}% 3 \BOOKMARK [2][-]{subsection.2.1}{Startup procedure}{section.2}% 4 \BOOKMARK [2][-]{subsection.2.2}{Configuration file EIB.CFG}{section.2}% 5 -\BOOKMARK [1][-]{section.3}{Heydeman correction}{}% 6 -\BOOKMARK [2][-]{subsection.3.1}{Take data}{section.3}% 7 +\BOOKMARK [1][-]{section.3}{Monitoring}{}% 6 +\BOOKMARK [2][-]{subsection.3.1}{Connectivity}{section.3}% 7 +\BOOKMARK [2][-]{subsection.3.2}{Signal loss}{section.3}% 8 +\BOOKMARK [1][-]{section.4}{Heydeman correction}{}% 9 +\BOOKMARK [2][-]{subsection.4.1}{Take data}{section.4}% 10 diff --git a/eibApp/latex/EIB.pdf b/eibApp/latex/EIB.pdf index 408dd6a..38ee89a 100644 Binary files a/eibApp/latex/EIB.pdf and b/eibApp/latex/EIB.pdf differ diff --git a/eibApp/latex/EIB.tex b/eibApp/latex/EIB.tex index 42794ab..b6a22be 100644 --- a/eibApp/latex/EIB.tex +++ b/eibApp/latex/EIB.tex @@ -276,6 +276,47 @@ If not it starts the softioc which performs several initialization steps: \end{center} x denotes the channel number 0,1,2,3. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Monitoring} + +\subsection{Connectivity} + \begin{itemize} + \item The task {\tt EIB$\_$Start$\_$PingTask} monitors the connection to the EIB74x hardware + and writes the status into the PV \PV{EIB:CONNECTED}. If the connection is interrupted it peridically tries to reconnect. + + \item After reestablishing the connection, the status of the index marks is read and the HOMED flags of the encoders are set accordingly. + \item If the EIB was powercycled, the HOMED flags are set to FALSE. + + \end{itemize} + + The same procedure applies after a restart of the softioc. + By this, the necessity of an new index search is avoided. + + +\subsection{Signal loss} + \begin{itemize} + \item When an encoder is disconnected while the softioc tries to read it, the EIB sets the flag "signal amplitude error" in the encoder status. + The softioc indicates this in the \PV {EIB:CH$\_$x$\_$SIGNALERROR}. + + \item Unfortunately, this works only when the encoder readout happens during the time when the encoder is disconnected. + If the encoder is removed and reconnected between two readouts, the encoder status does not reflect this in the "signal amplitude error" flag. + + \item What can be seen is that the status reports an "Frequency exceeded" in that case. + This could be reported to the user with a recommendation to start an index search. + + \end{itemize} + + + + + + + + + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Heydeman correction} diff --git a/eibApp/src/myEIB.c b/eibApp/src/myEIB.c index 78e6a1d..de6861c 100644 --- a/eibApp/src/myEIB.c +++ b/eibApp/src/myEIB.c @@ -162,6 +162,7 @@ int EIB_Connect (char *hostname); int EIB_Init_Enc(int enc_nr); /* initialize selected encoder */ void EIB_StopRef( int enc_nr); void EIB_Clear_RingBuffer(int enc_nr); +void EIB_ShowIO(void); /****************************************************************************/ void ReadHeyFile(char *filename, HEYARRAY *h) @@ -636,6 +637,9 @@ int i,j; eib.handle = 0; eib.connected= 0; eib.num = 0; /* how many axis? -> initialized in EIB_connect */ + + eib.input.num_ports =0; + eib.output.num_ports=0; strncpy(eib.fw_version, "\0", 20); sprintf(eib.hostname ,"EIB741-639546320.psi.ch"); @@ -660,6 +664,7 @@ int i,j; for (j=0;j= eib.output.num_ports) return(MON_ERROR); + if (port < 0 ) return(MON_ERROR); + + return(MON_NO_ERROR); +} + +/************************************************************************************/ +void EIB_SetOutput(int port, unsigned long level) { int err; - printf(" EIB7WriteIO[%i] to level = %li\n",port, level); + if ( EIB_ValidOutPort(port)) + { + if (verbose) + { + printf(" EIB7WriteIO: invalid port %i, maxport = %li\n",port, eib.output.num_ports); + } + return; + } + else + printf(" EIB7WriteIO[%i] to level = %li\n",port, level); - err = EIB7WriteIO(eib.output.set[port], level); - CheckError(err); - + err = EIB7WriteIO(eib.output.set[port], level); + + CheckError(err); + } + /************************************************************************************/ -void EIB_ReadIO(int port, unsigned long *level) +void EIB_ReadOutput(int port, unsigned long *level) +{ + EIB7_IOMODE mode; + int err; + + if (verbose) + { + if ( EIB_ValidOutPort(port)) + { + printf(" EIB_ReadOutput[%i]: invalid port , maxport = %li\n",port, eib.output.num_ports); + return; + } + else + printf("EIB_ReadOutput[%i]: level = %li\n",port, *level); + } + + + err = EIB7ReadIO(eib.output.set[port], &mode, level); + CheckError(err); + +} + +/************************************************************************************/ +void EIB_ReadInput(int port, unsigned long *level) { EIB7_IOMODE mode; int err; - err = EIB7ReadIO(eib.output.set[port], &mode, level); - -/* printf(" EIB7ReadIO[%i] \n",port ); - printf(" mode = %x\n" ,mode); - printf(" level = %li\n",*level); -*/ + err = EIB7ReadIO(eib.input.set[port], &mode, level); CheckError(err); } + /************************************************************************************/ void EIB_ShowIO(void) { int port; unsigned long level; - printf(" EIB_ShowIO: levels = "); - for (port=0;port