00001 /*********************************************************************** 00002 * 00003 * mar345: esd.h 00004 * 00005 * Copyright by: Dr. Claudio Klein 00006 * X-ray Research GmbH, Hamburg 00007 * 00008 * Version: 1.0 00009 * Date: 02/10/1997 00010 * 00011 ***********************************************************************/ 00012 00013 /* 00014 */ 00015 #define MAX_CMD 16 00016 00017 /* 00018 * IPS commands 00019 */ 00020 #define CMD_NULL 0 00021 #define CMD_STEP 1 00022 #define CMD_RADIAL 2 00023 #define CMD_XFER 3 00024 #define CMD_SHUTTER 4 00025 #define CMD_LOCK 5 00026 #define CMD_ABORT 6 00027 #define CMD_COLLECT 7 00028 #define CMD_ADC 8 00029 #define CMD_CHANGE 9 00030 #define CMD_SCAN 10 00031 #define CMD_SET 11 00032 #define CMD_ERASE 12 00033 #define CMD_MOVE 13 00034 #define CMD_ION_CHAMBER 14 00035 #define CMD_SHELL 15 00036 00037 #define CMD_MOVE_DISTANCE 31 00038 #define CMD_MOVE_OMEGA 32 00039 #define CMD_MOVE_CHI 33 00040 #define CMD_MOVE_THETA 34 00041 #define CMD_MOVE_RADIAL 35 00042 #define CMD_MOVE_PHI 36 00043 00044 /* 00045 * CMD_MOVE arguments 00046 */ 00047 #define ARG_DISTANCE 1 00048 #define ARG_OMEGA 2 00049 #define ARG_CHI 3 00050 #define ARG_THETA 4 00051 #define ARG_RADIAL 5 00052 #define ARG_PHI 6 00053 00054 #define ARG_MOVE_REL 0 00055 #define ARG_MOVE_ABS 1 00056 #define ARG_INIT_NEAR 2 00057 #define ARG_INIT_FAR 3 00058 #define ARG_STOP_SMOOTH 4 00059 #define ARG_STOP_NOW 5 00060 #define ARG_DEFINE 6 00061 00062 #define ARG_ABORT 0 00063 #define ARG_STOP 1 00064 #define ARG_GO 2 00065 00066 #define ARG_DOSE 1 00067 #define ARG_TIME 2 00068 00069 #define ARG_CLOSE 0 00070 #define ARG_OPEN 1 00071 00072 #define ARG_DISABLE 0 00073 #define ARG_ENABLE 1 00074 00075 #define ARG_READ 0 00076 #define ARG_WRITE 1 00077 #define ARG_SETDEF -1 00078 00079 #define STEPPER_IST 0 00080 #define STEPPER_SOLL 1 00081 #define STEPPER_STATUS 2 00082 00083 typedef struct _esd_cmd { 00084 char id[4]; 00085 int cmd; 00086 int mode; 00087 int par1; 00088 int par2; 00089 int par3; 00090 int par4; 00091 int par5; 00092 char str[28]; 00093 } ESD_CMD; 00094 00095 typedef struct _esd_msg { 00096 char id[4]; 00097 char str[80]; 00098 } ESD_MSG; 00099 00100 /* 00101 * ESD controller status block definition. 00102 */ 00103 00104 typedef struct _esd_stb { 00105 00106 int stepper[6][3]; /* 1-18: Stepper motors * 00107 * 6 x IST,SOLL,STATUS fuer: * 00108 * DISTANCE, OMEGA, CHI, * 00109 * THETA, RADIAL, PHI */ 00110 int hw_status1; /* 19: Hardware status bits */ 00111 int task[20]; /* 20-39: Task bit list */ 00112 int valid_data; /* 40: Scanned data */ 00113 int intensity; /* 41: X-ray intensity */ 00114 int scanmode; /* 42: Current scan mode */ 00115 int adc1; /* 43: ADC offset 1 */ 00116 int adc2; /* 44: ADC offset 2 */ 00117 int delay_open; /* 45: Shutter open delay time */ 00118 int delay_close; /* 46: Shutter close delay time */ 00119 int servo_state; /* 47: Status of SERVO system */ 00120 int gaps[12]; /* 48-59: GAP positions */ 00121 int servo_error; /* 60: Servo error status */ 00122 int servo_opmode; /* 61: Servo opmode input */ 00123 int counter; /* 62: Status counter */ 00124 int unused1[ 7]; /* 63-69: Unused */ 00125 int errors [10]; /* 70-79: Error message buffer */ 00126 int unused2[21]; /*80-100: Unused */ 00127 } ESD_STB; 00128 00129 #ifdef MAR_GLOBAL 00130 ESD_CMD esd_cmd; 00131 ESD_MSG esd_msg; 00132 ESD_STB esd_stb; 00133 #else 00134 extern ESD_CMD esd_cmd; 00135 extern ESD_MSG esd_msg; 00136 extern ESD_STB esd_stb; 00137 #endif 00138 00139