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