This is Unofficial EPICS BASE Doxygen Site
devCalcoutSoftCallback.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 /* devCalcoutSoftCallback.c */
10 
11 /*
12  * Author: Marty Kraimer
13  * Date: 05DEC2003
14  */
15 
16 #include <stdlib.h>
17 #include <stdio.h>
18 #include <string.h>
19 
20 #include "alarm.h"
21 #include "dbDefs.h"
22 #include "dbAccess.h"
23 #include "recGbl.h"
24 #include "recSup.h"
25 #include "devSup.h"
26 #include "link.h"
27 #include "special.h"
28 #include "postfix.h"
29 #include "calcoutRecord.h"
30 #include "epicsExport.h"
31 
32 static long write_calcout(calcoutRecord *prec);
33 
34 calcoutdset devCalcoutSoftCallback = {
35  {5, NULL, NULL, NULL, NULL},
36  write_calcout
37 };
39 
40 static long write_calcout(calcoutRecord *prec)
41 {
42  struct link *plink = &prec->out;
43  long status;
44 
45  if (prec->pact)
46  return 0;
47 
48  status = dbPutLinkAsync(plink, DBR_DOUBLE, &prec->oval, 1);
49  if (!status)
50  prec->pact = TRUE;
51  else if (status == S_db_noLSET)
52  status = dbPutLink(plink, DBR_DOUBLE, &prec->oval, 1);
53 
54  return 0;
55 }
56 
calcoutdset devCalcoutSoftCallback
pvd::Status status
The API for the EPICS Calculation Engine.
#define NULL
Definition: catime.c:38
Miscellaneous macro definitions.
Device support routines.
Definition: devSup.h:140
#define DBR_DOUBLE
Definition: db_access.h:76
epicsExportAddress(dset, devCalcoutSoftCallback)
#define TRUE
Definition: dbDefs.h:27
int prec
Definition: reader.c:29
Exporting IOC objects.