Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

scanPrivate.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 * E.S.O. - VLT project
00003 *
00004 * "@(#) $Id: scanPrivate.h,v 2.52 2003/11/08 21:12:07 vltsccm Exp $"
00005 *
00006 * <scanPrivate.h> - CCS/SCAN SYSTEM private interface file
00007 *
00008 * who        when      what
00009 * ---------  --------  ---------------------------------------------- 
00010 * B.Gilli    06/11/95  added field for PRBX intervalMSecs for Rtap 6.6
00011 * B.Gilli    25/02/97  removed reference to dbPrivate include.
00012 * B.Gilli    26/04/00  removed refs to booking, obsolete with 200011
00013 *
00014 ******************************************************************************
00015 */
00016 #ifndef SCAN_PRIVATE_H
00017 #define SCAN_PRIVATE_H
00018 
00019 #include "ccs.h"
00020 #include "db.h"
00021 #include "tims.h"
00022 #include "timer.h"
00023 #include "err.h"
00024 #include "log.h"
00025 #include "msg.h"
00026 #include "evt.h"
00027 
00028 #ifndef MAKE_VXWORKS
00029 #include "ccsRtap.h"
00030 #include "scanCCS.h"
00031 #ifndef CCS_LIGHT
00032 #   include <rtap/scan.h>
00033 #   define  scanOTHER_MANAGER  "scanMngr"
00034 #else
00035 #   define  scanOTHER_MANAGER  "RtapScanMngr"
00036 #   include "scanLiteInternal.h"
00037 #endif
00038 /* #   include "bookPrivate.h"    Obsolete */
00039 #endif
00040 
00041 /*
00042  * DEFINITIONS
00043  */
00044 #define scanOUT_TASK_NAME         "scanOut"      /* name of scanOut task                */
00045 #define scanOUT_TABLE             "scan output"  /* sym. name of scan output table      */
00046 #define scanOUT_TABLE_NO_FIELDS   16             /* scan output table: number of fields */
00047 #define scanMAX_PRBX_TYPES        32             /* max. number of polling periods      */
00048 #define scanINPUT_TBL_AIN          6             /* AIN of scan input table              */
00049 #define scanENV_AIN               14             /* AIN of scanOut environment attribute */
00050 #define scanPROCNUM_AIN           15             /* AIN of scanOut environment name      */
00051 #define scanOUT_EVENT_DELAY       250000         /* max. delay for sending SRBX data     */
00052 #define scanINPUT_TBL_FIELDS      17
00053 
00054 /*
00055  * comm-port defintions
00056  */
00057 #define scanLAN_POINT       "<alias>LAN"   /* point where to fing debug information attribute */
00058 
00059 /*
00060  * LCU 'scan device' Point: device dependent Attribute names
00061  */
00062 #define SD_DEVICE_STATS       ".device stats"
00063 #define SD_DEBUG_MODE         ".debug mode"
00064 #define SD_SCANOUT_PROCNUM    ".scanOut ProcNum"
00065 #define SD_SCANOUT_ENV        ".scanOut environment"
00066 #define SD_RESTART_FLAG       ".restart flag"
00067 #define SD_RESTART_DELAY      ".restart delay"
00068 
00069 #define SI_NO_OF_LCU_FIELDS     7
00070 
00071 /*
00072  * Definitions for communications statistics table
00073  * Field numbers in "device stats" Attribute of scan device Point
00074  */
00075 #define TRANS_ATTEMPTS          0
00076 #define TRANS_SUCCESS           1
00077 #define TIMEOUT_ERR             2
00078 #define CONFIG_ERR              3
00079 #define LCU_ERR                 4
00080 #define DEVICE_STATS_SIZE       5      /* used for dimensioning arrays */
00081 
00082 /*
00083  * Rtap message numbers used for scan system : 10 numbers starting with :
00084  */                   
00085 #define  scanMESSAGE       msgTYPE_SCAN_OFFSET
00086 #define  scanREP           (scanMESSAGE + 1)
00087 #define  scanBUF           (scanMESSAGE + 2)
00088 #define  scanCONTROL       (scanMESSAGE + 3)
00089 #define  scanCONTROL_REPLY (scanMESSAGE + 4)
00090 
00091 /*
00092  * ScanOut operations :
00093  */
00094 #define  scanENABLE          1
00095 #define  scanGO              2
00096 #define  scanDISABLE         3
00097 #define  scanDEL             5
00098 #define  scanENABLE_PT       9
00099 #define  scanDISABLE_PT     10
00100 
00101 /*
00102  * command used for timerSendCommand()
00103  */
00104 #define scanTIMER_CMD  "SCANPO"
00105 #define scanEVENT_SEND "SCANEV"
00106 #define scanDES_CMD    "SCANDES"
00107 
00108 /*
00109  * data acquisition modes
00110  */
00111 #define  POLL           1
00112 #define  SRBX           2
00113     
00114 /* 
00115  * scan output table record;
00116  * if something is changed in this structure 
00117  * compare with definition of scanINPUT_NBR_FIELD
00118  */
00119 typedef struct 
00120     {                   
00121     vltLOGICAL      point_control;
00122     vltUINT8        point_status;
00123     vltUINT16       reserved1;
00124     vltUINT16       element_count;
00125     vltUINT16       start_address;
00126     vltUINT8        org_id;
00127     vltUINT8        dbnr;
00128     vltUINT8        bit_position;
00129     vltUINT8        deadband_type;
00130     vltUINT32       eventId;
00131     vltDOUBLE       deadband;
00132     vltBYTES4       poll_type_mask;
00133     vltUINT16       scanIn_num;
00134     vltUINT16       reserved2;
00135     vltDBXREF       link_address;
00136     vltUINT32       reserved3;
00137     } scanOUTPUT_TABLE_REC;
00138     
00139 /* scan reply message header */
00140 typedef struct 
00141     {
00142     vltUINT16    operation;     /* Returns the requested operation.   */
00143     vltUINT16    entries;       /* Number of following reply messages */
00144     vltUINT16    devicePlin;    /* PLIN of scan device point */
00145     } scanHEADER;
00146 
00147 /* header for scan data messages */    
00148 typedef struct
00149     {
00150     ccsTIMEVAL     timestamp;       /* times-tamp */
00151     vltUINT16      number;          /* number of parameters */
00152     vltUINT16      devicePlin;      /* PLIN of scan device point */
00153     vltUINT16      recMin;          
00154     vltUINT16      recMax;
00155     vltINT32       startByte;       /* start byte if multiple messages for one parameter */
00156     vltLOGICAL     multiple;        /* indicates if multiple messages for one parameter  */
00157     vltUINT8       reserved[3];    
00158     } scanBUFHEADER;
00159 
00160 typedef struct 
00161     {
00162     msgHEADER   msgHeader;
00163     union 
00164         {
00165         scanBUFHEADER bufHeader;
00166         scanHEADER    request;
00167         } type;
00168     char body[msgMAXLEN - sizeof(msgHEADER) - sizeof(scanBUFHEADER) - 1];
00169     } scanMSG;
00170 
00171 /* message body for a SRBX */
00172 typedef struct 
00173     {                  
00174     vltDOUBLE    deadband;          
00175     vltUINT8     deadband_type;
00176     vltUINT8     reserved[7];    
00177     } srbxBODY;
00178 
00179 /* body for ADD/DEL commands */
00180 typedef struct 
00181     {
00182     dbSYMADDRESS     attr_name;  /* Name of attribute to be scanned. */
00183     vltUINT16        mode;       /* SRBX or POLL as defined above    */
00184     vltUINT16        entry_in;   /* Index in the scan input table.   */
00185     vltUINT16        entry_out;  /* Index in the scan output table.  */
00186     vltUINT16        bufSize;    /* size of buffer allocated         */
00187     union {
00188           vltBYTES4  period;     /* Poll mask defining polling period. */
00189           srbxBODY   srbxBody;
00190           } body;
00191     } scanBODY;               
00192     
00193 /* 
00194  * replies
00195  */    
00196 typedef struct 
00197     {
00198     vltUINT16    entry_in;          /* Index in the scan input table.    */
00199     vltUINT16    entry_out;         /* Index in the scan output table.   */
00200     vltUINT16    bufSize;           /* number of bytes to be transferred */
00201     vltUINT8     result;            /* FAILED or SUCCESS                 */
00202     } scanREPBODY;
00203     
00204 /* 
00205  * message body for POLL
00206  * (this structure must be identical to rtPTypesRecord) 
00207  * with Rtap 6.6 this structure was not more aligned and 
00208  * we add two bytes.
00209  */
00210 typedef struct 
00211     {
00212     vltINT8   startDay;
00213     vltINT8   startHour;
00214     vltINT8   startMinute;
00215     vltINT8   startSecond;
00216     vltUINT8  intervalDays;
00217     vltUINT8  intervalHours;
00218     vltUINT16 intervalMins;
00219     vltUINT32 intervalSecs;
00220     vltUINT16 intervalMSecs; 
00221     vltUINT16 reserved;
00222     } scan_prbxBODY;
00223 
00224 #ifndef MAKE_VXWORKS
00225 /*
00226  * The 'scan input' record structure MUST be maintained such that its size
00227  * is a multiple of 8 bytes.  This is required to preserve proper alignment
00228  * on the Series 800.  The fixed portion is also required to meet these
00229  * criteria.
00230  */
00231 typedef struct  
00232     {
00233     rtScanInputRecord   fixed;
00234     rtUInt16            element_count;
00235     rtUInt16            scanOut_num;
00236     rtUInt8             lcu_deadband_type;
00237     rtUInt8             reserved2;
00238     rtUInt16            reserved3;
00239     rtDouble            lcu_deadband;
00240     rtBytes256          remote_name;
00241     } SiLcu;
00242 
00243 /*
00244  * internal used functions  (->interface)
00245  */
00246 ccsCOMPL_STAT  scanEnaDisAttr (rtSsCqAction  action, dbSYMADDRESS  attribute[],
00247                                vltUINT16     attrNbr, ccsERROR     *error);
00248 #endif
00249 
00250 #endif  /* !SCAN_PRIVATE_H */

Generated on Wed Dec 3 14:52:19 2003 for ATCS API by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001