This is Unofficial EPICS BASE Doxygen Site
permissiveRecord.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 
10 /* recPermissive.c - Record Support Routines for Permissive records */
11 /*
12  * Original Author: Bob Dalesio
13  * Date: 10-10-90
14  */
15 
16 #include <stddef.h>
17 #include <stdlib.h>
18 #include <stdarg.h>
19 #include <stdio.h>
20 #include <string.h>
21 
22 #include "dbDefs.h"
23 #include "epicsPrint.h"
24 #include "dbAccess.h"
25 #include "dbEvent.h"
26 #include "dbFldTypes.h"
27 #include "errMdef.h"
28 #include "recSup.h"
29 #include "recGbl.h"
30 
31 #define GEN_SIZE_OFFSET
32 #include "permissiveRecord.h"
33 #undef GEN_SIZE_OFFSET
34 #include "epicsExport.h"
35 
36 /* Create RSET - Record Support Entry Table*/
37 #define report NULL
38 #define initialize NULL
39 #define init_record NULL
40 static long process(struct dbCommon *);
41 #define special NULL
42 #define get_value NULL
43 #define cvt_dbaddr NULL
44 #define get_array_info NULL
45 #define put_array_info NULL
46 #define get_units NULL
47 #define get_precision NULL
48 #define get_enum_str NULL
49 #define get_enum_strs NULL
50 #define put_enum_str NULL
51 #define get_graphic_double NULL
52 #define get_control_double NULL
53 #define get_alarm_double NULL
54 
56  RSETNUMBER,
57  report,
58  initialize,
60  process,
61  special,
62  get_value,
63  cvt_dbaddr,
66  get_units,
74 };
75 epicsExportAddress(rset,permissiveRSET);
76 
77 static void monitor(permissiveRecord *);
78 
79 static long process(struct dbCommon *pcommon)
80 {
81  struct permissiveRecord *prec = (struct permissiveRecord *)pcommon;
82 
83  prec->pact=TRUE;
84  prec->udf=FALSE;
85  recGblGetTimeStamp(prec);
86  monitor(prec);
87  recGblFwdLink(prec);
88  prec->pact=FALSE;
89  return(0);
90 }
91 
92 static void monitor(permissiveRecord *prec)
93 {
94  unsigned short monitor_mask;
95  unsigned short val,oval,wflg,oflg;
96 
97  monitor_mask = recGblResetAlarms(prec);
98  /* get val,oval,wflg,oflg*/
99  val=prec->val;
100  oval=prec->oval;
101  wflg=prec->wflg;
102  oflg=prec->oflg;
103  /*set oval and oflg*/
104  prec->oval = val;
105  prec->oflg = wflg;
106  if(oval != val) {
107  db_post_events(prec,&prec->val,
108  monitor_mask|DBE_VALUE|DBE_LOG);
109  }
110  if(oflg != wflg) {
111  db_post_events(prec,&prec->wflg,
112  monitor_mask|DBE_VALUE|DBE_LOG);
113  }
114  return;
115 }
#define initialize
#define RSETNUMBER
Definition: recSup.h:92
#define FALSE
Definition: dbDefs.h:32
#define report
#define init_record
#define get_enum_strs
#define get_value
rset permissiveRSET
Miscellaneous macro definitions.
#define DBE_VALUE
Definition: caeventmask.h:38
#define special
#define cvt_dbaddr
#define DBE_LOG
Definition: caeventmask.h:40
#define put_enum_str
epicsExportAddress(rset, permissiveRSET)
#define get_precision
#define TRUE
Definition: dbDefs.h:27
#define put_array_info
Definition: recSup.h:67
#define get_units
#define get_alarm_double
#define get_graphic_double
#define get_enum_str
#define get_control_double
int prec
Definition: reader.c:29
#define get_array_info
Exporting IOC objects.