EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: mbbioDirect 32 bit for EPICS 7
From: Dirk Zimoch <[email protected]>
To: <[email protected]>
Date: Mon, 11 Dec 2017 14:58:02 +0100
On 08.12.2017 11:49, Dirk Zimoch wrote:
Hi everyone,

I have completed the 32 bit version of mbbiDirect and mbboDirect for
EPICS 7, including soft device supports and a unit test.

Where/how should I now push it? I'm asking in particular because of the
new submodule system. So I assume it's different from 3.16.


Because I could not figure out how to do the merge request for this properly, here is the diff for modules/database and for RELEASE_NOTES.html.

Dirk
diff --git a/src/std/dev/devMbbiDirectSoft.c b/src/std/dev/devMbbiDirectSoft.c
index 9c929b2..e3c769f 100644
--- a/src/std/dev/devMbbiDirectSoft.c
+++ b/src/std/dev/devMbbiDirectSoft.c
@@ -47,7 +47,7 @@ epicsExportAddress(dset, devMbbiDirectSoft);
 
 static long init_record(mbbiDirectRecord *prec)
 {
-    if (recGblInitConstantLink(&prec->inp, DBF_ENUM, &prec->val))
+    if (recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->val))
         prec->udf = FALSE;
 
     return 0;
@@ -56,7 +56,7 @@ static long init_record(mbbiDirectRecord *prec)
 static long readLocked(struct link *pinp, void *dummy)
 {
     mbbiDirectRecord *prec = (mbbiDirectRecord *) pinp->precord;
-    long status = dbGetLink(pinp, DBR_USHORT, &prec->val, 0, 0);
+    long status = dbGetLink(pinp, DBR_ULONG, &prec->val, 0, 0);
 
     if (status) return status;
 
diff --git a/src/std/dev/devMbbiDirectSoftCallback.c b/src/std/dev/devMbbiDirectSoftCallback.c
index 9301632..d785f73 100644
--- a/src/std/dev/devMbbiDirectSoftCallback.c
+++ b/src/std/dev/devMbbiDirectSoftCallback.c
@@ -41,7 +41,7 @@ typedef struct devPvt {
     struct {
         DBRstatus
         DBRtime
-        epicsUInt16 value;
+        epicsUInt32 value;
     } buffer;
 } devPvt;
 
@@ -58,7 +58,7 @@ static void getCallback(processNotify *ppn, notifyGetType type)
     }
 
     assert(type == getFieldType);
-    pdevPvt->status = dbChannelGetField(ppn->chan, DBR_USHORT,
+    pdevPvt->status = dbChannelGetField(ppn->chan, DBR_ULONG,
         &pdevPvt->buffer, &pdevPvt->options, &no_elements, 0);
 }
 
@@ -153,7 +153,7 @@ static long init(int pass)
 
 static long init_record(mbbiDirectRecord *prec)
 {
-    if (recGblInitConstantLink(&prec->inp, DBR_ENUM, &prec->val))
+    if (recGblInitConstantLink(&prec->inp, DBR_ULONG, &prec->val))
         prec->udf = FALSE;
 
     return 0;
diff --git a/src/std/dev/devMbbiDirectSoftRaw.c b/src/std/dev/devMbbiDirectSoftRaw.c
index f6172cd..98b4673 100644
--- a/src/std/dev/devMbbiDirectSoftRaw.c
+++ b/src/std/dev/devMbbiDirectSoftRaw.c
@@ -59,7 +59,7 @@ static long init_record(mbbiDirectRecord *prec)
 
 static long read_mbbi(mbbiDirectRecord *prec)
 {
-    if (!dbGetLink(&prec->inp, DBR_LONG, &prec->rval, 0, 0)) {
+    if (!dbGetLink(&prec->inp, DBR_ULONG, &prec->rval, 0, 0)) {
         prec->rval &= prec->mask;
         if (dbLinkIsConstant(&prec->tsel) &&
             prec->tse == epicsTimeEventDeviceTime)
diff --git a/src/std/dev/devMbboDirectSoft.c b/src/std/dev/devMbboDirectSoft.c
index 0c08519..75359f2 100644
--- a/src/std/dev/devMbboDirectSoft.c
+++ b/src/std/dev/devMbboDirectSoft.c
@@ -21,7 +21,7 @@
 
 static long write_mbbo(mbboDirectRecord	*prec)
 {
-    dbPutLink(&prec->out, DBR_USHORT, &prec->val, 1);
+    dbPutLink(&prec->out, DBR_ULONG, &prec->val, 1);
     return 0;
 }
 
diff --git a/src/std/dev/devMbboDirectSoftCallback.c b/src/std/dev/devMbboDirectSoftCallback.c
index e64c3d4..6d86507 100644
--- a/src/std/dev/devMbboDirectSoftCallback.c
+++ b/src/std/dev/devMbboDirectSoftCallback.c
@@ -29,11 +29,11 @@ static long write_mbbo(mbboDirectRecord *prec)
     if (prec->pact)
         return 0;
 
-    status = dbPutLinkAsync(plink, DBR_USHORT, &prec->val, 1);
+    status = dbPutLinkAsync(plink, DBR_ULONG, &prec->val, 1);
     if (!status)
         prec->pact = TRUE;
     else if (status == S_db_noLSET)
-        status = dbPutLink(plink, DBR_USHORT, &prec->val, 1);
+        status = dbPutLink(plink, DBR_ULONG, &prec->val, 1);
 
     return status;
 }
diff --git a/src/std/rec/mbbiDirectRecord.c b/src/std/rec/mbbiDirectRecord.c
index 566bbe2..62696e2 100644
--- a/src/std/rec/mbbiDirectRecord.c
+++ b/src/std/rec/mbbiDirectRecord.c
@@ -9,7 +9,7 @@
 * in file LICENSE that is included with this distribution. 
 \*************************************************************************/
 
-/* mbbiDirectRecord.c - Record Support routines for mbboDirect records */
+/* mbbiDirectRecord.c - Record Support routines for mbbiDirect records */
 /*
  *      Original Authors: Bob Dalesio and Matthew Needes
  *      Date: 10-07-93
@@ -93,7 +93,7 @@ struct mbbidset { /* multi bit binary input dset */
 static void monitor(mbbiDirectRecord *);
 static long readValue(mbbiDirectRecord *);
 
-#define NUM_BITS 16
+#define NUM_BITS 32
 
 static long init_record(struct dbCommon *pcommon, int pass)
 {
@@ -114,7 +114,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
     }
 
     recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
-    recGblInitConstantLink(&prec->siol, DBF_USHORT, &prec->sval);
+    recGblInitConstantLink(&prec->siol, DBF_ULONG, &prec->sval);
 
     /* Initialize MASK if the user set NOBT instead */
     if (prec->mask == 0 && prec->nobt <= 32)
@@ -123,11 +123,11 @@ static long init_record(struct dbCommon *pcommon, int pass)
     if (pdset->init_record) {
         status = pdset->init_record(prec);
         if (status == 0) {
-            epicsUInt16 val = prec->val;
+            epicsUInt32 val = prec->val;
             epicsUInt8 *pBn = &prec->b0;
             int i;
 
-            /* Initialize B0 - BF from VAL */
+            /* Initialize B0 - B1F from VAL */
             for (i = 0; i < NUM_BITS; i++, pBn++, val >>= 1)
                 *pBn = !! (val & 1);
         }
@@ -208,7 +208,7 @@ static void monitor(mbbiDirectRecord *prec)
 {
     epicsUInt16 events = recGblResetAlarms(prec);
     epicsUInt16 vl_events = events | DBE_VALUE | DBE_LOG;
-    epicsUInt16 val = prec->val;
+    epicsUInt32 val = prec->val;
     epicsUInt8 *pBn = &prec->b0;
     int i;
 
diff --git a/src/std/rec/mbbiDirectRecord.dbd b/src/std/rec/mbbiDirectRecord.dbd
index c7ca0f4..bb432e5 100644
--- a/src/std/rec/mbbiDirectRecord.dbd
+++ b/src/std/rec/mbbiDirectRecord.dbd
@@ -8,7 +8,7 @@
 #*************************************************************************
 recordtype(mbbiDirect) {
     include "dbCommon.dbd" 
-    field(VAL,DBF_USHORT) {
+    field(VAL,DBF_LONG) {
         prompt("Current Value")
         promptgroup("40 - Input")
         asl(ASL0)
@@ -39,7 +39,7 @@ recordtype(mbbiDirect) {
         special(SPC_NOMOD)
         interest(1)
     }
-    field(MLST,DBF_USHORT) {
+    field(MLST,DBF_LONG) {
         prompt("Last Value Monitored")
         special(SPC_NOMOD)
         interest(3)
@@ -54,7 +54,7 @@ recordtype(mbbiDirect) {
         promptgroup("90 - Simulate")
         interest(1)
     }
-    field(SVAL,DBF_ULONG) {
+    field(SVAL,DBF_LONG) {
         prompt("Simulation Value")
     }
     field(SIML,DBF_INLINK) {
@@ -151,32 +151,112 @@ recordtype(mbbiDirect) {
         interest(1)
     }
     field(BA,DBF_UCHAR) {
-        prompt("Bit A")
+        prompt("Bit 10")
         pp(TRUE)
         interest(1)
     }
     field(BB,DBF_UCHAR) {
-        prompt("Bit B")
+        prompt("Bit 11")
         pp(TRUE)
         interest(1)
     }
     field(BC,DBF_UCHAR) {
-        prompt("Bit C")
+        prompt("Bit 12")
         pp(TRUE)
         interest(1)
     }
     field(BD,DBF_UCHAR) {
-        prompt("Bit D")
+        prompt("Bit 13")
         pp(TRUE)
         interest(1)
     }
     field(BE,DBF_UCHAR) {
-        prompt("Bit E")
+        prompt("Bit 14")
         pp(TRUE)
         interest(1)
     }
     field(BF,DBF_UCHAR) {
-        prompt("Bit F")
+        prompt("Bit 15")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B10,DBF_UCHAR) {
+        prompt("Bit 16")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B11,DBF_UCHAR) {
+        prompt("Bit 17")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B12,DBF_UCHAR) {
+        prompt("Bit 18")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B13,DBF_UCHAR) {
+        prompt("Bit 19")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B14,DBF_UCHAR) {
+        prompt("Bit 20")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B15,DBF_UCHAR) {
+        prompt("Bit 21")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B16,DBF_UCHAR) {
+        prompt("Bit 22")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B17,DBF_UCHAR) {
+        prompt("Bit 23")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B18,DBF_UCHAR) {
+        prompt("Bit 24")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B19,DBF_UCHAR) {
+        prompt("Bit 25")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B1A,DBF_UCHAR) {
+        prompt("Bit 26")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B1B,DBF_UCHAR) {
+        prompt("Bit 27")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B1C,DBF_UCHAR) {
+        prompt("Bit 28")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B1D,DBF_UCHAR) {
+        prompt("Bit 29")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B1E,DBF_UCHAR) {
+        prompt("Bit 30")
+        pp(TRUE)
+        interest(1)
+    }
+    field(B1F,DBF_UCHAR) {
+        prompt("Bit 31")
         pp(TRUE)
         interest(1)
     }
diff --git a/src/std/rec/mbboDirectRecord.c b/src/std/rec/mbboDirectRecord.c
index 750228b..73cab36 100644
--- a/src/std/rec/mbboDirectRecord.c
+++ b/src/std/rec/mbboDirectRecord.c
@@ -95,7 +95,7 @@ static void convert(mbboDirectRecord *);
 static void monitor(mbboDirectRecord *);
 static long writeValue(mbboDirectRecord *);
 
-#define NUM_BITS 16
+#define NUM_BITS 32
 
 static long init_record(struct dbCommon *pcommon, int pass)
 {
@@ -117,7 +117,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
 
     recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
 
-    if (recGblInitConstantLink(&prec->dol, DBF_USHORT, &prec->val))
+    if (recGblInitConstantLink(&prec->dol, DBF_ULONG, &prec->val))
         prec->udf = FALSE;
 
     /* Initialize MASK if the user set NOBT instead */
@@ -142,8 +142,8 @@ static long init_record(struct dbCommon *pcommon, int pass)
 
     if (!prec->udf &&
         prec->omsl == menuOmslsupervisory) {
-        /* Set initial B0 - BF from VAL */
-        epicsUInt16 val = prec->val;
+        /* Set initial B0 - B1F from VAL */
+        epicsUInt32 val = prec->val;
         epicsUInt8 *pBn = &prec->b0;
         int i;
 
@@ -175,9 +175,9 @@ static long process(struct dbCommon *pcommon)
     if (!pact) {
         if (!dbLinkIsConstant(&prec->dol) &&
             prec->omsl == menuOmslclosed_loop) {
-            epicsUInt16 val;
+            epicsUInt32 val;
 
-            if (dbGetLink(&prec->dol, DBR_USHORT, &val, 0, 0)) {
+            if (dbGetLink(&prec->dol, DBR_ULONG, &val, 0, 0)) {
                 recGblSetSevr(prec, LINK_ALARM, INVALID_ALARM);
                 goto CONTINUE;
             }
@@ -185,8 +185,8 @@ static long process(struct dbCommon *pcommon)
         }
         else if (prec->omsl == menuOmslsupervisory) {
             epicsUInt8 *pBn = &prec->b0;
-            epicsUInt16 val = 0;
-            epicsUInt16 bit = 1;
+            epicsUInt32 val = 0;
+            epicsUInt32 bit = 1;
             int i;
 
             /* Construct VAL from B0 - BF */
@@ -280,7 +280,7 @@ static long special(DBADDR *paddr, int after)
         if (prec->omsl == menuOmslclosed_loop) {
             /* Construct VAL from B0 - BF */
             epicsUInt8 *pBn = &prec->b0;
-            epicsUInt16 val = 0, bit = 1;
+            epicsUInt32 val = 0, bit = 1;
             int i;
 
             for (i = 0; i < NUM_BITS; i++, bit <<= 1)
@@ -290,7 +290,7 @@ static long special(DBADDR *paddr, int after)
         }
         else if (prec->omsl == menuOmslsupervisory) {
             /* Set B0 - BF from VAL and post monitors */
-            epicsUInt16 val = prec->val;
+            epicsUInt32 val = prec->val;
             epicsUInt8 *pBn = &prec->b0;
             int i;
 
@@ -362,7 +362,7 @@ static long writeValue(mbboDirectRecord *prec)
     case menuYesNoYES: {
         recGblSetSevr(prec, SIMM_ALARM, prec->sims);
         if (prec->pact || (prec->sdly < 0.)) {
-            status = dbPutLink(&prec->siol, DBR_USHORT, &prec->val, 1);
+            status = dbPutLink(&prec->siol, DBR_ULONG, &prec->val, 1);
             prec->pact = FALSE;
         } else { /* !prec->pact && delay >= 0. */
             CALLBACK *pvt = prec->simpvt;
diff --git a/src/std/rec/mbboDirectRecord.dbd b/src/std/rec/mbboDirectRecord.dbd
index 241199d..66ba3ba 100644
--- a/src/std/rec/mbboDirectRecord.dbd
+++ b/src/std/rec/mbboDirectRecord.dbd
@@ -8,7 +8,7 @@
 #*************************************************************************
 recordtype(mbboDirect) {
     include "dbCommon.dbd" 
-    field(VAL,DBF_USHORT) {
+    field(VAL,DBF_LONG) {
         prompt("Word")
         promptgroup("50 - Output")
         asl(ASL0)
@@ -38,6 +38,99 @@ recordtype(mbboDirect) {
         promptgroup("50 - Output")
         interest(1)
     }
+    field(RVAL,DBF_ULONG) {
+        prompt("Raw Value")
+        special(SPC_NOMOD)
+        pp(TRUE)
+    }
+    field(ORAW,DBF_ULONG) {
+        prompt("Prev Raw Value")
+        special(SPC_NOMOD)
+        interest(3)
+    }
+    field(RBV,DBF_ULONG) {
+        prompt("Readback Value")
+        special(SPC_NOMOD)
+    }
+    field(ORBV,DBF_ULONG) {
+        prompt("Prev Readback Value")
+        special(SPC_NOMOD)
+        interest(3)
+    }
+    field(MASK,DBF_ULONG) {
+        prompt("Hardware Mask")
+        special(SPC_NOMOD)
+        interest(1)
+    }
+    field(MLST,DBF_LONG) {
+        prompt("Last Value Monitored")
+        special(SPC_NOMOD)
+        interest(3)
+    }
+    field(SHFT,DBF_USHORT) {
+        prompt("Shift")
+        promptgroup("50 - Output")
+        interest(1)
+    }
+    field(SIOL,DBF_OUTLINK) {
+        prompt("Simulation Output Link")
+        promptgroup("90 - Simulate")
+        interest(1)
+    }
+    field(SIML,DBF_INLINK) {
+        prompt("Simulation Mode Link")
+        promptgroup("90 - Simulate")
+        interest(1)
+    }
+    field(SIMM,DBF_MENU) {
+        prompt("Simulation Mode")
+        special(SPC_MOD)
+        interest(1)
+        menu(menuYesNo)
+    }
+    field(SIMS,DBF_MENU) {
+        prompt("Simulation Mode Severity")
+        promptgroup("90 - Simulate")
+        interest(2)
+        menu(menuAlarmSevr)
+    }
+    field(OLDSIMM,DBF_MENU) {
+        prompt("Prev. Simulation Mode")
+        special(SPC_NOMOD)
+        interest(4)
+        menu(menuSimm)
+    }
+    field(SSCN,DBF_MENU) {
+        prompt("Sim. Mode Scan")
+        promptgroup("90 - Simulate")
+        interest(1)
+        menu(menuScan)
+        initial("65535")
+    }
+    field(SDLY,DBF_DOUBLE) {
+        prompt("Sim. Mode Async Delay")
+        promptgroup("90 - Simulate")
+        interest(2)
+        initial("-1.0")
+    }
+    %#include "callback.h"
+    field(SIMPVT,DBF_NOACCESS) {
+        prompt("Sim. Mode Private")
+        special(SPC_NOMOD)
+        interest(4)
+        extra("CALLBACK            *simpvt")
+    }
+    field(IVOA,DBF_MENU) {
+        prompt("INVALID outpt action")
+        promptgroup("50 - Output")
+        interest(2)
+        menu(menuIvoa)
+    }
+    field(IVOV,DBF_LONG) {
+        prompt("INVALID output value")
+        promptgroup("50 - Output")
+        interest(2)
+    }
     field(B0,DBF_UCHAR) {
         prompt("Bit 0")
         promptgroup("51 - Output 0-7")
@@ -96,151 +189,170 @@ recordtype(mbboDirect) {
     }
     field(B8,DBF_UCHAR) {
         prompt("Bit 8")
-        promptgroup("52 - Output 9-F")
+        promptgroup("52 - Output 8-15")
         special(SPC_MOD)
         pp(TRUE)
         interest(1)
     }
     field(B9,DBF_UCHAR) {
         prompt("Bit 9")
-        promptgroup("52 - Output 9-F")
+        promptgroup("52 - Output 8-15")
         special(SPC_MOD)
         pp(TRUE)
         interest(1)
     }
     field(BA,DBF_UCHAR) {
         prompt("Bit 10")
-        promptgroup("52 - Output 9-F")
+        promptgroup("52 - Output 8-15")
         special(SPC_MOD)
         pp(TRUE)
         interest(1)
     }
     field(BB,DBF_UCHAR) {
         prompt("Bit 11")
-        promptgroup("52 - Output 9-F")
+        promptgroup("52 - Output 8-15")
         special(SPC_MOD)
         pp(TRUE)
         interest(1)
     }
     field(BC,DBF_UCHAR) {
         prompt("Bit 12")
-        promptgroup("52 - Output 9-F")
+        promptgroup("52 - Output 8-15")
         special(SPC_MOD)
         pp(TRUE)
         interest(1)
     }
     field(BD,DBF_UCHAR) {
         prompt("Bit 13")
-        promptgroup("52 - Output 9-F")
+        promptgroup("52 - Output 8-15")
         special(SPC_MOD)
         pp(TRUE)
         interest(1)
     }
     field(BE,DBF_UCHAR) {
         prompt("Bit 14")
-        promptgroup("52 - Output 9-F")
+        promptgroup("52 - Output 8-15")
         special(SPC_MOD)
         pp(TRUE)
         interest(1)
     }
     field(BF,DBF_UCHAR) {
         prompt("Bit 15")
-        promptgroup("52 - Output 9-F")
+        promptgroup("52 - Output 8-15")
         special(SPC_MOD)
         pp(TRUE)
         interest(1)
     }
-    field(RVAL,DBF_ULONG) {
-        prompt("Raw Value")
-        special(SPC_NOMOD)
+    field(B10,DBF_UCHAR) {
+        prompt("Bit 16")
+        promptgroup("53 - Output 16-23")
+        special(SPC_MOD)
         pp(TRUE)
+        interest(1)
     }
-    field(ORAW,DBF_ULONG) {
-        prompt("Prev Raw Value")
-        special(SPC_NOMOD)
-        interest(3)
-    }
-    field(RBV,DBF_ULONG) {
-        prompt("Readback Value")
-        special(SPC_NOMOD)
+    field(B11,DBF_UCHAR) {
+        prompt("Bit 17")
+        promptgroup("53 - Output 16-23")
+        special(SPC_MOD)
+        pp(TRUE)
+        interest(1)
     }
-    field(ORBV,DBF_ULONG) {
-        prompt("Prev Readback Value")
-        special(SPC_NOMOD)
-        interest(3)
+    field(B12,DBF_UCHAR) {
+        prompt("Bit 18")
+        promptgroup("53 - Output 16-23")
+        special(SPC_MOD)
+        pp(TRUE)
+        interest(1)
     }
-    field(MASK,DBF_ULONG) {
-        prompt("Hardware Mask")
-        special(SPC_NOMOD)
+    field(B13,DBF_UCHAR) {
+        prompt("Bit 19")
+        promptgroup("53 - Output 16-23")
+        special(SPC_MOD)
+        pp(TRUE)
         interest(1)
     }
-    field(MLST,DBF_ULONG) {
-        prompt("Last Value Monitored")
-        special(SPC_NOMOD)
-        interest(3)
+    field(B14,DBF_UCHAR) {
+        prompt("Bit 20")
+        promptgroup("53 - Output 16-23")
+        special(SPC_MOD)
+        pp(TRUE)
+        interest(1)
     }
-    field(SHFT,DBF_ULONG) {
-        prompt("Shift")
-        promptgroup("50 - Output")
+    field(B15,DBF_UCHAR) {
+        prompt("Bit 21")
+        promptgroup("53 - Output 16-23")
+        special(SPC_MOD)
+        pp(TRUE)
         interest(1)
     }
-    field(SIOL,DBF_OUTLINK) {
-        prompt("Simulation Output Link")
-        promptgroup("90 - Simulate")
+    field(B16,DBF_UCHAR) {
+        prompt("Bit 22")
+        promptgroup("53 - Output 16-23")
+        special(SPC_MOD)
+        pp(TRUE)
         interest(1)
     }
-    field(SIML,DBF_INLINK) {
-        prompt("Simulation Mode Link")
-        promptgroup("90 - Simulate")
+    field(B17,DBF_UCHAR) {
+        prompt("Bit 23")
+        promptgroup("53 - Output 16-23")
+        special(SPC_MOD)
+        pp(TRUE)
         interest(1)
     }
-    field(SIMM,DBF_MENU) {
-        prompt("Simulation Mode")
+    field(B18,DBF_UCHAR) {
+        prompt("Bit 24")
+        promptgroup("54 - Output 16-31")
         special(SPC_MOD)
+        pp(TRUE)
         interest(1)
-        menu(menuYesNo)
     }
-    field(SIMS,DBF_MENU) {
-        prompt("Simulation Mode Severity")
-        promptgroup("90 - Simulate")
-        interest(2)
-        menu(menuAlarmSevr)
+    field(B19,DBF_UCHAR) {
+        prompt("Bit 25")
+        promptgroup("54 - Output 16-31")
+        special(SPC_MOD)
+        pp(TRUE)
+        interest(1)
     }
-    field(OLDSIMM,DBF_MENU) {
-        prompt("Prev. Simulation Mode")
-        special(SPC_NOMOD)
-        interest(4)
-        menu(menuSimm)
+    field(B1A,DBF_UCHAR) {
+        prompt("Bit 26")
+        promptgroup("54 - Output 16-31")
+        special(SPC_MOD)
+        pp(TRUE)
+        interest(1)
     }
-    field(SSCN,DBF_MENU) {
-        prompt("Sim. Mode Scan")
-        promptgroup("90 - Simulate")
+    field(B1B,DBF_UCHAR) {
+        prompt("Bit 27")
+        promptgroup("54 - Output 16-31")
+        special(SPC_MOD)
+        pp(TRUE)
         interest(1)
-        menu(menuScan)
-        initial("65535")
     }
-    field(SDLY,DBF_DOUBLE) {
-        prompt("Sim. Mode Async Delay")
-        promptgroup("90 - Simulate")
-        interest(2)
-        initial("-1.0")
+    field(B1C,DBF_UCHAR) {
+        prompt("Bit 28")
+        promptgroup("54 - Output 16-31")
+        special(SPC_MOD)
+        pp(TRUE)
+        interest(1)
     }
-    %#include "callback.h"
-    field(SIMPVT,DBF_NOACCESS) {
-        prompt("Sim. Mode Private")
-        special(SPC_NOMOD)
-        interest(4)
-        extra("CALLBACK            *simpvt")
+    field(B1D,DBF_UCHAR) {
+        prompt("Bit 29")
+        promptgroup("54 - Output 16-31")
+        special(SPC_MOD)
+        pp(TRUE)
+        interest(1)
     }
-    field(IVOA,DBF_MENU) {
-        prompt("INVALID outpt action")
-        promptgroup("50 - Output")
-        interest(2)
-        menu(menuIvoa)
+    field(B1E,DBF_UCHAR) {
+        prompt("Bit 30")
+        promptgroup("54 - Output 16-31")
+        special(SPC_MOD)
+        pp(TRUE)
+        interest(1)
     }
-    field(IVOV,DBF_USHORT) {
-        prompt("INVALID output value")
-        promptgroup("50 - Output")
-        interest(2)
+    field(B1F,DBF_UCHAR) {
+        prompt("Bit 31")
+        promptgroup("54 - Output 16-31")
+        special(SPC_MOD)
+        pp(TRUE)
+        interest(1)
     }
 }
diff --git a/test/std/rec/Makefile b/test/std/rec/Makefile
index 203a1ee..0ea0252 100644
--- a/test/std/rec/Makefile
+++ b/test/std/rec/Makefile
@@ -117,6 +117,13 @@ testHarness_SRCS += simmTest_registerRecordDeviceDriver.cpp
 TESTFILES += $(COMMON_DIR)/simmTest.dbd $(COMMON_DIR)/simmTest.db
 TESTS += simmTest
 
+TESTPROD_HOST += mbbioDirectTest
+mbbioDirectTest_SRCS += mbbioDirectTest.c
+mbbioDirectTest_SRCS += recTestIoc_registerRecordDeviceDriver.cpp
+testHarness_SRCS += mbbioDirectTest.c
+TESTFILES += ../mbbioDirectTest.db
+TESTS += mbbioDirectTest
+
 # epicsRunRecordTests runs all the test programs in a known working order.
 testHarness_SRCS += epicsRunRecordTests.c
 
diff --git a/test/std/rec/mbbioDirectTest.c b/test/std/rec/mbbioDirectTest.c
new file mode 100644
index 0000000..00a464e
--- /dev/null
+++ b/test/std/rec/mbbioDirectTest.c
@@ -0,0 +1,132 @@
+/*************************************************************************\
+* Copyright (c) 2017 Dirk Zimoch
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
+\*************************************************************************/
+
+#include <string.h>
+
+#include "dbAccess.h"
+#include "errlog.h"
+#include "dbStaticLib.h"
+#include "dbUnitTest.h"
+#include "testMain.h"
+#include "epicsThread.h"
+
+static
+void testmbbioFields(const char* rec, unsigned int value)
+{
+    char field[40];
+    unsigned int i;
+    
+    testdbGetFieldEqual(rec, DBF_ULONG, value);
+    for (i=0; i < 32; i++)
+    {
+        sprintf(field,"%s.B%X", rec, i);
+        testdbGetFieldEqual(field, DBF_ULONG, (value>>i)&1);
+    }
+}
+
+static
+void testmbbioRecords(unsigned int count, unsigned int value)
+{
+    char rec[40];
+    unsigned int i;
+    
+    for (i = 1; i <= count; i++)
+    {
+        sprintf(rec, "do%d", i);
+        testDiag("  ### %s ###", rec);
+        testmbbioFields(rec, value);
+        sprintf(rec, "di%d", i);
+        testmbbioFields(rec, value);
+    }
+}
+
+static
+void putN(const char* pattern, unsigned int count, unsigned int value)
+{
+    char field[40];
+    unsigned int i;
+    
+    for (i = 1; i <= count; i++)
+    {
+        sprintf(field, pattern, i);
+        testdbPutFieldOk(field, DBF_ULONG, value);
+    }
+}
+
+static
+void testN(const char* pattern, unsigned int count, unsigned int value)
+{
+    char field[40];
+    unsigned int i;
+    
+    for (i = 1; i <= count; i++)
+    {
+        sprintf(field, pattern, i);
+        testdbGetFieldEqual(field, DBF_ULONG, value);
+    }
+}
+
+void recTestIoc_registerRecordDeviceDriver(struct dbBase *);
+
+MAIN(mbbioDirectTest)
+{
+    unsigned int value = 0xdeadbeef;
+    unsigned int simvalue = 0;
+    char macros [40];
+    const unsigned int N = 3;
+    
+    testPlan(N*((32+1)*2*4+4+3)+1);
+
+    testdbPrepare();
+
+    testdbReadDatabase("recTestIoc.dbd", NULL, NULL);
+
+    recTestIoc_registerRecordDeviceDriver(pdbbase);
+
+    sprintf(macros, "INIT=%#x", value);
+    testdbReadDatabase("mbbioDirectTest.db", NULL, macros);
+
+    eltc(0);
+    testIocInitOk();
+    eltc(1);
+
+    testDiag("##### check initial value #####");
+    testmbbioRecords(N, value);
+
+    testDiag("##### set bit 5 #####");
+    putN("do%u.B5", N, 1);
+    value |= (1<<5);
+    testN("val%d", N,  value);
+    /* allow async input to process */
+    epicsThreadSleep(0.0);
+    testmbbioRecords(N, value);
+
+    testDiag("##### clear bit 31 (0x1f) #####");
+    putN("do%u.B1F", N, 0);
+    value &= ~(1<<31);
+    testN("val%d", N,  value);
+    /* allow async input to process */
+    epicsThreadSleep(0.0);
+    testmbbioRecords(N, value);
+
+    testDiag("##### simulation mode #####");
+    testdbPutFieldOk("sim", DBF_ULONG, 1);
+    simvalue = value & ~1;
+    putN("do%u.B0", N, 0);
+    /* old value in lo* */
+    testN("val%d", N,  value);
+    /* sim value in sim* */
+    testN("sim%d", N,  simvalue);
+    /* allow async input to process */
+    epicsThreadSleep(0.0);
+    testmbbioRecords(N, simvalue);
+
+    testIocShutdownOk();
+
+    testdbCleanup();
+
+    return testDone();
+}
diff --git a/test/std/rec/mbbioDirectTest.db b/test/std/rec/mbbioDirectTest.db
new file mode 100644
index 0000000..66b3a87
--- /dev/null
+++ b/test/std/rec/mbbioDirectTest.db
@@ -0,0 +1,67 @@
+record(bo, "sim") {
+}
+
+record(mbboDirect, "do1") {
+  field(DOL, "$(INIT=0)")
+  field(DTYP, "Soft Channel")
+  field(OUT, "val1 PP")
+  field(SIOL, "sim1 PP")
+  field(SIML, "sim")
+  field(PINI, "YES")
+}
+record(longout, "val1") {
+  field(FLNK, "di1")
+}
+record(longout, "sim1") {
+  field(FLNK, "di1")
+}
+record(mbbiDirect, "di1") {
+  field(DTYP, "Soft Channel")
+  field(INP, "val1")
+  field(SIOL, "sim1 PP")
+  field(SIML, "sim")
+}
+
+
+record(mbboDirect, "do2") {
+  field(DOL, "$(INIT=0)")
+  field(DTYP, "Raw Soft Channel")
+  field(OUT, "val2 PP")
+  field(SIOL, "sim2 PP")
+  field(SIML, "sim")
+  field(PINI, "YES")
+}
+record(longout, "val2") {
+  field(FLNK, "di2")
+}
+record(longout, "sim2") {
+  field(FLNK, "di2")
+}
+record(mbbiDirect, "di2") {
+  field(DTYP, "Raw Soft Channel")
+  field(INP, "val2")
+  field(SIML, "sim")
+  field(SIOL, "sim2")
+}
+
+
+record(mbboDirect, "do3") {
+  field(DOL, "$(INIT=0)")
+  field(DTYP, "Async Soft Channel")
+  field(OUT, "val3 PP")
+  field(SIOL, "sim3 PP")
+  field(SIML, "sim")
+  field(PINI, "YES")
+}
+record(longout, "val3") {
+  field(FLNK, "di3")
+}
+record(longout, "sim3") {
+  field(FLNK, "di3")
+}
+record(mbbiDirect, "di3") {
+  field(DTYP, "Async Soft Channel")
+  field(INP, "val3")
+  field(SIOL, "sim3")
+  field(SIML, "sim")
+}
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index 35fdfad..0ba01c3 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -16,6 +16,16 @@
 <p>Description</p>
 
 -->
+<h3>Record types mbbiDirect and mbboDirect upgraded to 32 bit</h3>
+
+<p>The VAL fields and related fields of these records are now <tt>DBF_LONG</tt>.
+(Not <tt>DBF_ULONG</tt> in order to prevent Channel Access from promoting them to
+<tt>DBF_DOUBLE</tt>.) Additional bit fields <tt>B10</tt>...<tt>B1F</tt> have been
+added.
+
+Device support that accesses <tt>VAL</tt> or the bit fields directly (most don't)
+should use 32 bit integer types and check the EPICS base version to know the number
+of bit fields.
 
 <h3>Changed SIML failure behavior</h3>
 

References:
mbbioDirect 32 bit for EPICS 7 Dirk Zimoch

Navigate by Date:
Prev: Re: Releasing 3.14.12.7 Dirk Zimoch
Next: Re: Appveyor-CI builds are back Ralph Lange
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: mbbioDirect 32 bit for EPICS 7 Dirk Zimoch
Next: moving initHooks into libCom Michael Davidsaver
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
ANJ, 21 Dec 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·