Files
sics/counter.h
Ferdi Franceschini cff9290272 SICS-195
countdriv.h
CounterDriver:  iControlMonitor id (default=0)

countdriv.c
CreateCounterDriver: set the default control monitor to channel zero

counter.h
counter.c
Commands to get and set the control monitor
GetCounts return the counts from the current control monitor, ie iControlMonitor
TODO loadCountData, get time from controlling monitor.

scan.c
Set control monitor on counter when setting scan channel

multicounter.c
MMCStart, set slave monitors with a  timer preset of about a year to make sure that they don't stop before the controlling monitor.

r2642 | ffr | 2008-07-10 15:21:21 +1000 (Thu, 10 Jul 2008) | 20 lines
2012-11-15 13:39:59 +11:00

62 lines
2.2 KiB
C

/*-------------------------------------------------------------------------
C O U N T E R
The SICS Interface to a single detector and his associated
monitors.
Mark Koennecke, January 1996
copyright: see implementation file.
----------------------------------------------------------------------------*/
#ifndef SICSCOUNTER
#define SICSCOUNTER
#include "countdriv.h"
typedef struct {
pObjectDescriptor pDes;
char *name;
int isUpToDate;
int iExponent;
pICountable pCountInt;
pCounterDriver pDriv;
pICallBack pCall;
unsigned long tStart;
int iCallbackCounter;
int badStatusCount;
} Counter, *pCounter;
/*----------------------------- birth & death -----------------------------*/
pCounter CreateCounter(char *name, pCounterDriver pDriv);
void DeleteCounter(void *self);
int MakeCounter(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
/*------------------------- set/get Parameters ----------------------------*/
int SetCounterMode(pCounter self, CounterMode eNew);
CounterMode GetCounterMode(pCounter self);
int SetCounterPreset(pCounter self, float fVal);
float GetCounterPreset(pCounter self);
long GetCounts(pCounter self, SConnection *pCon);
long GetMonitor(pCounter self, int iNum, SConnection *pCon);
int GetNMonitor(pCounter self);
int GetControlMonitor(pCounter self);
int SetControlMonitor(pCounter self, int channel);
void SetMonitorValue(pCounter self, int index, long value);
float GetCountTime(pCounter self, SConnection *pCon);
int DoCount(pCounter self,float fPreset, SConnection *pCon,
int iBlock);
/*-------------------------------------------------------------------------
the real action: starting and checking is packaged with the
ObjectDescriptor.
*/
int CountAction(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
#endif