190 lines
3.4 KiB
C
190 lines
3.4 KiB
C
/********************************************************************\
|
|
|
|
Name: el734dev.h
|
|
Created by: RA35
|
|
|
|
Contents: Device driver function declarations for el734 device
|
|
|
|
\********************************************************************/
|
|
|
|
#ifndef _EL734DEV_H_
|
|
|
|
#include "midas.h"
|
|
|
|
INT el734dev(INT cmd, ...);
|
|
|
|
#ifdef MAXMOT4
|
|
#define MAXMOT 4
|
|
#endif
|
|
|
|
#ifdef MAXMOT12
|
|
#ifndef MAXMOT
|
|
#define MAXMOT 12
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef MAXMOT
|
|
#define MAXMOT 4
|
|
#endif
|
|
|
|
typedef struct {
|
|
char instrument[16];
|
|
char initflag;
|
|
double lowerlim[MAXMOT];
|
|
double upperlim[MAXMOT];
|
|
double tolerance[MAXMOT];
|
|
char title[MAXMOT];
|
|
int mcstatus[MAXMOT];
|
|
int msrstatus[MAXMOT];
|
|
} EL734_SETTINGS;
|
|
|
|
#if MAXMOT == 4
|
|
#define EL734_SETTINGS_STR "\
|
|
Instrument = STRING : [16] NONE\n\
|
|
Init = CHAR : N\n\
|
|
LowerLim = DOUBLE[4]:\n\
|
|
[0] 0.0\n\
|
|
[1] 0.0\n\
|
|
[2] 0.0\n\
|
|
[3] 0.0\n\
|
|
UpperLim = DOUBLE[4]:\n\
|
|
[0] 0.0\n\
|
|
[1] 0.0\n\
|
|
[2] 0.0\n\
|
|
[3] 0.0\n\
|
|
Tolerance = DOUBLE[4]:\n\
|
|
[0] 0.0\n\
|
|
[1] 0.0\n\
|
|
[2] 0.0\n\
|
|
Title = CHAR[4]:\n\
|
|
[0] N\n\
|
|
[1] N\n\
|
|
[2] N\n\
|
|
[3] N\n\
|
|
MCStatus = INT[4]:\n\
|
|
[0] 0\n\
|
|
[1] 0\n\
|
|
[2] 0\n\
|
|
[3] 0\n\
|
|
MSRStatus = INT[4]:\n\
|
|
[0] 0\n\
|
|
[1] 0\n\
|
|
[2] 0\n\
|
|
[3] 0\n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
|
|
[11] 0\n\
|
|
MSRStatus = INT[12]:\n\
|
|
[0] 0\n\
|
|
[1] 0\n\
|
|
[2] 0\n\
|
|
[3] 0\n\
|
|
[4] 0\n\
|
|
[5] 0\n\
|
|
[6] 0\n\
|
|
[7] 0\n\
|
|
[8] 0\n\
|
|
[9] 0\n\
|
|
[10] 0\n\
|
|
[11] 0\n\
|
|
"
|
|
#else
|
|
NUMBER OF MOTORS IS NOT SUPPORTED
|
|
#endif
|
|
|
|
/* following structure contains private variables to the device
|
|
driver. It is necessary to store it here in case the device
|
|
driver is used for more than one device in one frontend. If it
|
|
would be stored in a global variable, one device could over-
|
|
write the other device's variables. */
|
|
typedef struct {
|
|
EL734_SETTINGS el734_settings;
|
|
float *array;
|
|
INT num_channels;
|
|
INT(*bd) (INT cmd, ...); /* bus driver entry function */
|
|
void *bd_info; /* private info of bus driver */
|
|
HNDLE hkey; /* ODB key for bus driver info */
|
|
HNDLE hkeyMCStatus; /* ODB key for MCStatus[i] device driver setting */
|
|
HNDLE hkeyMSRStatus; /* ODB key for MSRStatus[i] device driver setting */
|
|
DWORD last_set;
|
|
DWORD last_reading;
|
|
INT comerror;
|
|
INT errorcount;
|
|
char name[NAME_LENGTH]; //!< equipment <name>
|
|
int ndigits[MAXMOT]; //!< number of digits on display
|
|
INT cindex; //! channel index to update
|
|
HNDLE hmkey; //! handle of measured key
|
|
} EL734_INFO;
|
|
|
|
#define _EL734DEV_H_
|
|
|
|
#endif /* #ifndef _EL734DEV_H_ */
|
|
|
|
/* ----------------------------------------------------- el734dev.h */ |