This is Unofficial EPICS BASE Doxygen Site
link.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2010 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 /* link.h */
10 
11 /*
12  * Original Authors: Bob Dalesio, Marty Kraimer
13  */
14 
15 #ifndef INC_link_H
16 #define INC_link_H
17 
18 #include "dbDefs.h"
19 #include "ellLib.h"
20 #include "shareLib.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /* link types */
27 #define CONSTANT 0
28 #define PV_LINK 1
29 #define VME_IO 2
30 #define CAMAC_IO 3
31 #define AB_IO 4
32 #define GPIB_IO 5
33 #define BITBUS_IO 6
34 #define MACRO_LINK 7
35 #define JSON_LINK 8
36 #define PN_LINK 9
37 #define DB_LINK 10
38 #define CA_LINK 11
39 #define INST_IO 12 /* instrument */
40 #define BBGPIB_IO 13 /* bitbus -> gpib */
41 #define RF_IO 14
42 #define VXI_IO 15
43 #define LINK_NTYPES 16
44 typedef struct maplinkType {
45  char *strvalue;
46  int value;
47 } maplinkType;
48 
50 
51 #define VXIDYNAMIC 0
52 #define VXISTATIC 1
53 
54 /* structure of a PV_LINK DB_LINK and a CA_LINK */
55 /*Options defined by pvlMask */
56 #define pvlOptMsMode 0x3 /*Maximize Severity mode selection*/
57 #define pvlOptNMS 0 /*Don't Maximize Severity*/
58 #define pvlOptMS 1 /*Maximize Severity always*/
59 #define pvlOptMSI 2 /*Maximize Severity if INVALID*/
60 #define pvlOptMSS 3 /*Maximize Severity and copy Status*/
61 #define pvlOptPP 0x4 /*Process Passive*/
62 #define pvlOptCA 0x8 /*Always make it a CA link*/
63 #define pvlOptCP 0x10 /*CA + process on monitor*/
64 #define pvlOptCPP 0x20 /*CA + process passive record on monitor*/
65 #define pvlOptFWD 0x40 /*Generate ca_put for forward link*/
66 #define pvlOptInpNative 0x80 /*Input native*/
67 #define pvlOptInpString 0x100 /*Input as string*/
68 #define pvlOptOutNative 0x200 /*Output native*/
69 #define pvlOptOutString 0x400 /*Output as string*/
70 
71 /* DBLINK Flag bits */
72 #define DBLINK_FLAG_INITIALIZED 1 /* dbInitLink() called */
73 #define DBLINK_FLAG_TSELisTIME 2 /* Use TSEL to get timeStamp */
74 
75 struct macro_link {
76  char *macroStr;
77 };
78 
79 struct dbCommon;
80 typedef long (*LINKCVT)();
81 
82 struct pv_link {
84  char *pvname; /* pvname link points to */
85  void *pvt; /* CA or DB private */
86  LINKCVT getCvt; /* input conversion function */
87  short pvlMask; /* Options mask */
88  short lastGetdbrType; /* last dbrType for DB or CA get */
89 };
90 
91 struct jlink;
92 struct json_link {
93  char *string;
94  struct jlink *jlink;
95 };
96 
97 /* structure of a VME io channel */
98 struct vmeio {
99  short card;
100  short signal;
101  char *parm;
102 };
103 
104 /* structure of a CAMAC io channel */
105 struct camacio {
106  short b;
107  short c;
108  short n;
109  short a;
110  short f;
111  char *parm;
112 };
113 
114 /* structure of a RF io channel */
115 struct rfio {
116  short branch;
117  short cryo;
118  short micro;
119  short dataset;
120  short element;
121  long ext;
122 };
123 
124 /* structure of a Allen-Bradley io channel */
125 struct abio {
126  short link;
127  short adapter;
128  short card;
129  short signal;
130  char *parm;
131 };
132 
133 /* structure of a gpib io channel */
134 struct gpibio {
135  short link;
136  short addr; /* device address */
137  char *parm;
138 };
139 
140 /* structure of a bitbus io channel */
141 struct bitbusio {
142  unsigned char link;
143  unsigned char node;
144  unsigned char port;
145  unsigned char signal;
146  char *parm;
147 };
148 
149 /* structure of a bitbus to gpib io channel */
150 struct bbgpibio {
151  unsigned char link;
152  unsigned char bbaddr;
153  unsigned char gpibaddr;
154  unsigned char pad;
155  char *parm;
156 };
157 
158 /* structure of an instrument io link */
159 struct instio {
160  char *string;
161 };
162 
163 /* structure of a vxi link */
164 struct vxiio {
165  short flag; /* 0 = frame/slot, 1 = SA */
166  short frame;
167  short slot;
168  short la; /* logical address if flag =1 */
169  short signal;
170  char *parm;
171 };
172 
173 /* union of possible address structures */
174 union value {
175  char *constantStr; /*constant string*/
176  struct macro_link macro_link; /* link containing macro substitution*/
177  struct json_link json; /* JSON-encoded link */
178  struct pv_link pv_link; /* link to process variable*/
179  struct vmeio vmeio; /* vme io point */
180  struct camacio camacio; /* camac io point */
181  struct rfio rfio; /* CEBAF RF buffer interface */
182  struct abio abio; /* allen-bradley io point */
183  struct gpibio gpibio;
185  struct instio instio; /* instrument io link */
186  struct bbgpibio bbgpibio; /* bitbus to gpib io link */
187  struct vxiio vxiio; /* vxi io */
188 };
189 
190 struct lset;
191 
192 struct link {
193  struct dbCommon *precord; /* Pointer to record owning link */
194  short type;
195  short flags;
196  struct lset *lset;
197  char *text; /* Raw link text */
198  union value value;
199 };
200 
201 typedef struct link DBLINK;
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 #endif /* INC_link_H */
char * parm
Definition: link.h:101
Definition: link.h:174
char * parm
Definition: link.h:155
Definition: link.h:115
short frame
Definition: link.h:166
Definition: link.h:164
short adapter
Definition: link.h:127
char * parm
Definition: link.h:111
short c
Definition: link.h:107
short link
Definition: link.h:126
short la
Definition: link.h:168
short signal
Definition: link.h:169
Definition: link.h:150
int value
Definition: link.h:46
Mark external symbols and entry points for shared libraries.
char * parm
Definition: link.h:130
unsigned char port
Definition: link.h:144
short branch
Definition: link.h:116
unsigned char node
Definition: link.h:143
Miscellaneous macro definitions.
short f
Definition: link.h:110
#define epicsShareExtern
Definition: shareLib.h:204
short signal
Definition: link.h:129
A doubly-linked list library.
short slot
Definition: link.h:167
Definition: link.h:159
short card
Definition: link.h:128
unsigned char gpibaddr
Definition: link.h:153
short signal
Definition: link.h:100
short dataset
Definition: link.h:119
short b
Definition: link.h:106
Definition: link.h:105
short addr
Definition: link.h:136
short micro
Definition: link.h:118
List node type.
Definition: ellLib.h:45
Definition: link.h:141
Definition: link.h:125
long ext
Definition: link.h:121
unsigned char signal
Definition: link.h:145
unsigned char link
Definition: link.h:151
short cryo
Definition: link.h:117
char * parm
Definition: link.h:146
char * constantStr
Definition: link.h:175
short n
Definition: link.h:108
short link
Definition: link.h:135
Definition: link.h:98
unsigned char link
Definition: link.h:142
short card
Definition: link.h:99
short flag
Definition: link.h:165
Definition: link.h:134
unsigned char bbaddr
Definition: link.h:152
char * strvalue
Definition: link.h:45
char * parm
Definition: link.h:170
unsigned char pad
Definition: link.h:154
char * string
Definition: link.h:160
short a
Definition: link.h:109
short element
Definition: link.h:120
char * parm
Definition: link.h:137