Merge ~dirk.zimoch/epics-base:mbbioDirect32bit into ~epics-core/epics-base/+git/epics-base:3.16
- Git
- lp:~dirk.zimoch/epics-base
- mbbioDirect32bit
- Merge into 3.16
Status: | Merged |
---|---|
Approved by: | Andrew Johnson |
Approved revision: | fbb9dca6a74e4d83d7d62e1d7ccbf23a60d4bcc3 |
Merge reported by: | Ralph Lange |
Merged at revision: | fbb9dca6a74e4d83d7d62e1d7ccbf23a60d4bcc3 |
Proposed branch: | ~dirk.zimoch/epics-base:mbbioDirect32bit |
Merge into: | ~epics-core/epics-base/+git/epics-base:3.16 |
Diff against target: |
983 lines (+510/-97) 13 files modified
documentation/RELEASE_NOTES.html (+14/-2) src/std/dev/devMbbiDirectSoft.c (+2/-2) src/std/dev/devMbbiDirectSoftCallback.c (+3/-3) src/std/dev/devMbbiDirectSoftRaw.c (+1/-1) src/std/dev/devMbboDirectSoft.c (+1/-1) src/std/dev/devMbboDirectSoftCallback.c (+2/-2) src/std/rec/mbbiDirectRecord.c (+6/-6) src/std/rec/mbbiDirectRecord.dbd (+89/-9) src/std/rec/mbboDirectRecord.c (+15/-15) src/std/rec/mbboDirectRecord.dbd (+168/-56) src/std/rec/test/Makefile (+7/-0) src/std/rec/test/mbbioDirectTest.c (+133/-0) src/std/rec/test/mbbioDirectTest.db (+69/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ralph Lange | Approve | ||
Andrew Johnson | Approve | ||
Review via email: mp+335440@code.launchpad.net |
This proposal supersedes a proposal from 2017-09-28.
Commit message
Description of the change
Extend mbbiDirect and mbboDirect records to 32 bit
ANJ: Resubmitted to change the target branch, master has just been renamed to 3.16.
Fixed mbboDirect simulation mode and some minor changes (LONG->ULONG, dbd prompt groups).
Testcase added.
Andrew Johnson (anj) wrote : Posted in a previous version of this proposal | # |
Dirk Zimoch (dirk.zimoch) wrote : Posted in a previous version of this proposal | # |
Release Notes updated.
Have the *Record.dbd.pod been created manually or have they been exported from the Wiki somehow?
Ralph Lange (ralph-lange) wrote : Posted in a previous version of this proposal | # |
Manually.
Have a look at the int64 records. These were the ones in which I combined different styles of pod doc done by Andrew into what I regard the current "state of the art" for those files.
Which does not mean these are final, perfect, or even usable. Improvement suggestions welcome.
Dirk Zimoch (dirk.zimoch) wrote : Posted in a previous version of this proposal | # |
In that case the .pod files have to wait until after the ICALEPCS. The tests as well.
Ralph Lange (ralph-lange) wrote : Posted in a previous version of this proposal | # |
Fine.
Just note that there is an ITER/CODAC driven end-of-October deadline for the initial release of EPICS 7. If you want these changes to go into that release, please leave enough time for review and merging.
Ralph Lange (ralph-lange) wrote : Posted in a previous version of this proposal | # |
Dirk,
We have renamed the target branch of your proposal (master -> 3.16), so that the pointer on this page is dangling now.
Could you please re-target this proposal to the 3.16 branch? Thank you, and sorry for the inconvenience!
Andrew Johnson (anj) wrote : Posted in a previous version of this proposal | # |
Resubmit this myself to fix the merge target...
Andrew Johnson (anj) wrote : | # |
Core Meeting: AI on RL to fix tests and merge.
Ralph Lange (ralph-lange) wrote : | # |
Merged (revamped) with async tests dropped.
Preview Diff
1 | diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html |
2 | index 3a3f0d3..903db75 100644 |
3 | --- a/documentation/RELEASE_NOTES.html |
4 | +++ b/documentation/RELEASE_NOTES.html |
5 | @@ -3,11 +3,13 @@ |
6 | <html> |
7 | <head> |
8 | <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> |
9 | - <title>EPICS Base R3.16.1 Release Notes</title> |
10 | + <title>EPICS Base R3.16.2 Release Notes</title> |
11 | </head> |
12 | |
13 | <body lang="en"> |
14 | -<h1 align="center">EPICS Base Release 3.16.1</h1> |
15 | +<h1 align="center">EPICS Base Release 3.16.2</h1> |
16 | + |
17 | +<h2 align="center">Changes made between 3.16.1 and 3.16.2</h2> |
18 | |
19 | <!-- Insert new items immediately below this template ... |
20 | |
21 | @@ -17,6 +19,16 @@ |
22 | |
23 | --> |
24 | |
25 | +<h3>Record types mbbiDirect and mbboDirect extented to 32 bit</h3> |
26 | + |
27 | +<p>The VAL fields of mbbiDirect and mbboDirect records have |
28 | +been extended from <tt>DBF_USHORT</tt> (16 bit) to <tt>DBF_LONG</tt> (32 bit). |
29 | +New bit fields <tt>B10</tt>...<tt>B1F</tt> have been added.</p> |
30 | + |
31 | +Device support which accesses the bit fields can test if the macro |
32 | +<tt>mbbiDirectRecord1BF</tt> or <tt>mbboDirectRecord1BF</tt> is |
33 | +defined. Device support which only accesses RVAL needs no modification. |
34 | + |
35 | <h2 align="center">Changes made between 3.16.0.1 and 3.16.1</h2> |
36 | |
37 | <h3>IOC Database Support for 64-bit integers</h3> |
38 | diff --git a/src/std/dev/devMbbiDirectSoft.c b/src/std/dev/devMbbiDirectSoft.c |
39 | index 9c929b2..861952f 100644 |
40 | --- a/src/std/dev/devMbbiDirectSoft.c |
41 | +++ b/src/std/dev/devMbbiDirectSoft.c |
42 | @@ -47,7 +47,7 @@ epicsExportAddress(dset, devMbbiDirectSoft); |
43 | |
44 | static long init_record(mbbiDirectRecord *prec) |
45 | { |
46 | - if (recGblInitConstantLink(&prec->inp, DBF_ENUM, &prec->val)) |
47 | + if (recGblInitConstantLink(&prec->inp, DBR_ULONG, &prec->val)) |
48 | prec->udf = FALSE; |
49 | |
50 | return 0; |
51 | @@ -56,7 +56,7 @@ static long init_record(mbbiDirectRecord *prec) |
52 | static long readLocked(struct link *pinp, void *dummy) |
53 | { |
54 | mbbiDirectRecord *prec = (mbbiDirectRecord *) pinp->precord; |
55 | - long status = dbGetLink(pinp, DBR_USHORT, &prec->val, 0, 0); |
56 | + long status = dbGetLink(pinp, DBR_ULONG, &prec->val, 0, 0); |
57 | |
58 | if (status) return status; |
59 | |
60 | diff --git a/src/std/dev/devMbbiDirectSoftCallback.c b/src/std/dev/devMbbiDirectSoftCallback.c |
61 | index 9301632..d785f73 100644 |
62 | --- a/src/std/dev/devMbbiDirectSoftCallback.c |
63 | +++ b/src/std/dev/devMbbiDirectSoftCallback.c |
64 | @@ -41,7 +41,7 @@ typedef struct devPvt { |
65 | struct { |
66 | DBRstatus |
67 | DBRtime |
68 | - epicsUInt16 value; |
69 | + epicsUInt32 value; |
70 | } buffer; |
71 | } devPvt; |
72 | |
73 | @@ -58,7 +58,7 @@ static void getCallback(processNotify *ppn, notifyGetType type) |
74 | } |
75 | |
76 | assert(type == getFieldType); |
77 | - pdevPvt->status = dbChannelGetField(ppn->chan, DBR_USHORT, |
78 | + pdevPvt->status = dbChannelGetField(ppn->chan, DBR_ULONG, |
79 | &pdevPvt->buffer, &pdevPvt->options, &no_elements, 0); |
80 | } |
81 | |
82 | @@ -153,7 +153,7 @@ static long init(int pass) |
83 | |
84 | static long init_record(mbbiDirectRecord *prec) |
85 | { |
86 | - if (recGblInitConstantLink(&prec->inp, DBR_ENUM, &prec->val)) |
87 | + if (recGblInitConstantLink(&prec->inp, DBR_ULONG, &prec->val)) |
88 | prec->udf = FALSE; |
89 | |
90 | return 0; |
91 | diff --git a/src/std/dev/devMbbiDirectSoftRaw.c b/src/std/dev/devMbbiDirectSoftRaw.c |
92 | index f6172cd..98b4673 100644 |
93 | --- a/src/std/dev/devMbbiDirectSoftRaw.c |
94 | +++ b/src/std/dev/devMbbiDirectSoftRaw.c |
95 | @@ -59,7 +59,7 @@ static long init_record(mbbiDirectRecord *prec) |
96 | |
97 | static long read_mbbi(mbbiDirectRecord *prec) |
98 | { |
99 | - if (!dbGetLink(&prec->inp, DBR_LONG, &prec->rval, 0, 0)) { |
100 | + if (!dbGetLink(&prec->inp, DBR_ULONG, &prec->rval, 0, 0)) { |
101 | prec->rval &= prec->mask; |
102 | if (dbLinkIsConstant(&prec->tsel) && |
103 | prec->tse == epicsTimeEventDeviceTime) |
104 | diff --git a/src/std/dev/devMbboDirectSoft.c b/src/std/dev/devMbboDirectSoft.c |
105 | index 0c08519..75359f2 100644 |
106 | --- a/src/std/dev/devMbboDirectSoft.c |
107 | +++ b/src/std/dev/devMbboDirectSoft.c |
108 | @@ -21,7 +21,7 @@ |
109 | |
110 | static long write_mbbo(mbboDirectRecord *prec) |
111 | { |
112 | - dbPutLink(&prec->out, DBR_USHORT, &prec->val, 1); |
113 | + dbPutLink(&prec->out, DBR_ULONG, &prec->val, 1); |
114 | return 0; |
115 | } |
116 | |
117 | diff --git a/src/std/dev/devMbboDirectSoftCallback.c b/src/std/dev/devMbboDirectSoftCallback.c |
118 | index e64c3d4..6d86507 100644 |
119 | --- a/src/std/dev/devMbboDirectSoftCallback.c |
120 | +++ b/src/std/dev/devMbboDirectSoftCallback.c |
121 | @@ -29,11 +29,11 @@ static long write_mbbo(mbboDirectRecord *prec) |
122 | if (prec->pact) |
123 | return 0; |
124 | |
125 | - status = dbPutLinkAsync(plink, DBR_USHORT, &prec->val, 1); |
126 | + status = dbPutLinkAsync(plink, DBR_ULONG, &prec->val, 1); |
127 | if (!status) |
128 | prec->pact = TRUE; |
129 | else if (status == S_db_noLSET) |
130 | - status = dbPutLink(plink, DBR_USHORT, &prec->val, 1); |
131 | + status = dbPutLink(plink, DBR_ULONG, &prec->val, 1); |
132 | |
133 | return status; |
134 | } |
135 | diff --git a/src/std/rec/mbbiDirectRecord.c b/src/std/rec/mbbiDirectRecord.c |
136 | index 1122729..7e0c418 100644 |
137 | --- a/src/std/rec/mbbiDirectRecord.c |
138 | +++ b/src/std/rec/mbbiDirectRecord.c |
139 | @@ -9,7 +9,7 @@ |
140 | * in file LICENSE that is included with this distribution. |
141 | \*************************************************************************/ |
142 | |
143 | -/* mbbiDirectRecord.c - Record Support routines for mbboDirect records */ |
144 | +/* mbbiDirectRecord.c - Record Support routines for mbbiDirect records */ |
145 | /* |
146 | * Original Authors: Bob Dalesio and Matthew Needes |
147 | * Date: 10-07-93 |
148 | @@ -92,7 +92,7 @@ struct mbbidset { /* multi bit binary input dset */ |
149 | static void monitor(mbbiDirectRecord *); |
150 | static long readValue(mbbiDirectRecord *); |
151 | |
152 | -#define NUM_BITS 16 |
153 | +#define NUM_BITS 32 |
154 | |
155 | static long init_record(struct dbCommon *pcommon, int pass) |
156 | { |
157 | @@ -114,7 +114,7 @@ static long init_record(struct dbCommon *pcommon, int pass) |
158 | } |
159 | |
160 | recGblInitConstantLink(&prec->siml, DBF_USHORT, &prec->simm); |
161 | - recGblInitConstantLink(&prec->siol, DBF_USHORT, &prec->sval); |
162 | + recGblInitConstantLink(&prec->siol, DBF_ULONG, &prec->sval); |
163 | |
164 | /* Initialize MASK if the user set NOBT instead */ |
165 | if (prec->mask == 0 && prec->nobt <= 32) |
166 | @@ -123,11 +123,11 @@ static long init_record(struct dbCommon *pcommon, int pass) |
167 | if (pdset->init_record) { |
168 | status = pdset->init_record(prec); |
169 | if (status == 0) { |
170 | - epicsUInt16 val = prec->val; |
171 | + epicsUInt32 val = prec->val; |
172 | epicsUInt8 *pBn = &prec->b0; |
173 | int i; |
174 | |
175 | - /* Initialize B0 - BF from VAL */ |
176 | + /* Initialize B0 - B1F from VAL */ |
177 | for (i = 0; i < NUM_BITS; i++, pBn++, val >>= 1) |
178 | *pBn = !! (val & 1); |
179 | } |
180 | @@ -188,7 +188,7 @@ static void monitor(mbbiDirectRecord *prec) |
181 | { |
182 | epicsUInt16 events = recGblResetAlarms(prec); |
183 | epicsUInt16 vl_events = events | DBE_VALUE | DBE_LOG; |
184 | - epicsUInt16 val = prec->val; |
185 | + epicsUInt32 val = prec->val; |
186 | epicsUInt8 *pBn = &prec->b0; |
187 | int i; |
188 | |
189 | diff --git a/src/std/rec/mbbiDirectRecord.dbd b/src/std/rec/mbbiDirectRecord.dbd |
190 | index 3fa3d88..0aa0cd4 100644 |
191 | --- a/src/std/rec/mbbiDirectRecord.dbd |
192 | +++ b/src/std/rec/mbbiDirectRecord.dbd |
193 | @@ -8,7 +8,7 @@ |
194 | #************************************************************************* |
195 | recordtype(mbbiDirect) { |
196 | include "dbCommon.dbd" |
197 | - field(VAL,DBF_USHORT) { |
198 | + field(VAL,DBF_LONG) { |
199 | prompt("Current Value") |
200 | promptgroup("40 - Input") |
201 | asl(ASL0) |
202 | @@ -39,7 +39,7 @@ recordtype(mbbiDirect) { |
203 | special(SPC_NOMOD) |
204 | interest(1) |
205 | } |
206 | - field(MLST,DBF_USHORT) { |
207 | + field(MLST,DBF_LONG) { |
208 | prompt("Last Value Monitored") |
209 | special(SPC_NOMOD) |
210 | interest(3) |
211 | @@ -54,7 +54,7 @@ recordtype(mbbiDirect) { |
212 | promptgroup("90 - Simulate") |
213 | interest(1) |
214 | } |
215 | - field(SVAL,DBF_ULONG) { |
216 | + field(SVAL,DBF_LONG) { |
217 | prompt("Simulation Value") |
218 | } |
219 | field(SIML,DBF_INLINK) { |
220 | @@ -124,32 +124,112 @@ recordtype(mbbiDirect) { |
221 | interest(1) |
222 | } |
223 | field(BA,DBF_UCHAR) { |
224 | - prompt("Bit A") |
225 | + prompt("Bit 10") |
226 | pp(TRUE) |
227 | interest(1) |
228 | } |
229 | field(BB,DBF_UCHAR) { |
230 | - prompt("Bit B") |
231 | + prompt("Bit 11") |
232 | pp(TRUE) |
233 | interest(1) |
234 | } |
235 | field(BC,DBF_UCHAR) { |
236 | - prompt("Bit C") |
237 | + prompt("Bit 12") |
238 | pp(TRUE) |
239 | interest(1) |
240 | } |
241 | field(BD,DBF_UCHAR) { |
242 | - prompt("Bit D") |
243 | + prompt("Bit 13") |
244 | pp(TRUE) |
245 | interest(1) |
246 | } |
247 | field(BE,DBF_UCHAR) { |
248 | - prompt("Bit E") |
249 | + prompt("Bit 14") |
250 | pp(TRUE) |
251 | interest(1) |
252 | } |
253 | field(BF,DBF_UCHAR) { |
254 | - prompt("Bit F") |
255 | + prompt("Bit 15") |
256 | + pp(TRUE) |
257 | + interest(1) |
258 | + } |
259 | + field(B10,DBF_UCHAR) { |
260 | + prompt("Bit 16") |
261 | + pp(TRUE) |
262 | + interest(1) |
263 | + } |
264 | + field(B11,DBF_UCHAR) { |
265 | + prompt("Bit 17") |
266 | + pp(TRUE) |
267 | + interest(1) |
268 | + } |
269 | + field(B12,DBF_UCHAR) { |
270 | + prompt("Bit 18") |
271 | + pp(TRUE) |
272 | + interest(1) |
273 | + } |
274 | + field(B13,DBF_UCHAR) { |
275 | + prompt("Bit 19") |
276 | + pp(TRUE) |
277 | + interest(1) |
278 | + } |
279 | + field(B14,DBF_UCHAR) { |
280 | + prompt("Bit 20") |
281 | + pp(TRUE) |
282 | + interest(1) |
283 | + } |
284 | + field(B15,DBF_UCHAR) { |
285 | + prompt("Bit 21") |
286 | + pp(TRUE) |
287 | + interest(1) |
288 | + } |
289 | + field(B16,DBF_UCHAR) { |
290 | + prompt("Bit 22") |
291 | + pp(TRUE) |
292 | + interest(1) |
293 | + } |
294 | + field(B17,DBF_UCHAR) { |
295 | + prompt("Bit 23") |
296 | + pp(TRUE) |
297 | + interest(1) |
298 | + } |
299 | + field(B18,DBF_UCHAR) { |
300 | + prompt("Bit 24") |
301 | + pp(TRUE) |
302 | + interest(1) |
303 | + } |
304 | + field(B19,DBF_UCHAR) { |
305 | + prompt("Bit 25") |
306 | + pp(TRUE) |
307 | + interest(1) |
308 | + } |
309 | + field(B1A,DBF_UCHAR) { |
310 | + prompt("Bit 26") |
311 | + pp(TRUE) |
312 | + interest(1) |
313 | + } |
314 | + field(B1B,DBF_UCHAR) { |
315 | + prompt("Bit 27") |
316 | + pp(TRUE) |
317 | + interest(1) |
318 | + } |
319 | + field(B1C,DBF_UCHAR) { |
320 | + prompt("Bit 28") |
321 | + pp(TRUE) |
322 | + interest(1) |
323 | + } |
324 | + field(B1D,DBF_UCHAR) { |
325 | + prompt("Bit 29") |
326 | + pp(TRUE) |
327 | + interest(1) |
328 | + } |
329 | + field(B1E,DBF_UCHAR) { |
330 | + prompt("Bit 30") |
331 | + pp(TRUE) |
332 | + interest(1) |
333 | + } |
334 | + field(B1F,DBF_UCHAR) { |
335 | + prompt("Bit 31") |
336 | pp(TRUE) |
337 | interest(1) |
338 | } |
339 | diff --git a/src/std/rec/mbboDirectRecord.c b/src/std/rec/mbboDirectRecord.c |
340 | index 0a6e339..eaae383 100644 |
341 | --- a/src/std/rec/mbboDirectRecord.c |
342 | +++ b/src/std/rec/mbboDirectRecord.c |
343 | @@ -94,7 +94,7 @@ static void convert(mbboDirectRecord *); |
344 | static void monitor(mbboDirectRecord *); |
345 | static long writeValue(mbboDirectRecord *); |
346 | |
347 | -#define NUM_BITS 16 |
348 | +#define NUM_BITS 32 |
349 | |
350 | static long init_record(struct dbCommon *pcommon, int pass) |
351 | { |
352 | @@ -116,7 +116,7 @@ static long init_record(struct dbCommon *pcommon, int pass) |
353 | } |
354 | |
355 | recGblInitConstantLink(&prec->siml, DBF_USHORT, &prec->simm); |
356 | - if (recGblInitConstantLink(&prec->dol, DBF_USHORT, &prec->val)) |
357 | + if (recGblInitConstantLink(&prec->dol, DBF_ULONG, &prec->val)) |
358 | prec->udf = FALSE; |
359 | |
360 | /* Initialize MASK if the user set NOBT instead */ |
361 | @@ -141,8 +141,8 @@ static long init_record(struct dbCommon *pcommon, int pass) |
362 | |
363 | if (!prec->udf && |
364 | prec->omsl == menuOmslsupervisory) { |
365 | - /* Set initial B0 - BF from VAL */ |
366 | - epicsUInt16 val = prec->val; |
367 | + /* Set initial B0 - B1F from VAL */ |
368 | + epicsUInt32 val = prec->val; |
369 | epicsUInt8 *pBn = &prec->b0; |
370 | int i; |
371 | |
372 | @@ -174,9 +174,9 @@ static long process(struct dbCommon *pcommon) |
373 | if (!pact) { |
374 | if (!dbLinkIsConstant(&prec->dol) && |
375 | prec->omsl == menuOmslclosed_loop) { |
376 | - epicsUInt16 val; |
377 | + epicsUInt32 val; |
378 | |
379 | - if (dbGetLink(&prec->dol, DBR_USHORT, &val, 0, 0)) { |
380 | + if (dbGetLink(&prec->dol, DBR_ULONG, &val, 0, 0)) { |
381 | recGblSetSevr(prec, LINK_ALARM, INVALID_ALARM); |
382 | goto CONTINUE; |
383 | } |
384 | @@ -184,11 +184,11 @@ static long process(struct dbCommon *pcommon) |
385 | } |
386 | else if (prec->omsl == menuOmslsupervisory) { |
387 | epicsUInt8 *pBn = &prec->b0; |
388 | - epicsUInt16 val = 0; |
389 | - epicsUInt16 bit = 1; |
390 | + epicsUInt32 val = 0; |
391 | + epicsUInt32 bit = 1; |
392 | int i; |
393 | |
394 | - /* Construct VAL from B0 - BF */ |
395 | + /* Construct VAL from B0 - B1F */ |
396 | for (i = 0; i < NUM_BITS; i++, bit <<= 1) |
397 | if (*pBn++) |
398 | val |= bit; |
399 | @@ -253,7 +253,7 @@ static long special(DBADDR *paddr, int after) |
400 | if (prec->omsl == menuOmslsupervisory) { |
401 | /* Adjust VAL corresponding to the bit changed */ |
402 | epicsUInt8 *pBn = (epicsUInt8 *) paddr->pfield; |
403 | - int bit = 1 << (pBn - &prec->b0); |
404 | + epicsUInt32 bit = 1 << (pBn - &prec->b0); |
405 | |
406 | if (*pBn) |
407 | prec->val |= bit; |
408 | @@ -267,9 +267,9 @@ static long special(DBADDR *paddr, int after) |
409 | |
410 | case SPC_RESET: /* OMSL field modified */ |
411 | if (prec->omsl == menuOmslclosed_loop) { |
412 | - /* Construct VAL from B0 - BF */ |
413 | + /* Construct VAL from B0 - B1F */ |
414 | epicsUInt8 *pBn = &prec->b0; |
415 | - epicsUInt16 val = 0, bit = 1; |
416 | + epicsUInt32 val = 0, bit = 1; |
417 | int i; |
418 | |
419 | for (i = 0; i < NUM_BITS; i++, bit <<= 1) |
420 | @@ -278,8 +278,8 @@ static long special(DBADDR *paddr, int after) |
421 | prec->val = val; |
422 | } |
423 | else if (prec->omsl == menuOmslsupervisory) { |
424 | - /* Set B0 - BF from VAL and post monitors */ |
425 | - epicsUInt16 val = prec->val; |
426 | + /* Set B0 - B1F from VAL and post monitors */ |
427 | + epicsUInt32 val = prec->val; |
428 | epicsUInt8 *pBn = &prec->b0; |
429 | int i; |
430 | |
431 | @@ -351,7 +351,7 @@ static long writeValue(mbboDirectRecord *prec) |
432 | |
433 | case menuYesNoYES: |
434 | recGblSetSevr(prec, SIMM_ALARM, prec->sims); |
435 | - return dbPutLink(&prec->siol, DBR_USHORT, &prec->val, 1); |
436 | + return dbPutLink(&prec->siol, DBR_ULONG, &prec->val, 1); |
437 | |
438 | default: |
439 | recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM); |
440 | diff --git a/src/std/rec/mbboDirectRecord.dbd b/src/std/rec/mbboDirectRecord.dbd |
441 | index 0b4285e..62c6973 100644 |
442 | --- a/src/std/rec/mbboDirectRecord.dbd |
443 | +++ b/src/std/rec/mbboDirectRecord.dbd |
444 | @@ -8,7 +8,7 @@ |
445 | #************************************************************************* |
446 | recordtype(mbboDirect) { |
447 | include "dbCommon.dbd" |
448 | - field(VAL,DBF_USHORT) { |
449 | + field(VAL,DBF_LONG) { |
450 | prompt("Word") |
451 | promptgroup("50 - Output") |
452 | asl(ASL0) |
453 | @@ -38,6 +38,72 @@ recordtype(mbboDirect) { |
454 | promptgroup("50 - Output") |
455 | interest(1) |
456 | } |
457 | + field(RVAL,DBF_ULONG) { |
458 | + prompt("Raw Value") |
459 | + special(SPC_NOMOD) |
460 | + pp(TRUE) |
461 | + } |
462 | + field(ORAW,DBF_ULONG) { |
463 | + prompt("Prev Raw Value") |
464 | + special(SPC_NOMOD) |
465 | + interest(3) |
466 | + } |
467 | + field(RBV,DBF_ULONG) { |
468 | + prompt("Readback Value") |
469 | + special(SPC_NOMOD) |
470 | + } |
471 | + field(ORBV,DBF_ULONG) { |
472 | + prompt("Prev Readback Value") |
473 | + special(SPC_NOMOD) |
474 | + interest(3) |
475 | + } |
476 | + field(MASK,DBF_ULONG) { |
477 | + prompt("Hardware Mask") |
478 | + special(SPC_NOMOD) |
479 | + interest(1) |
480 | + } |
481 | + field(MLST,DBF_LONG) { |
482 | + prompt("Last Value Monitored") |
483 | + special(SPC_NOMOD) |
484 | + interest(3) |
485 | + } |
486 | + field(SHFT,DBF_USHORT) { |
487 | + prompt("Shift") |
488 | + promptgroup("50 - Output") |
489 | + interest(1) |
490 | + } |
491 | + field(SIOL,DBF_OUTLINK) { |
492 | + prompt("Sim Output Specifctn") |
493 | + promptgroup("90 - Simulate") |
494 | + interest(1) |
495 | + } |
496 | + field(SIML,DBF_INLINK) { |
497 | + prompt("Sim Mode Location") |
498 | + promptgroup("90 - Simulate") |
499 | + interest(1) |
500 | + } |
501 | + field(SIMM,DBF_MENU) { |
502 | + prompt("Simulation Mode") |
503 | + interest(1) |
504 | + menu(menuYesNo) |
505 | + } |
506 | + field(SIMS,DBF_MENU) { |
507 | + prompt("Sim mode Alarm Svrty") |
508 | + promptgroup("90 - Simulate") |
509 | + interest(2) |
510 | + menu(menuAlarmSevr) |
511 | + } |
512 | + field(IVOA,DBF_MENU) { |
513 | + prompt("INVALID outpt action") |
514 | + promptgroup("50 - Output") |
515 | + interest(2) |
516 | + menu(menuIvoa) |
517 | + } |
518 | + field(IVOV,DBF_LONG) { |
519 | + prompt("INVALID output value") |
520 | + promptgroup("50 - Output") |
521 | + interest(2) |
522 | + } |
523 | field(B0,DBF_UCHAR) { |
524 | prompt("Bit 0") |
525 | promptgroup("51 - Output 0-7") |
526 | @@ -96,124 +162,170 @@ recordtype(mbboDirect) { |
527 | } |
528 | field(B8,DBF_UCHAR) { |
529 | prompt("Bit 8") |
530 | - promptgroup("52 - Output 9-F") |
531 | + promptgroup("52 - Output 8-15") |
532 | special(SPC_MOD) |
533 | pp(TRUE) |
534 | interest(1) |
535 | } |
536 | field(B9,DBF_UCHAR) { |
537 | prompt("Bit 9") |
538 | - promptgroup("52 - Output 9-F") |
539 | + promptgroup("52 - Output 8-15") |
540 | special(SPC_MOD) |
541 | pp(TRUE) |
542 | interest(1) |
543 | } |
544 | field(BA,DBF_UCHAR) { |
545 | prompt("Bit 10") |
546 | - promptgroup("52 - Output 9-F") |
547 | + promptgroup("52 - Output 8-15") |
548 | special(SPC_MOD) |
549 | pp(TRUE) |
550 | interest(1) |
551 | } |
552 | field(BB,DBF_UCHAR) { |
553 | prompt("Bit 11") |
554 | - promptgroup("52 - Output 9-F") |
555 | + promptgroup("52 - Output 8-15") |
556 | special(SPC_MOD) |
557 | pp(TRUE) |
558 | interest(1) |
559 | } |
560 | field(BC,DBF_UCHAR) { |
561 | prompt("Bit 12") |
562 | - promptgroup("52 - Output 9-F") |
563 | + promptgroup("52 - Output 8-15") |
564 | special(SPC_MOD) |
565 | pp(TRUE) |
566 | interest(1) |
567 | } |
568 | field(BD,DBF_UCHAR) { |
569 | prompt("Bit 13") |
570 | - promptgroup("52 - Output 9-F") |
571 | + promptgroup("52 - Output 8-15") |
572 | special(SPC_MOD) |
573 | pp(TRUE) |
574 | interest(1) |
575 | } |
576 | field(BE,DBF_UCHAR) { |
577 | prompt("Bit 14") |
578 | - promptgroup("52 - Output 9-F") |
579 | + promptgroup("52 - Output 8-15") |
580 | special(SPC_MOD) |
581 | pp(TRUE) |
582 | interest(1) |
583 | } |
584 | field(BF,DBF_UCHAR) { |
585 | prompt("Bit 15") |
586 | - promptgroup("52 - Output 9-F") |
587 | + promptgroup("52 - Output 8-15") |
588 | special(SPC_MOD) |
589 | pp(TRUE) |
590 | interest(1) |
591 | } |
592 | - field(RVAL,DBF_ULONG) { |
593 | - prompt("Raw Value") |
594 | - special(SPC_NOMOD) |
595 | + field(B10,DBF_UCHAR) { |
596 | + prompt("Bit 16") |
597 | + promptgroup("53 - Output 16-23") |
598 | + special(SPC_MOD) |
599 | pp(TRUE) |
600 | + interest(1) |
601 | } |
602 | - field(ORAW,DBF_ULONG) { |
603 | - prompt("Prev Raw Value") |
604 | - special(SPC_NOMOD) |
605 | - interest(3) |
606 | + field(B11,DBF_UCHAR) { |
607 | + prompt("Bit 17") |
608 | + promptgroup("53 - Output 16-23") |
609 | + special(SPC_MOD) |
610 | + pp(TRUE) |
611 | + interest(1) |
612 | } |
613 | - field(RBV,DBF_ULONG) { |
614 | - prompt("Readback Value") |
615 | - special(SPC_NOMOD) |
616 | + field(B12,DBF_UCHAR) { |
617 | + prompt("Bit 18") |
618 | + promptgroup("53 - Output 16-23") |
619 | + special(SPC_MOD) |
620 | + pp(TRUE) |
621 | + interest(1) |
622 | } |
623 | - field(ORBV,DBF_ULONG) { |
624 | - prompt("Prev Readback Value") |
625 | - special(SPC_NOMOD) |
626 | - interest(3) |
627 | + field(B13,DBF_UCHAR) { |
628 | + prompt("Bit 19") |
629 | + promptgroup("53 - Output 16-23") |
630 | + special(SPC_MOD) |
631 | + pp(TRUE) |
632 | + interest(1) |
633 | } |
634 | - field(MASK,DBF_ULONG) { |
635 | - prompt("Hardware Mask") |
636 | - special(SPC_NOMOD) |
637 | + field(B14,DBF_UCHAR) { |
638 | + prompt("Bit 20") |
639 | + promptgroup("53 - Output 16-23") |
640 | + special(SPC_MOD) |
641 | + pp(TRUE) |
642 | interest(1) |
643 | } |
644 | - field(MLST,DBF_ULONG) { |
645 | - prompt("Last Value Monitored") |
646 | - special(SPC_NOMOD) |
647 | - interest(3) |
648 | + field(B15,DBF_UCHAR) { |
649 | + prompt("Bit 21") |
650 | + promptgroup("53 - Output 16-23") |
651 | + special(SPC_MOD) |
652 | + pp(TRUE) |
653 | + interest(1) |
654 | } |
655 | - field(SHFT,DBF_ULONG) { |
656 | - prompt("Shift") |
657 | - promptgroup("50 - Output") |
658 | + field(B16,DBF_UCHAR) { |
659 | + prompt("Bit 22") |
660 | + promptgroup("53 - Output 16-23") |
661 | + special(SPC_MOD) |
662 | + pp(TRUE) |
663 | interest(1) |
664 | } |
665 | - field(SIOL,DBF_OUTLINK) { |
666 | - prompt("Sim Output Specifctn") |
667 | - promptgroup("90 - Simulate") |
668 | + field(B17,DBF_UCHAR) { |
669 | + prompt("Bit 23") |
670 | + promptgroup("53 - Output 16-23") |
671 | + special(SPC_MOD) |
672 | + pp(TRUE) |
673 | interest(1) |
674 | } |
675 | - field(SIML,DBF_INLINK) { |
676 | - prompt("Sim Mode Location") |
677 | - promptgroup("90 - Simulate") |
678 | + field(B18,DBF_UCHAR) { |
679 | + prompt("Bit 24") |
680 | + promptgroup("54 - Output 24-31") |
681 | + special(SPC_MOD) |
682 | + pp(TRUE) |
683 | interest(1) |
684 | } |
685 | - field(SIMM,DBF_MENU) { |
686 | - prompt("Simulation Mode") |
687 | + field(B19,DBF_UCHAR) { |
688 | + prompt("Bit 25") |
689 | + promptgroup("54 - Output 24-31") |
690 | + special(SPC_MOD) |
691 | + pp(TRUE) |
692 | interest(1) |
693 | - menu(menuYesNo) |
694 | } |
695 | - field(SIMS,DBF_MENU) { |
696 | - prompt("Sim mode Alarm Svrty") |
697 | - promptgroup("90 - Simulate") |
698 | - interest(2) |
699 | - menu(menuAlarmSevr) |
700 | + field(B1A,DBF_UCHAR) { |
701 | + prompt("Bit 26") |
702 | + promptgroup("54 - Output 24-31") |
703 | + special(SPC_MOD) |
704 | + pp(TRUE) |
705 | + interest(1) |
706 | } |
707 | - field(IVOA,DBF_MENU) { |
708 | - prompt("INVALID outpt action") |
709 | - promptgroup("50 - Output") |
710 | - interest(2) |
711 | - menu(menuIvoa) |
712 | + field(B1B,DBF_UCHAR) { |
713 | + prompt("Bit 27") |
714 | + promptgroup("54 - Output 24-31") |
715 | + special(SPC_MOD) |
716 | + pp(TRUE) |
717 | + interest(1) |
718 | } |
719 | - field(IVOV,DBF_USHORT) { |
720 | - prompt("INVALID output value") |
721 | - promptgroup("50 - Output") |
722 | - interest(2) |
723 | + field(B1C,DBF_UCHAR) { |
724 | + prompt("Bit 28") |
725 | + promptgroup("54 - Output 24-31") |
726 | + special(SPC_MOD) |
727 | + pp(TRUE) |
728 | + interest(1) |
729 | + } |
730 | + field(B1D,DBF_UCHAR) { |
731 | + prompt("Bit 29") |
732 | + promptgroup("54 - Output 24-31") |
733 | + special(SPC_MOD) |
734 | + pp(TRUE) |
735 | + interest(1) |
736 | + } |
737 | + field(B1E,DBF_UCHAR) { |
738 | + prompt("Bit 30") |
739 | + promptgroup("54 - Output 24-31") |
740 | + special(SPC_MOD) |
741 | + pp(TRUE) |
742 | + interest(1) |
743 | + } |
744 | + field(B1F,DBF_UCHAR) { |
745 | + prompt("Bit 31") |
746 | + promptgroup("54 - Output 24-31") |
747 | + special(SPC_MOD) |
748 | + pp(TRUE) |
749 | + interest(1) |
750 | } |
751 | } |
752 | diff --git a/src/std/rec/test/Makefile b/src/std/rec/test/Makefile |
753 | index 5a591b2..26aab24 100644 |
754 | --- a/src/std/rec/test/Makefile |
755 | +++ b/src/std/rec/test/Makefile |
756 | @@ -104,6 +104,13 @@ regressTest_SRCS += regressTest_registerRecordDeviceDriver.cpp |
757 | TESTFILES += $(COMMON_DIR)/regressTest.dbd ../regressArray1.db ../regressHex.db ../regressLinkMS.db |
758 | TESTS += regressTest |
759 | |
760 | +TESTPROD_HOST += mbbioDirectTest |
761 | +mbbioDirectTest_SRCS += mbbioDirectTest.c |
762 | +mbbioDirectTest_SRCS += recTestIoc_registerRecordDeviceDriver.cpp |
763 | +testHarness_SRCS += mbbioDirectTest.c |
764 | +TESTFILES += ../mbbioDirectTest.db |
765 | +TESTS += mbbioDirectTest |
766 | + |
767 | # epicsRunRecordTests runs all the test programs in a known working order. |
768 | testHarness_SRCS += epicsRunRecordTests.c |
769 | |
770 | diff --git a/src/std/rec/test/mbbioDirectTest.c b/src/std/rec/test/mbbioDirectTest.c |
771 | new file mode 100644 |
772 | index 0000000..9a8ebf4 |
773 | --- /dev/null |
774 | +++ b/src/std/rec/test/mbbioDirectTest.c |
775 | @@ -0,0 +1,133 @@ |
776 | +/*************************************************************************\ |
777 | +* Copyright (c) 2017 Dirk Zimoch |
778 | +* EPICS BASE is distributed subject to a Software License Agreement found |
779 | +* in file LICENSE that is included with this distribution. |
780 | +\*************************************************************************/ |
781 | + |
782 | +#include <string.h> |
783 | + |
784 | +#include "dbAccess.h" |
785 | +#include "errlog.h" |
786 | +#include "dbStaticLib.h" |
787 | +#include "dbTest.h" |
788 | +#include "dbUnitTest.h" |
789 | +#include "testMain.h" |
790 | +#include "epicsThread.h" |
791 | + |
792 | +static |
793 | +void testmbbioFields(const char* rec, unsigned int value) |
794 | +{ |
795 | + char field[40]; |
796 | + unsigned int i; |
797 | + |
798 | + testdbGetFieldEqual(rec, DBF_ULONG, value); |
799 | + for (i=0; i < 32; i++) |
800 | + { |
801 | + sprintf(field,"%s.B%X", rec, i); |
802 | + testdbGetFieldEqual(field, DBF_ULONG, (value>>i)&1); |
803 | + } |
804 | +} |
805 | + |
806 | +static |
807 | +void testmbbioRecords(unsigned int count, unsigned int value) |
808 | +{ |
809 | + char rec[40]; |
810 | + unsigned int i; |
811 | + |
812 | + for (i = 1; i <= count; i++) |
813 | + { |
814 | + sprintf(rec, "do%d", i); |
815 | + testDiag(" ### %s ###", rec); |
816 | + testmbbioFields(rec, value); |
817 | + sprintf(rec, "di%d", i); |
818 | + testmbbioFields(rec, value); |
819 | + } |
820 | +} |
821 | + |
822 | +static |
823 | +void putN(const char* pattern, unsigned int count, unsigned int value) |
824 | +{ |
825 | + char field[40]; |
826 | + unsigned int i; |
827 | + |
828 | + for (i = 1; i <= count; i++) |
829 | + { |
830 | + sprintf(field, pattern, i); |
831 | + testdbPutFieldOk(field, DBF_ULONG, value); |
832 | + } |
833 | +} |
834 | + |
835 | +static |
836 | +void testN(const char* pattern, unsigned int count, unsigned int value) |
837 | +{ |
838 | + char field[40]; |
839 | + unsigned int i; |
840 | + |
841 | + for (i = 1; i <= count; i++) |
842 | + { |
843 | + sprintf(field, pattern, i); |
844 | + testdbGetFieldEqual(field, DBF_ULONG, value); |
845 | + } |
846 | +} |
847 | + |
848 | +void recTestIoc_registerRecordDeviceDriver(struct dbBase *); |
849 | + |
850 | +MAIN(mbbioDirectTest) |
851 | +{ |
852 | + unsigned int value = 0xdeadbeef; |
853 | + unsigned int simvalue = 0; |
854 | + char macros [40]; |
855 | + const unsigned int N = 3; |
856 | + |
857 | + testPlan(N*((32+1)*2*4+4+3)); |
858 | + |
859 | + testdbPrepare(); |
860 | + |
861 | + testdbReadDatabase("recTestIoc.dbd", NULL, NULL); |
862 | + |
863 | + recTestIoc_registerRecordDeviceDriver(pdbbase); |
864 | + |
865 | + sprintf(macros, "INIT=%#x", value); |
866 | + testdbReadDatabase("mbbioDirectTest.db", NULL, macros); |
867 | + |
868 | + eltc(0); |
869 | + testIocInitOk(); |
870 | + eltc(1); |
871 | + |
872 | + testDiag("##### check initial value #####"); |
873 | + testmbbioRecords(N, value); |
874 | + |
875 | + testDiag("##### set bit 5 #####"); |
876 | + putN("do%u.B5", N, 1); |
877 | + value |= (1<<5); |
878 | + testN("val%d", N, value); |
879 | + /* allow async input to process */ |
880 | + epicsThreadSleep(0.0); |
881 | + testmbbioRecords(N, value); |
882 | + |
883 | + testDiag("##### clear bit 31 (0x1f) #####"); |
884 | + putN("do%u.B1F", N, 0); |
885 | + value &= ~(1<<31); |
886 | + testN("val%d", N, value); |
887 | + /* allow async input to process */ |
888 | + epicsThreadSleep(0.0); |
889 | + testmbbioRecords(N, value); |
890 | + |
891 | + testDiag("##### simulation mode #####"); |
892 | + dbpf("sim", "1"); |
893 | + simvalue = value & ~1; |
894 | + putN("do%u.B0", N, 0); |
895 | + /* old value in lo* */ |
896 | + testN("val%d", N, value); |
897 | + /* sim value in sim* */ |
898 | + testN("sim%d", N, simvalue); |
899 | + /* allow async input to process */ |
900 | + epicsThreadSleep(0.0); |
901 | + testmbbioRecords(N, simvalue); |
902 | + |
903 | + testIocShutdownOk(); |
904 | + |
905 | + testdbCleanup(); |
906 | + |
907 | + return testDone(); |
908 | +} |
909 | diff --git a/src/std/rec/test/mbbioDirectTest.db b/src/std/rec/test/mbbioDirectTest.db |
910 | new file mode 100644 |
911 | index 0000000..9066076 |
912 | --- /dev/null |
913 | +++ b/src/std/rec/test/mbbioDirectTest.db |
914 | @@ -0,0 +1,69 @@ |
915 | +record(bo, "sim") { |
916 | + field(ZNAM, "off") |
917 | + field(ONAM, "simulation") |
918 | +} |
919 | + |
920 | +record(mbboDirect, "do1") { |
921 | + field(DOL, "$(INIT=0)") |
922 | + field(DTYP, "Soft Channel") |
923 | + field(OUT, "val1 PP") |
924 | + field(SIOL, "sim1 PP") |
925 | + field(SIML, "sim") |
926 | + field(PINI, "YES") |
927 | +} |
928 | +record(ao, "val1") { |
929 | + field(FLNK, "di1") |
930 | +} |
931 | +record(ao, "sim1") { |
932 | + field(FLNK, "di1") |
933 | +} |
934 | +record(mbbiDirect, "di1") { |
935 | + field(DTYP, "Soft Channel") |
936 | + field(INP, "val1") |
937 | + field(SIOL, "sim1 PP") |
938 | + field(SIML, "sim") |
939 | +} |
940 | + |
941 | + |
942 | +record(mbboDirect, "do2") { |
943 | + field(DOL, "$(INIT=0)") |
944 | + field(DTYP, "Raw Soft Channel") |
945 | + field(OUT, "val2 PP") |
946 | + field(SIOL, "sim2 PP") |
947 | + field(SIML, "sim") |
948 | + field(PINI, "YES") |
949 | +} |
950 | +record(ao, "val2") { |
951 | + field(FLNK, "di2") |
952 | +} |
953 | +record(ao, "sim2") { |
954 | + field(FLNK, "di2") |
955 | +} |
956 | +record(mbbiDirect, "di2") { |
957 | + field(DTYP, "Raw Soft Channel") |
958 | + field(INP, "val2") |
959 | + field(SIML, "sim") |
960 | + field(SIOL, "sim2") |
961 | +} |
962 | + |
963 | + |
964 | +record(mbboDirect, "do3") { |
965 | + field(DOL, "$(INIT=0)") |
966 | + field(DTYP, "Async Soft Channel") |
967 | + field(OUT, "val3 PP") |
968 | + field(SIOL, "sim3 PP") |
969 | + field(SIML, "sim") |
970 | + field(PINI, "YES") |
971 | +} |
972 | +record(ao, "val3") { |
973 | + field(FLNK, "di3") |
974 | +} |
975 | +record(ao, "sim3") { |
976 | + field(FLNK, "di3") |
977 | +} |
978 | +record(mbbiDirect, "di3") { |
979 | + field(DTYP, "Soft Channel") |
980 | + field(INP, "val3") |
981 | + field(SIOL, "sim3") |
982 | + field(SIML, "sim") |
983 | +} |
Looking forward to seeing some tests for these two record types added to this branch, and an entry for the Release Notes summarizing the changes.
A conversion of the old 3.14 Record Reference Wiki page into POD documentation in the DBD files would also be nice, but not essential (see the other *Record.dbd.pod files in src/std/rec for some examples).