EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: RE: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "Marco A. Barra Montevechi Filho" <marco.filho at lnls.br>
Cc: Junior Cintra Mauricio <junior.mauricio at lnls.br>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, João Pedro Burle Ishida <joao.ishida at lnls.br>
Date: Mon, 25 Apr 2022 17:01:49 +0000

Hi Marco,

 

Ø  2022/04/25 11:54:35.501 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_P function=0x6, offset=00, value=0x640

Ø  2022/04/25 11:54:35.501 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_I function=0x6, offset=00, value=0x1c

Ø  2022/04/25 11:54:36.005 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3e80

 

Ø  2022/04/25 11:54:36.096 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

Ø  2022/04/25 11:54:36.096 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

 

Ø  So instead of trying to write 1500 in the modbus message, the IOC tried to write 1600 to it, which clearly means that its getting the value from some reading in the equipment and miscalculating the message. Looking at the .db file, though, i cant seem to find any reason for the IOC to "know" which value to send.

 

asyn device support for output records does a single read operation during iocInit to get the current value from the device.  If that read operation is successful, i.e. returns ASYN_SUCCESS, then that value it put into the record.  This supports “bumpless reboots” so that output records match the current state of the hardware.

 

The first readInt32 line above is reading the P variable, and it read 0x640=1600.  If you are using an implied decimal point of 1 digit that is 160.0, if an implied decimal point of 2 digits then it is 16.0.  The second readInt32 line is reading the I variable, and it read 0x1c=28.

 

About 0.5 second later there is a write operation to the P variable.  It writes 0x3e80=16000.  That is a value of 1600.0 degrees if 1 implied decimal digit or 160.0 if 2 digits.

 

The problem is that the value being written is 10 times larger than the value read back from the device. It seems like the value read during iocInit is not being scaled by ASLO when it is put into the record VAL field.  However, the code indicates this should be happening:

 

For asynInt32 device support for the ao record this is the code that does the initial read from the device:

 

https://github.com/epics-modules/asyn/blob/45d4679b0a0bb405aacf928013d0982247067b52/asyn/devEpics/devAsynInt32.c#L967

 

    status = pasynInt32SyncIO->read(pPvt->pasynUserSync,

                      &value, pPvt->pasynUser->timeout);

    if (pPvt->mask) {

        value &= pPvt->mask;

        if (pPvt->bipolar && (value & pPvt->signBit)) value |= ~pPvt->mask;

    }

    if (status == asynSuccess) {

        pao->rval = value;

        return INIT_OK;

    }

    return INIT_DO_NOT_CONVERT; /* Do not convert */

 

So if the read is successful it puts the integer value read from the device into the RVAL field of the record and returns INIT_OK to record support.

 

This is from the ao record init_record function in base 7.0.5:

 

    if (pdset->common.init_record) {

        status = pdset->common.init_record(pcommon);

        if (prec->linr == menuConvertSLOPE) {

            prec->eoff = eoff;

            prec->eslo = eslo;

        }

        switch(status){

        case(0): /* convert */

            value = (double)prec->rval + (double)prec->roff;

            if(prec->aslo!=0.0) value *= prec->aslo;

            value += prec->aoff;

            if (prec->linr == menuConvertNO_CONVERSION){

                ; /*do nothing*/

            } else if ((prec->linr == menuConvertLINEAR) ||

                      (prec->linr == menuConvertSLOPE)) {

                value = value*prec->eslo + prec->eoff;

            }else{

                if(cvtRawToEngBpt(&value,prec->linr,prec->init,

                        (void *)&prec->pbrk,&prec->lbrk)!=0) break;

            }

            prec->val = value;

            prec->udf = isnan(value);

        break;

        case(2): /* no convert */

        break;

        default:

             recGblRecordError(S_dev_badInitRet,(void *)prec,"ao: init_record");

             return(S_dev_badInitRet);

        }

 

So if device support passes back INIT_OK (0) then the VAL field is set to RVAL adjusted by ASLO and AOFF.

 

I think I just figured out the problem.  Your code is setting ASLO and AOFF after iocInit with the dfanout records.  The problem is that during init_record() the ASLO value has not yet been set, so the scaling of the readback does not occur.

 

I think you could fix this by adding the ASLO field to autosave.  I think that value would be restored in time to use it during that initial readback operation.

 

Mark

 

 

From: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>
Sent: Monday, April 25, 2022 10:13 AM
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: Junior Cintra Mauricio <junior.mauricio at lnls.br>; João Pedro Burle Ishida <joao.ishida at lnls.br>; tech-talk at aps.anl.gov
Subject: Re: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed

 

Hello and good morning!

I finally managed to test our assumptions and advance a little, i think. I initialized the IOC and did caget in PNR:EU2408:P, PNR:EU2408:P.ASLO and PNR:EU2408:P:RBV.
The initial values are PNR:EU2408:P=1500, PNR:EU2408:P.ASLO=0.1 and PNR:EU2408:P:RBV=150.

The IOC initialization looks like:

(...)

iocInit

Starting iocInit

############################################################################

## EPICS R3.15.6

## EPICS Base built Sep 27 2021

############################################################################

2022/04/25 11:49:10.866 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_P function=0x6, offset=00, value=0x5dc

2022/04/25 11:49:10.867 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_I function=0x6, offset=00, value=0x1c

2022/04/25 11:49:11.369 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3a98

iocRun: All initialization complete

## Start any sequence programs

#seq sncxxx,"user=gabrielfedelHost"

2022/04/25 11:49:11.485 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

2022/04/25 11:49:11.485 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

epics>

I append the full log in the end of this e-mail. What i think is important information​: after initializing the IOC, i did caput PNR:EU2408:P 160 and the IOC terminal returned:

 

epics> 2022/04/25 11:51:54.767 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x640
2022/04/25 11:51:54.803 drvModbusAsyn::writeInt32 port Eurotherm_EMODBUS_1_1_Wr_P function=0x6, modbusAddress=06, buffer[0]=0x640, bufferLen=1

Indeed, cagetting the P and P:RBV PVs returned the right 160 value. Caputting 1600 returned exception 3. The curious thing is: if i stop the IOC and reinitialize it, the terminal now returns:

(...)

2022/04/25 11:54:35.501 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_P function=0x6, offset=00, value=0x640

2022/04/25 11:54:35.501 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_I function=0x6, offset=00, value=0x1c

2022/04/25 11:54:36.005 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3e80

iocRun: All initialization complete

## Start any sequence programs

#seq sncxxx,"user=gabrielfedelHost"

2022/04/25 11:54:36.096 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

2022/04/25 11:54:36.096 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

epics>

So instead of trying to write 1500 in the modbus message, the IOC tried to write 1600 to it, which clearly means that its getting the value from some reading in the equipment and miscalculating the message. Looking at the .db file, though, i cant seem to find any reason for the IOC to "know" which value to send. I append the complete db file at the end of this email, but the PVs that i think are of interest are:

record(mbbo, "${BL}:EU2408:PREC") {

        field(ZRST, "1 Decimal Place")

        field(ONST, "2 Decimal Places")

        field(ZRVL, "1")

        field(ONVL, "2")

        field(FLNK, "${BL}:EU2408:SETASLO")

        field(RVAL, "4")

        field(PINI, "YES")

}
record(dfanout, "${BL}:EU2408:SETASLO") {

        field(OMSL, "closed_loop")

        field(DOL, "${BL}:EU2408:CALCASLO PP")

        field(OUTA, "${BL}:EU2408:SP.ASLO")

        field(OUTB, "${BL}:EU2408:SP:RBV.ASLO")

        field(OUTC, "${BL}:EU2408:RR.ASLO")

        field(OUTD, "${BL}:EU2408:RR:RBV.ASLO")

        field(OUTE, "${BL}:EU2408:PV:RBV.ASLO")

        field(OUTF, "${BL}:EU2408:P.ASLO")

        field(OUTG, "${BL}:EU2408:P:RBV.ASLO")

        field(FLNK, "${BL}:EU2408:SETPREC")

}

 

record(dfanout, "${BL}:EU2408:SETPREC") {

        field(OMSL, "closed_loop")

        field(DOL, "${BL}:EU2408:PREC.RVAL")

        field(OUTA, "${BL}:EU2408:SP.PREC PP")

        field(OUTB, "${BL}:EU2408:SP:RBV.PREC PP")

        field(OUTC, "${BL}:EU2408:RR.PREC PP")

        field(OUTD, "${BL}:EU2408:RR:RBV.PREC PP")

        field(OUTE, "${BL}:EU2408:PV:RBV.PREC PP")

        field(OUTF, "${BL}:EU2408:P.PREC PP")

        field(OUTG, "${BL}:EU2408:P:RBV.PREC PP")

}
record(ao, "${BL}:EU2408:P") {

  field(DESC, "P Param")

  field(DTYP, "asynInt32")

  field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_P,0,1000)MODBUS_DATA")

}

I understand that ${BL}:EU2408:PREC is causing ${BL}:EU2408:P to process at initialization, but i cant understand where ${BL}:EU2408:P is getting its initial value from. Any suggestions?

Thanks in advance,

Marco

OBS1: Full db file:

#record(ai, "${BL}:EU2408:PV:RBV") {
#  field(DESC, "Temperature Readback")
#  field(DTYP, "asynInt32")
#  field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_PV,0,1000)MODBUS_DATA")
#  field(EGU, "C")
#  field(SCAN, "I/O Intr")
#  field(ASLO, "0.1")
#}
 
# Template for general controller parameters using the Modbus interface
 
# % macro, P, Device prefix
# % macro, Q, Device suffix
# % macro, PORT, Asyn port
# % macro, ADDR, Modbus address
# % macro, DISABLED, Start disabled?
 
# Autotune loop number address 3072
record(mbbo, "${BL}:EU2408:AUTOTUNELOOP") {
        field(DESC, "Autotune Loop Number")
        field(DTYP,"asynInt32")
        field(OUT,"@asyn(Eurotherm_EMODBUS_1_0_Wr_ATUNE,0,1000)MODBUS_DATA")
        field(ZRST, "Off")
        field(ZRVL, "0")
        field(ONST, "Loop 1")
        field(ONVL, "11")
        field(TWST, "Loop 2")
        field(TWVL, "21")
        field(THST, "Loop 3")
        field(THVL, "31")
}
 
# % archiver 10 Monitor
record(mbbi, "${BL}:EU2408:AUTOTUNELOOP:RBV") {
        field(DESC, "Autotune Loop Readback")
        field(DTYP,"asynInt32")
        field(INP,"@asyn(Eurotherm_EMODBUS_1_0_Rd_ATUNE,0,1000)MODBUS_DATA")
        field(SCAN, "I/O Intr")
        field(ZRST, "Off")
        field(ZRVL, "0")
        field(ONST, "Loop 1")
        field(ONVL, "11")
        field(TWST, "Loop 2")
        field(TWVL, "21")
        field(THST, "Loop 3")
        field(THVL, "31")
}
 
# Autotune output high limit address 3076
record(ao, "${BL}:EU2408:AUTOTUNEOH") {
        field(DESC, "Autotune Output High Limit")
        field(DTYP,"asynInt32")
        field(OUT,"@asyn(Eurotherm_EMODBUS_1_0_Wr_ATUNE,4,1000)MODBUS_DATA")
        field(PREC, "1")
        field(ASLO, "0.1")
        field(DRVH, "100")
        field(DRVL, "0")
        field(EGU, "%")
}
 
# % archiver 10 Monitor
record(ai, "${BL}:EU2408:AUTOTUNEOH:RBV") {
        field(DESC, "Autotune Output High Limit Readback")
        field(DTYP,"asynInt32")
        field(INP,"@asyn(Eurotherm_EMODBUS_1_0_Rd_ATUNE,4,1000)MODBUS_DATA")
        field(PREC, "1")
        field(ASLO, "0.1")
        field(SCAN, "I/O Intr")
        field(EGU, "%")
}
 
# Autotune output low limit address 3077
record(ao, "${BL}:EU2408:AUTOTUNEOL") {
        field(DESC, "Autotune Output Low Limit")
        field(DTYP,"asynInt32")
        field(OUT,"@asyn(Eurotherm_EMODBUS_1_0_Wr_ATUNE,5,1000)MODBUS_DATA")
        field(PREC, "1")
        field(ASLO, "0.1")
        field(DRVH, "100")
        field(DRVL, "0")
        field(EGU, "%")
}
 
# % archiver 10 Monitor
record(ai, "${BL}:EU2408:AUTOTUNEOL:RBV") {
        field(DESC, "Autotune Output Low Limit Readback")
        field(DTYP,"asynInt32")
        field(INP,"@asyn(Eurotherm_EMODBUS_1_0_Rd_ATUNE,5,1000)MODBUS_DATA")
        field(PREC, "1")
        field(SCAN, "I/O Intr")
        field(ASLO, "0.1")
        field(EGU, "%")
}
 
record(bo, "${BL}:EU2408:DISABLE") {
  field(DESC, "Disable comms")
  field(PINI, "YES")
  field(VAL, "0")
  field(ZNAM, "Enabled")
  field(ONAM, "Disabled")
}
 
record(stringin, "${BL}:EU2408:ERR") {
  field(DESC, "Error message")
  field(PINI, "YES")
  field(VAL, "No Error")
}
# Template for register based communications
# Instantiate once per loop - the device prefix and suffix combination must be unique for each loop
 
# Notes:
# Controller must be set to full resolution (Comms->H module->Resolution)
# The desired number of decimal places must also be set on the controller (Standard I/O->PV Input->Resolution):
# either XXX.XX or XXXX.X.  This must match the setting of the PREC macro.
# The decimal point is inferred, hence 25.01 is transmitted as 2501 which is converted using ASLO factor.
# If two decimal places are required the maximum value that can be set is 327.66 
# Also ensure that the Proportional Band units are set to 'Engineer units'
 
# % macro, P, Device prefix
# % macro, Q, Device suffix
# % macro, PORT, Asyn port
# % macro, ADDR, Modbus address
# % macro, LOOP, Loop number, default 1
# % macro, SPMIN, Minimum setpoint
# % macro, SPMAX, Maximum setpoint
# % macro, RRMAX, Maximum ramp rate
# % macro, PREC, Setpoint precision, must match controller setup
# % macro, EGUT, Engineering units for SP & RBV, etc, default is C
# % macro, EGU, Engineering units for ramp rate, default is C/s
# % macro, gda_name, Name to export to gda as
# % macro, gda_desc, Description for gda
# % macro, name, Object and gui association name
 
# This associates an edm screen with the template
# % gui, EMODBUS.LOOP1, edm, eurotherm2k_modbus.edl, P=${BL}:EU2408,Q=
 
# % gdatag,template,eurotherm2k,,
 
# should get this from eurothermModbus, but just in case define it here too...
record(bo, "${BL}:EU2408:DISABLE") {
  field(ZNAM, "Enabled")
  field(ONAM, "Disabled")
}
 
# PV: address 1
# % gdatag,pv,ro,,PVRBV
# % archiver 1 Monitor
record(ai, "${BL}:EU2408:PV:RBV") {
  field(DESC, "Temperature Readback")
  field(DTYP, "asynInt32")
  field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_PV,0,1000)MODBUS_DATA")
  field(EGU, "C")
  field(SCAN, "I/O Intr")
}
 
# Target setpoint: address 2
#% gdatag,pv,rw,,SP
# % autosave 2 VAL
record(ao, "${BL}:EU2408:SP") {
  field(DESC, "Setpoint")
  field(DTYP, "asynInt32")
  field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_PV,1,1000)MODBUS_DATA")
  field(EGU, "C")
  field(DRVH, "1000")
  field(DRVL, "-273")
  field(ASLO, "0.1")
}
 
# % gdatag,pv,ro,,SPRBV
# % archiver 10 Monitor
record(ai, "${BL}:EU2408:SP:RBV") {
  field(DESC, "Setpoint Readback")
  field(DTYP, "asynInt32")
  field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_PV,1,1000)MODBUS_DATA")
  field(EGU, "C")
  field(SCAN, "I/O Intr")
  field(ASLO, "0.1")  
}
 
# Target output power (manual mode): address 3
#% gdatag,pv,rw,,O
# % autosave 2 VAL
record(ao, "${BL}:EU2408:O") {
  field(DESC, "Output")
  field(DTYP, "asynInt32")
  field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_PV,2,1000)MODBUS_DATA")
  field(EGU, "%")
  field(DRVH, "100")
  field(DRVL, "-100")
  field(ASLO, "0.1")
  field(PREC, "1")
}
 
# % gdatag,pv,ro,,ORBV
# % archiver 1 Monitor
record(ai, "${BL}:EU2408:O:RBV") {
  field(DESC, "Output Readback")
  field(DTYP, "asynInt32")
  field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_PV,2,1000)MODBUS_DATA")
  field(EGU, "%")
  field(SCAN, "I/O Intr")
  field(ASLO, "0.1")
  field(PREC, "1")
}
 
# Working setpoint: address 5
# % gdatag,pv,ro,,WSPRBV
# % archiver 10 Monitor
record(ai, "${BL}:EU2408:WSP:RBV") {
  field(DESC, "Working SP Readback")
  field(DTYP, "asynInt32")
  field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_WSP,0,1000)MODBUS_DATA")
  field(EGU, "C")
  field(SCAN, "I/O Intr")
  field(ASLO, "0.1")
}
 
# Ramp rate: address 37
#% gdatag,pv,rw,,RR
# % autosave 2 VAL
record(ao, "${BL}:EU2408:RR") {
  field(DESC, "Ramprate")
  field(DTYP, "asynInt32")
  field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_RR,0,1000)MODBUS_DATA")
  field(EGU, "C/min")
  field(DRVH, "50")
  field(DRVL, "0")
}
 
# % gdatag,pv,ro,,RRRBV
# % archiver 10 Monitor
record(ai, "${BL}:EU2408:RR:RBV") {
  field(DESC, "Ramprate Readback")
  field(DTYP, "asynInt32")
  field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_RR,0,1000)MODBUS_DATA")
  field(EGU, "C/s")
  field(SCAN, "I/O Intr")
}
 
# Manual mode: address 273
# % autosave 2 VAL
record(bo, "${BL}:EU2408:MAN") {
  field(DESC, "Manual mode enable")
  field(DTYP, "asynUInt32Digital")
  field(OUT, "@asynMask(Eurotherm_EMODBUS_1_1_Wr_MAN,0,1,1000)MODBUS_DATA")
  field(ZNAM, "Automatic")
  field(ONAM, "Manual")
}
 
# % archiver 10 Monitor
record(bi, "${BL}:EU2408:MAN:RBV") {
  field(DESC, "Manual mode readback")
  field(DTYP, "asynUInt32Digital")
  field(INP, "@asynMask(Eurotherm_EMODBUS_1_1_Rd_MAN,0,1,1000)MODBUS_DATA")
  field(ZNAM, "Automatic")
  field(ONAM, "Manual")
  field(SCAN, "I/O Intr")
}
 
# Proportional gain term: address 351
# Note this must be set to operate engineering units (not %) for the precision to be correct
# otherwise it is a fixed precision of 1 decimal place
#% gdatag,pv,rw,,P
# % autosave 2 VAL
record(ao, "${BL}:EU2408:P") {
  field(DESC, "P Param")
  field(DTYP, "asynInt32")
  field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_P,0,1000)MODBUS_DATA")
}
 
# % gdatag,pv,ro,,PRBV
# % archiver 10 Monitor
record(ai, "${BL}:EU2408:P:RBV") {
  field(DESC, "P Param Readback")
  field(DTYP, "asynInt32")
  field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_P,0,1000)MODBUS_DATA")
  field(SCAN, "I/O Intr")
}
 
# Integral gain term: address 352
#% gdatag,pv,rw,,I
# % autosave 2 VAL
record(ao, "${BL}:EU2408:I") {
  field(DESC, "I Param")
  field(DTYP, "asynInt32")
  field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_I,0,1000)MODBUS_DATA")
}
 
# % gdatag,pv,ro,,IRBV
# % archiver 10 Monitor
record(ai, "${BL}:EU2408:I:RBV") {
  field(DESC, "I Param Readback")
  field(DTYP, "asynInt32")
  field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_I,0,1000)MODBUS_DATA")
  field(PREC, "1")
  field(SCAN, "I/O Intr")
}
 
# Derivative gain term: address 353
#% gdatag,pv,rw,,D
# % autosave 2 VAL
record(ao, "${BL}:EU2408:D") {
  field(DESC, "D Param")
  field(DTYP, "asynInt32")
  field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_D,0,1000)MODBUS_DATA")
}
 
# % gdatag,pv,ro,,DRBV
# % archiver 10 Monitor
record(ai, "${BL}:EU2408:D:RBV") {
  field(DESC, "D Param Readback")
  field(DTYP, "asynInt32")
  field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_D,0,1000)MODBUS_DATA")
  field(PREC, "1")
  field(SCAN, "I/O Intr")
}
 
# Record to switch between full resolution (2 decimal places) and reduced resolution (1 decimal place) which
# allows values larger than 327.66 to be transferred.
# % autosave 2 VAL
record(mbbo, "${BL}:EU2408:PREC") {
        field(ZRST, "1 Decimal Place")
        field(ONST, "2 Decimal Places")
        field(ZRVL, "1")
        field(ONVL, "2")
        field(FLNK, "${BL}:EU2408:SETASLO")
        field(RVAL, "4")
        field(PINI, "YES")
}
 
# Use ASLO of 0.01 if 2 decimal places required, otherwise 0.1
record(calcout, "${BL}:EU2408:CALCASLO") {
        field(INPA, "${BL}:EU2408:PREC.RVAL NPP")
        field(CALC, "A==1?0.1:0.01")
}
 
record(dfanout, "${BL}:EU2408:SETASLO") {
        field(OMSL, "closed_loop")
        field(DOL, "${BL}:EU2408:CALCASLO PP")
        field(OUTA, "${BL}:EU2408:SP.ASLO")
        field(OUTB, "${BL}:EU2408:SP:RBV.ASLO")
        field(OUTC, "${BL}:EU2408:RR.ASLO")
        field(OUTD, "${BL}:EU2408:RR:RBV.ASLO")
        field(OUTE, "${BL}:EU2408:PV:RBV.ASLO")
        field(OUTF, "${BL}:EU2408:P.ASLO")
        field(OUTG, "${BL}:EU2408:P:RBV.ASLO")
        field(FLNK, "${BL}:EU2408:SETPREC")
}
 
record(dfanout, "${BL}:EU2408:SETPREC") {
        field(OMSL, "closed_loop")
        field(DOL, "${BL}:EU2408:PREC.RVAL")
        field(OUTA, "${BL}:EU2408:SP.PREC PP")
        field(OUTB, "${BL}:EU2408:SP:RBV.PREC PP")
        field(OUTC, "${BL}:EU2408:RR.PREC PP")
        field(OUTD, "${BL}:EU2408:RR:RBV.PREC PP")
        field(OUTE, "${BL}:EU2408:PV:RBV.PREC PP")
        field(OUTF, "${BL}:EU2408:P.PREC PP")
        field(OUTG, "${BL}:EU2408:P:RBV.PREC PP")
}
###################################################################################
#PVs added in 19/04/2022 by Marco Montevechi, Junior Cintra Mauricio and Joao Pedro Burle Ishida
record(ao, "${BL}:EU2408:PROG") {
field(DESC, "Current program running (no.)")
field(DTYP, "asynInt32")
field(OUT, "@asyn(Eurotherm_EMODBUS_1_0_Wr_PROG,0,1000)MODBUS_DATA")
}
 
 
 
# % gdatag,pv,ro,,PROG:RBV
record(ai, "${BL}:EU2408:PROG:RBV") {
field(DESC, "Current program running (no.) Readback")
field(DTYP, "asynInt32")
field(INP, "@asyn(Eurotherm_EMODBUS_1_0_Rd_PROG,0,1000)MODBUS_DATA")
field(SCAN, "I/O Intr")
}
 
 
 
 
# Programmer setpoint: address 163
#% gdatag,pv,rw,,PSP
# % autosave 2 VAL
record(ao, "${BL}:EU2408:PSP") {
field(DESC, " Programmer Setpoint")
field(DTYP, "asynInt32")
field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_PSP,0,1000)MODBUS_DATA")
field(EGU, "°C")
field(DRVH, "1000")
field(DRVL, "-273")
field(ASLO, "0.1")
}
 
 
 
# % gdatag,pv,ro,,SPRBV
record(ai, "${BL}:EU2408:PSP:RBV") {
field(DESC, "Programmer Setpoint Readback")
field(DTYP, "asynInt32")
field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_PSP,0,1000)MODBUS_DATA")
field(EGU, "°C")
field(SCAN, "I/O Intr")
field(ASLO, "0.1")
}
 
 
 
 
# Number program running: address 59
#% gdatag,pv,rw,,CYC
# % autosave 2 VAL
record(ao, "${BL}:EU2408:CYC") {
field(DESC, "Program cycles remaining")
field(DTYP, "asynInt32")
field(OUT, "@asyn(Eurotherm_EMODBUS_1_0_Wr_CYC,0,1000)MODBUS_DATA")
}
 
 
 
# % gdatag,pv,ro,,CYC:RBV
record(ai, "${BL}:EU2408:CYC:RBV") {
field(DESC, "Program cycles remaining Readback")
field(DTYP, "asynInt32")
field(INP, "@asyn(Eurotherm_EMODBUS_1_0_Rd_CYC,0,1000)MODBUS_DATA")
field(SCAN, "I/O Intr")
}
 
 
 
 
# Number program running: address 56
#% gdatag,pv,rw,,SEG
# % autosave 2 VAL
record(ao, "${BL}:EU2408:SEG") {
field(DESC, "Current segment number")
field(DTYP, "asynInt32")
field(OUT, "@asyn(Eurotherm_EMODBUS_1_0_Wr_SEG,0,1000)MODBUS_DATA")
}
 
 
 
# % gdatag,pv,ro,,SEG:RBV
record(ai, "${BL}:EU2408:SEG:RBV") {
field(DESC, "Current segment number")
field(DTYP, "asynInt32")
field(INP, "@asyn(Eurotherm_EMODBUS_1_0_Rd_SEG,0,1000)MODBUS_DATA")
field(SCAN, "I/O Intr")
}
 
 
 
 
 
# Program Status number address 29
record(mbbo, "${BL}:EU2408:STYP") {
field(DESC, "Current segment type")
field(DTYP,"asynInt32")
field(OUT,"@asyn(Eurotherm_EMODBUS_1_0_Wr_STYP,0,1000)MODBUS_DATA")
field(ZRST, "End")
field(ZRVL, "0")
field(ONST, "Ramp (Rate)")
field(ONVL, "1")
field(TWST, "Ramp (Time to target")
field(TWVL, "2")
field(THST, "Dwell")
field(THVL, "3")
field(FRST, "Step")
field(FRVL, "4")
field(FVST, "Step")
field(FVVL, "5")
field(SXST, "Call")
field(SXVL, "6")
}
 
 
 
# % archiver 10 Monitor
record(mbbi, "${BL}:EU2408:STYP:RBV") {
field(DESC, "Current segment type")
field(DTYP,"asynInt32")
field(INP,"@asyn(Eurotherm_EMODBUS_1_0_Rd_STYP,0,1000)MODBUS_DATA")
field(SCAN, "I/O Intr")
field(ZRST, "End")
field(ZRVL, "0")
field(ONST, "Ramp (Rate)")
field(ONVL, "1")
field(TWST, "Ramp (Time to target")
field(TWVL, "2")
field(THST, "Dwell")
field(THVL, "3")
field(FRST, "Step")
field(FRVL, "4")
field(FVST, "Step")
field(FVVL, "5")
field(SXST, "Call")
field(SXVL, "6")
}
# Program Status number address 23
record(mbbo, "${BL}:EU2408:STAT") {
field(DESC, "Program Status")
field(DTYP,"asynInt32")
field(OUT,"@asyn(Eurotherm_EMODBUS_1_0_Wr_STAT,0,1000)MODBUS_DATA")
field(ZRST, "Reset")
field(ZRVL, "1")
field(ONST, "Run")
field(ONVL, "2")
field(TWST, "Hold")
field(TWVL, "4")
field(THST, "Holdback")
field(THVL, "8")
field(FRST, "Complete")
field(FRVL, "16")
}
 
 
 
# % archiver 10 Monitor
record(mbbi, "${BL}:EU2408:STAT:RBV") {
field(DESC, "Program Status Readback")
field(DTYP,"asynInt32")
field(INP,"@asyn(Eurotherm_EMODBUS_1_0_Rd_STAT,0,1000)MODBUS_DATA")
field(SCAN, "I/O Intr")
field(ZRST, "Reset")
field(ZRVL, "1")
field(ONST, "Run")
field(ONVL, "2")
field(TWST, "Hold")
field(TWVL, "4")
field(THST, "Holdback")
field(THVL, "8")
field(FRST, "Complete")
field(FRVL, "16")
}
 
# Address 160
#% gdatag,pv,rw,,TGT
record(ao, "${BL}:EU2408:TGT") {
field(DESC, "Target setpoint current segment")
field(DTYP, "asynInt32")
field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_TGT,0,1000)MODBUS_DATA")
field(EGU, "°C")
field(DRVH, "1000")
field(DRVL, "-273")
field(ASLO, "0.1")
}
 
 
 
# % gdatag,pv,ro,,TGTRBV
record(ai, "${BL}:EU2408:TGT:RBV") {
field(DESC, "Target setpoint current segment Readback")
field(DTYP, "asynInt32")
field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_TGT,0,1000)MODBUS_DATA")
field(EGU, "°C")
field(SCAN, "I/O Intr")
field(ASLO, "0.1")
}
 
 
 
 
# Address 36
#% gdatag,pv,rw, SEGT
record(ao, "${BL}:EU2408:SEGT") {
field(DESC, "Segment time remaining")
field(DTYP, "asynInt32")
field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_SEGT,0,1000)MODBUS_DATA")
# field(EGU, "min ?")
field(ASLO, "0.1")
}
 
 
 
# % gdatag,pv,ro,TGTRBV
record(ai, "${BL}:EU2408:SEGT:RBV") {
field(DESC, "Segment time remaining Readback")
field(DTYP, "asynInt32")
field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_SEGT,0,1000)MODBUS_DATA")
# field(EGU, "min ?")
field(SCAN, "I/O Intr")
field(ASLO, "0.1")
}
 
 
 
 
# Rate: address 161
#% gdatag,pv,rw,,RATE
# % autosave 2 VAL
record(ao, "${BL}:EU2408:RATE") {
field(DESC, "Ramp rate ")
field(DTYP, "asynInt32")
field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_RATE,0,1000)MODBUS_DATA")
field(EGU, "°C/min")
field(DRVH, "5")
field(DRVL, "0")
}
 
 
 
# % gdatag,pv,ro,,RATERBV
# % archiver 10 Monitor
record(ai, "${BL}:EU2408:RATE:RBV") {
field(DESC, "Ramp rate Readback")
field(DTYP, "asynInt32")
field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_RATE,0,1000)MODBUS_DATA")
field(EGU, "°C/s")
field(SCAN, "I/O Intr")
}
 
 
 
 
# Address 58
# % gdatag,pv,ro,PROTMRBV
record(ai, "${BL}:EU2408:PROTM:RBV") {
field(DESC, "Program time remaining Readback")
field(DTYP, "asynInt32")
field(INP, "@asyn(Eurotherm_EMODBUS_1_1_Rd_PROTM,0,1000)MODBUS_DATA")
# field(EGU, "min ?")
field(SCAN, "I/O Intr")
field(ASLO, "0.1")
}

OBS2: full IOC initialization log:

#!/usr/local/epics-nfs/apps/Eurotherm2408/1.0/bin/linux-x86_64/Eurotherm

< /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408/envPaths

epicsEnvSet("IOC","iocEurotherm2408")

epicsEnvSet("TOP","/usr/local/epics-nfs/apps/Eurotherm2408/1.0")

epicsEnvSet("NFS","/usr/local/epics-nfs")

epicsEnvSet("SUPPORT","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support")

epicsEnvSet("ASYN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/asyn-R4-33")

epicsEnvSet("STREAM","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/stream-R2-7-7c")

epicsEnvSet("MODBUS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/modbus-R2-11")

epicsEnvSet("EPICS_BASE","/usr/local/epics-nfs/base/R3.15.6")

epicsEnvSet("ALIVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/alive-R1-1-0")

epicsEnvSet("AUTOSAVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/autosave-R5-9")

epicsEnvSet("BUSY","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/busy-R1-7")

epicsEnvSet("CALC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/calc-R3-7-1")

epicsEnvSet("CAMAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/camac-R2-7-1")

epicsEnvSet("CAPUTRECORDER","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/caputRecorder-R1-7-1")

epicsEnvSet("DAC128V","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dac128V-R2-9")

epicsEnvSet("DELAYGEN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/delaygen-R1-2-0")

epicsEnvSet("DXP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dxp-R5-0")

epicsEnvSet("DXPSITORO","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dxpSITORO-R1-1")

epicsEnvSet("DEVIOCSTATS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/iocStats-3-1-15")

epicsEnvSet("IP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ip-R2-19-1")

epicsEnvSet("IPAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ipac-2-15")

epicsEnvSet("IP330","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ip330-R2-9")

epicsEnvSet("IPUNIDIG","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ipUnidig-R2-11")

epicsEnvSet("LOVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/love-R3-2-6")

epicsEnvSet("LUA","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/lua-R1-2-2")

epicsEnvSet("MCA","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/mca-R7-7")

epicsEnvSet("MEASCOMP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/measComp-R2-1")

epicsEnvSet("MODBUS_2_10_1","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/modbus-R2-10-1")

epicsEnvSet("MOTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/motor-R6-10-1")

epicsEnvSet("OPTICS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/optics-R2-13-1")

epicsEnvSet("QUADEM","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/quadEM-R9-1")

epicsEnvSet("SOFTGLUE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/softGlue-R2-8-1")

epicsEnvSet("SOFTGLUEZYNQ","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/softGlueZynq-R2-0-1")

epicsEnvSet("SSCAN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/sscan-R2-11-1")

epicsEnvSet("STD","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/std-R3-5")

epicsEnvSet("VAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/vac-R1-7")

epicsEnvSet("VME","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/vme-R2-9")

epicsEnvSet("YOKOGAWA_DAS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/Yokogawa_DAS-R1-0-0")

epicsEnvSet("XXX","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/xxx-R6-0")

epicsEnvSet("AREA_DETECTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1")

epicsEnvSet("ADCORE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADCore")

epicsEnvSet("ADSUPPORT","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADSupport")

epicsEnvSet("ADSIMDETECTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADSimDetector")

epicsEnvSet("SNCSEQ","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/seq-2-2-5")

epicsEnvSet("ALLEN_BRADLEY","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/allenBradley-2-3")

epicsEnvSet("BL","PNR")

# Configuração da linha de luz

< /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408/Eurotherm.config

epicsEnvSet("SERIAL_PORT","COM10")

epicsEnvSet("E_SHM","eurotherm")

epicsEnvSet("BAUD","9600")

epicsEnvSet("MBUS_SL_ADDR",1)

epicsEnvSet("MBUS_READ",3)

epicsEnvSet("MBUS_WRITE",6)

epicsEnvSet("MBUS_POLL",1000)

epicsEnvSet("STREAM_PROTOCOL_PATH","/usr/local/epics-nfs/apps/Eurotherm2408/1.0/db")

cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0

## Register all support components

dbLoadDatabase "dbd/Eurotherm.dbd"

Eurotherm_registerRecordDeviceDriver pdbbase

## Parameters to ModBus on /dev/ttyUSB0

## used to USB

#drvAsynSerialPortConfigure("EMODBUS","10.20.41.43:4001",0,0,0)

drvAsynIPPortConfigure("EMODBUS","10.20.41.43:4002",0,0,1)

###############################################################################

###############################################################################

# Set up ASYN HYPPIE ports

# pxiCreateSM(asyn, shared memory name)

# drvasynPXIConfig(port, COM port, shared memory name, serial type)

#asynSetOption("EMODBUS", 0, "${BAUD}", "9600")                  

#asynSetOption("EMODBUS", 0, "bits", "8")                      

#asynSetOption("EMODBUS", 0, "parity", "none")                

#asynSetOption("EMODBUS", 0, "stop", "1")                      

## Configure

modbusInterposeConfig("EMODBUS",1,3000,0)

# drvModbusAsynConfigure(portName,      => create a name

#                       tcpPortName,    => defined before

#                       slaveAddress,   => defined on equipament

#                       modbusFunction, => 3 : Read Holding Register (16-bit)

#                       modbusStartAddress, => adress of register

#                       modbusLength,  => the length of data segment

#                       dataType,  => default data type

#                       pollMsec,

#                       plcType);     => Equipament name, not used

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_ATUNE", "EMODBUS", 1,3, 3072, 6, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_ATUNE", "EMODBUS", 1,6, 3072, 6,0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PV", "EMODBUS", 1,3, 1, 3,0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PV", "EMODBUS", 1, 6, 1, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_WSP", "EMODBUS", 1,3, 5, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_RR", "EMODBUS", 1, 3, 35, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_RR", "EMODBUS", 1, 6, 35, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_MAN", "EMODBUS", 1, 3, 273, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_MAN", "EMODBUS", 1, 6, 273, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PID", "EMODBUS", 1, 3, 351, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PID", "EMODBUS", 1, 6, 351, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_P", "EMODBUS", 1, 3, 6, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_I", "EMODBUS", 1, 3, 8, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_D", "EMODBUS", 1, 3, 9, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", 1, 6, 6, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_I", "EMODBUS", 1, 6, 8, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_D", "EMODBUS", 1, 6, 9, 3, 0, 1000, "");

#####ADDED FOR DEBUG. DELETE LATER###

asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 4

asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 9

asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_I -1 4

asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_I -1 9

#####################################

#############################################################################################################################

#Commands added 19/04/2022 by Marco Montevechi, Junior Cintra and Jo  o Pedro Burle Ishida

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_PROG", "EMODBUS", 1, 3, 22, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_PROG", "EMODBUS", 1, 6, 22, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PSP", "EMODBUS", 1, 3, 163, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PSP", "EMODBUS", 1, 6, 163, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_CYC", "EMODBUS", 1, 3, 59, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_CYC", "EMODBUS", 1, 6, 59, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_SEG", "EMODBUS", 1, 3, 56, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_SEG", "EMODBUS", 1, 6, 56, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_STYP", "EMODBUS", 1, 3, 29, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_STYP", "EMODBUS", 1, 6, 29, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_STAT", "EMODBUS", 1, 3, 23, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_STAT", "EMODBUS", 1, 6, 23, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_TGT", "EMODBUS", 1, 3, 160, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_TGT", "EMODBUS", 1, 6, 160, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_SEGT", "EMODBUS", 1, 3, 36, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_SEGT", "EMODBUS", 1, 6, 36, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_RATE", "EMODBUS", 1, 3, 161, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_RATE", "EMODBUS", 1, 6, 161, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PROTM", "EMODBUS", 1, 3, 58, 1, 0, 1000, "");

#############################################################################################################################

## Load record instances

dbLoadRecords("db/dbEurotherm2408.db", "BL=PNR")

## Load record instances

#dbLoadRecords("db/xxx.db","user=gabrielfedelHost")

cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408

iocInit

Starting iocInit

############################################################################

## EPICS R3.15.6

## EPICS Base built Sep 27 2021

############################################################################

2022/04/25 11:51:29.912 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_P function=0x6, offset=00, value=0x5dc

2022/04/25 11:51:29.912 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_I function=0x6, offset=00, value=0x1c

2022/04/25 11:51:30.415 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3a98

iocRun: All initialization complete

## Start any sequence programs

#seq sncxxx,"user=gabrielfedelHost"

2022/04/25 11:51:30.547 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

2022/04/25 11:51:30.547 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

epics> 2022/04/25 11:51:54.767 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x640

2022/04/25 11:51:54.803 drvModbusAsyn::writeInt32 port Eurotherm_EMODBUS_1_1_Wr_P function=0x6, modbusAddress=06, buffer[0]=0x640, bufferLen=1

2022/04/25 11:53:46.926 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3e80

2022/04/25 11:53:46.978 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

2022/04/25 11:53:46.978 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

2022/04/25 11:53:50.348 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x640

2022/04/25 11:53:50.385 drvModbusAsyn::writeInt32 port Eurotherm_EMODBUS_1_1_Wr_P function=0x6, modbusAddress=06, buffer[0]=0x640, bufferLen=1


From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: 20 April 2022 12:50
To: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>
Cc: Junior Cintra Mauricio <junior.mauricio at lnls.br>; João Pedro Burle Ishida <joao.ishida at lnls.br>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: RE: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed

 

Hi Marco,

 

Your explanation of how this works is clear, the implied decimal point means that the ASLO of 0.1 or 0.01 is indeed required.

 

So caputting into :P variable makes the epics terminal print:

 

epics> 2022/04/20 08:40:18.579 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3e80

2022/04/20 08:40:18.641 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

2022/04/20 08:40:18.641 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

 

That is a very useful diagnostic message.  It appears to me that the Modbus driver completed a valid WRITE_SINGLE_REGISTER operation to address 6.  The data it wrote was 0x3e80 = 16000 decimal.  If the implied decimal point is 2 digits that would be 160.00.   For some reason the Eurotherm is returning Modbus exception 3 when that value is written.  Is that an invalid setting for the P parameter?  If it is returning exception 3 because 160.00 is an invalid setting then they are violating the Modbus spec, because the spec says exception 3 should NOT be used to signal an invalid setting, it is only used to indicate an invalid Modbus message.  Are there values you can write to P that do not generate the exception?

 

Mark

 

 

From: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>
Sent: Wednesday, April 20, 2022 9:33 AM
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: Junior Cintra Mauricio <junior.mauricio at lnls.br>; João Pedro Burle Ishida <joao.ishida at lnls.br>; tech-talk at aps.anl.gov
Subject: Re: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed

 

Hi, Mark! I corrected the asynSetTraceIOMask and asynSetTraceMask errors you pointed, thanks. About the error in the

dbLoadRecords("db/dbEurotherm2408.db", "BL=PNR"), it was a typo in one of the records, its also corrected.

 

I found the communication manual of the equipment to compare the accepted integer values and according to it:

"The protocol is also limited to integer communication only. Series 2000 instruments allow the user to configure

either integer or full resolution. In integer mode all parameters will be rounded to the nearest integer value,

whereas in full resolution mode the decimal point position will be implied so that 100.01 would be transmitted

as 10001."

And indeed caputting <PVPREFFIX>:P to a value such as 15001 makes caget <PVPREFFIX>:P:RBV return 150.01. So i figure making

the <PVPREFFIX>:P.ASLO field a non-integer is simply a logic error(?) that i intend to remove.

 

At the end of this email i append the IOC initialization log with typos corrected and TraceMasks added just to be coherent.

I also added

 

asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_I -1 4

 

and

 

asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_I -1 9

 

because i know this function worked well with the <PVPREFIX>:I variable.

 

Finally, about the PV being processed in initialization even without PINI field, i believe (although i am not sure) that it

is caused by the other records that reference the PV:

 

record(dfanout, "${BL}:EU2408:SETASLO") {

        field(OMSL, "closed_loop")

        field(DOL, "${BL}:EU2408:CALCASLO PP")

        field(OUTA, "${BL}:EU2408:SP.ASLO")

        field(OUTB, "${BL}:EU2408:SP:RBV.ASLO")

        field(OUTC, "${BL}:EU2408:RR.ASLO")

        field(OUTD, "${BL}:EU2408:RR:RBV.ASLO")

        field(OUTE, "${BL}:EU2408:PV:RBV.ASLO")

        field(OUTF, "${BL}:EU2408:P.ASLO")

        field(OUTG, "${BL}:EU2408:P:RBV.ASLO")

        field(FLNK, "${BL}:EU2408:SETPREC")

}

 

record(dfanout, "${BL}:EU2408:SETPREC") {

        field(OMSL, "closed_loop")

        field(DOL, "${BL}:EU2408:PREC.RVAL")

        field(OUTA, "${BL}:EU2408:SP.PREC PP")

        field(OUTB, "${BL}:EU2408:SP:RBV.PREC PP")

        field(OUTC, "${BL}:EU2408:RR.PREC PP")

        field(OUTD, "${BL}:EU2408:RR:RBV.PREC PP")

        field(OUTE, "${BL}:EU2408:PV:RBV.PREC PP")

        field(OUTF, "${BL}:EU2408:P.PREC PP")

        field(OUTG, "${BL}:EU2408:P:RBV.PREC PP")

}

 

record(calcout, "${BL}:EU2408:CALCASLO") {

        field(INPA, "${BL}:EU2408:PREC.RVAL NPP")

        field(CALC, "A==1?0.1:0.01")

}

 

record(mbbo, "${BL}:EU2408:PREC") {

        field(ZRST, "1 Decimal Place")

        field(ONST, "2 Decimal Places")

        field(ZRVL, "1")

        field(ONVL, "2")

        field(FLNK, "${BL}:EU2408:SETASLO")

        field(RVAL, "4")

        field(PINI, "YES")

}

 

So i think ${BL}:EU2408:PREC triggers all the process. Thanks so much for your attention! If this logic error

is indeed what is causing trouble, then i think the problem is solved.

 

Best regards,

 

Marco

 

OBS - IOC initialization log:

 

#!/usr/local/epics-nfs/apps/Eurotherm2408/1.0/bin/linux-x86_64/Eurotherm

< /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408/envPaths

epicsEnvSet("IOC","iocEurotherm2408")

epicsEnvSet("TOP","/usr/local/epics-nfs/apps/Eurotherm2408/1.0")

epicsEnvSet("NFS","/usr/local/epics-nfs")

epicsEnvSet("SUPPORT","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support")

epicsEnvSet("ASYN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/asyn-R4-33")

epicsEnvSet("STREAM","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/stream-R2-7-7c")

epicsEnvSet("MODBUS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/modbus-R2-11")

epicsEnvSet("EPICS_BASE","/usr/local/epics-nfs/base/R3.15.6")

epicsEnvSet("ALIVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/alive-R1-1-0")

epicsEnvSet("AUTOSAVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/autosave-R5-9")

epicsEnvSet("BUSY","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/busy-R1-7")

epicsEnvSet("CALC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/calc-R3-7-1")

epicsEnvSet("CAMAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/camac-R2-7-1")

epicsEnvSet("CAPUTRECORDER","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/caputRecorder-R1-7-1")

epicsEnvSet("DAC128V","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dac128V-R2-9")

epicsEnvSet("DELAYGEN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/delaygen-R1-2-0")

epicsEnvSet("DXP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dxp-R5-0")

epicsEnvSet("DXPSITORO","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dxpSITORO-R1-1")

epicsEnvSet("DEVIOCSTATS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/iocStats-3-1-15")

epicsEnvSet("IP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ip-R2-19-1")

epicsEnvSet("IPAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ipac-2-15")

epicsEnvSet("IP330","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ip330-R2-9")

epicsEnvSet("IPUNIDIG","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ipUnidig-R2-11")

epicsEnvSet("LOVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/love-R3-2-6")

epicsEnvSet("LUA","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/lua-R1-2-2")

epicsEnvSet("MCA","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/mca-R7-7")

epicsEnvSet("MEASCOMP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/measComp-R2-1")

epicsEnvSet("MODBUS_2_10_1","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/modbus-R2-10-1")

epicsEnvSet("MOTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/motor-R6-10-1")

epicsEnvSet("OPTICS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/optics-R2-13-1")

epicsEnvSet("QUADEM","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/quadEM-R9-1")

epicsEnvSet("SOFTGLUE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/softGlue-R2-8-1")

epicsEnvSet("SOFTGLUEZYNQ","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/softGlueZynq-R2-0-1")

epicsEnvSet("SSCAN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/sscan-R2-11-1")

epicsEnvSet("STD","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/std-R3-5")

epicsEnvSet("VAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/vac-R1-7")

epicsEnvSet("VME","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/vme-R2-9")

epicsEnvSet("YOKOGAWA_DAS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/Yokogawa_DAS-R1-0-0")

epicsEnvSet("XXX","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/xxx-R6-0")

epicsEnvSet("AREA_DETECTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1")

epicsEnvSet("ADCORE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADCore")

epicsEnvSet("ADSUPPORT","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADSupport")

epicsEnvSet("ADSIMDETECTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADSimDetector")

epicsEnvSet("SNCSEQ","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/seq-2-2-5")

epicsEnvSet("ALLEN_BRADLEY","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/allenBradley-2-3")

epicsEnvSet("BL","PNR")

# Configuração da linha de luz

< /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408/Eurotherm.config

epicsEnvSet("SERIAL_PORT","COM10")

epicsEnvSet("E_SHM","eurotherm")

epicsEnvSet("BAUD","9600")

epicsEnvSet("MBUS_SL_ADDR",1)

epicsEnvSet("MBUS_READ",3)

epicsEnvSet("MBUS_WRITE",6)

epicsEnvSet("MBUS_POLL",1000)

epicsEnvSet("STREAM_PROTOCOL_PATH","/usr/local/epics-nfs/apps/Eurotherm2408/1.0/db")

cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0

## Register all support components

dbLoadDatabase "dbd/Eurotherm.dbd"

Eurotherm_registerRecordDeviceDriver pdbbase

## Parameters to ModBus on /dev/ttyUSB0

## used to USB

#drvAsynSerialPortConfigure("EMODBUS","10.20.41.43:4001",0,0,0)

drvAsynIPPortConfigure("EMODBUS","10.20.41.43:4002",0,0,1)

###############################################################################

###############################################################################

# Set up ASYN HYPPIE ports

# pxiCreateSM(asyn, shared memory name)

# drvasynPXIConfig(port, COM port, shared memory name, serial type)

#asynSetOption("EMODBUS", 0, "${BAUD}", "9600")                  

#asynSetOption("EMODBUS", 0, "bits", "8")                      

#asynSetOption("EMODBUS", 0, "parity", "none")                

#asynSetOption("EMODBUS", 0, "stop", "1")                      

## Configure

modbusInterposeConfig("EMODBUS",1,3000,0)

# drvModbusAsynConfigure(portName,      => create a name

#                       tcpPortName,    => defined before

#                       slaveAddress,   => defined on equipament

#                       modbusFunction, => 3 : Read Holding Register (16-bit)

#                       modbusStartAddress, => adress of register

#                       modbusLength,  => the length of data segment

#                       dataType,  => default data type

#                       pollMsec,

#                       plcType);     => Equipament name, not used

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_ATUNE", "EMODBUS", 1,3, 3072, 6, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_ATUNE", "EMODBUS", 1,6, 3072, 6,0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PV", "EMODBUS", 1,3, 1, 3,0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PV", "EMODBUS", 1, 6, 1, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_WSP", "EMODBUS", 1,3, 5, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_RR", "EMODBUS", 1, 3, 35, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_RR", "EMODBUS", 1, 6, 35, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_MAN", "EMODBUS", 1, 3, 273, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_MAN", "EMODBUS", 1, 6, 273, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PID", "EMODBUS", 1, 3, 351, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PID", "EMODBUS", 1, 6, 351, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_P", "EMODBUS", 1, 3, 6, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_I", "EMODBUS", 1, 3, 8, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_D", "EMODBUS", 1, 3, 9, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", 1, 6, 6, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_I", "EMODBUS", 1, 6, 8, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_D", "EMODBUS", 1, 6, 9, 3, 0, 1000, "");

#####ADDED FOR DEBUG. DELETE LATER###

asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 4

asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 9

asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_I -1 4

asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_I -1 9

#####################################

#############################################################################################################################

#Commands added 19/04/2022 by Marco Montevechi, Junior Cintra and Jo  o Pedro Burle Ishida

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_PROG", "EMODBUS", 1, 3, 22, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_PROG", "EMODBUS", 1, 6, 22, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PSP", "EMODBUS", 1, 3, 163, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PSP", "EMODBUS", 1, 6, 163, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_CYC", "EMODBUS", 1, 3, 59, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_CYC", "EMODBUS", 1, 6, 59, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_SEG", "EMODBUS", 1, 3, 56, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_SEG", "EMODBUS", 1, 6, 56, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_STYP", "EMODBUS", 1, 3, 29, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_STYP", "EMODBUS", 1, 6, 29, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_STAT", "EMODBUS", 1, 3, 23, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_STAT", "EMODBUS", 1, 6, 23, 1, 0, 1000, "");

#############################################################################################################################

## Load record instances

dbLoadRecords("db/dbEurotherm2408.db", "BL=PNR")

## Load record instances

#dbLoadRecords("db/xxx.db","user=gabrielfedelHost")

cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408

iocInit

Starting iocInit

############################################################################

## EPICS R3.15.6

## EPICS Base built Sep 27 2021

############################################################################

2022/04/20 08:37:33.100 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_P function=0x6, offset=00, value=0x5dc

2022/04/20 08:37:33.100 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_I function=0x6, offset=00, value=0x1c

2022/04/20 08:37:33.602 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3a98

iocRun: All initialization complete

## Start any sequence programs

#seq sncxxx,"user=gabrielfedelHost"

2022/04/20 08:37:33.688 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

2022/04/20 08:37:33.688 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

epics>

 

So caputting into :P variable makes the epics terminal print:

 

epics> 2022/04/20 08:40:18.579 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3e80

2022/04/20 08:40:18.641 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

2022/04/20 08:40:18.641 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

2022/04/20 08:40:47.496 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3a98

2022/04/20 08:40:47.559 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

2022/04/20 08:40:47.559 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

 

and caputting into :I variable makes the epics terminal print:

 

2022/04/20 08:41:15.370 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_I WRITE_SINGLE_REGISTER address=010 value=0x1d

2022/04/20 08:41:15.406 drvModbusAsyn::writeInt32 port Eurotherm_EMODBUS_1_1_Wr_I function=0x6, modbusAddress=010, buffer[0]=0x1d, bufferLen=1

2022/04/20 08:41:20.447 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_I WRITE_SINGLE_REGISTER address=010 value=0x1c

2022/04/20 08:41:20.491 drvModbusAsyn::writeInt32 port Eurotherm_EMODBUS_1_1_Wr_I function=0x6, modbusAddress=010, buffer[0]=0x1c, bufferLen=1


From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: 19 April 2022 16:26
To: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>
Cc: Junior Cintra Mauricio <junior.mauricio at lnls.br>; João Pedro Burle Ishida <joao.ishida at lnls.br>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: RE: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed

 

Hi Marco,

 

Ø  Thats what seems weird to me: since the error only happens when we change the precision and ASLO, and since the exception indicates an incorrect command, can i just assume that the equipment is made to only accept commands that write the P parameter with a certain precision? In a way that when the precision is changed the equipment refuses to accept the command?

 

No, it cannot be the precision.  You are not sending ASCII characters with decimal digits over Modbus, you are sending 16-bit binary integers.  So the PREC field should not matter.  However the ASLO field controls the conversion from engineering units to 16-bit integer so it can change the data you are sending.

 

You are getting these errors when you boot:

asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 HEX

PNR-Eurotherm2408-B-Eurotherm01.cmd line 73: Illegal integer 'HEX'

asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 ERROR|DRIVER

PNR-Eurotherm2408-B-Eurotherm01.cmd line 75: Illegal integer 'ERROR|DRIVER'

 

That is because you are running asyn R4-33 and the enhancement to allow symbolic names in the asynSetTrace commands was added in R4-35 in 2019.  With this old version of asyn you need to change these commands to:

 

asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 4

asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 9

 

There is also an error when loading your database:

 

dbLoadRecords("db/dbEurotherm2408.db", "BL=PNR")

Error: syntax error

 at or before "Readback" in file "db/dbEurotherm2408.db" line 423

 

You should fix that.  It could even be the source of your problems, since I don’t know what records are defined after line 423.

 

It appears that the ao record is processing at iocInit, but the record does not have PINI=YES.  I don’t understand that.

 

Mark

 

 

 

From: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>
Sent: Tuesday, April 19, 2022 2:00 PM
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: Junior Cintra Mauricio <junior.mauricio at lnls.br>; João Pedro Burle Ishida <joao.ishida at lnls.br>; tech-talk at aps.anl.gov
Subject: Re: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed

 

Hello, Mark. Thank for the constant help!

Thats what seems weird to me: since the error only happens when we change the precision and ASLO, and since the exception indicates an incorrect command, can i just assume that the equipment is made to only accept commands that write the P parameter with a certain precision? In a way that when the precision is changed the equipment refuses to accept the command?

Im sorry for forgetting the complete message. The error message is:

## Start any sequence programs

#seq sncxxx,"user=gabrielfedelHost"

2022/04/19 15:27:21.537 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

2022/04/19 15:27:21.537 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

epics>

I append the complete IOC initialization log in the end of this email. Also, i noticed something else that seems important: in the .db file, there is the following comment right next to the :P variable:
# Proportional gain term: address 351

# Note this must be set to operate engineering units (not %) for the precision to be correct

# otherwise it is a fixed precision of 1 decimal place


However, address 351 is not even mentioned in Eurotherm modbus communication manual and setting

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", 1, 6, 351, 3, 0, 1000, "");

instead of

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", 1, 6, 6, 3, 0, 1000, "");

results in

2022/04/19 15:54:43.225 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=2

2022/04/19 15:54:43.226 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

epics>

Which i think means that this address is not supposed to be accessed.

Best regards,

Marco

#!/usr/local/epics-nfs/apps/Eurotherm2408/1.0/bin/linux-x86_64/Eurotherm

< /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408/envPaths

epicsEnvSet("IOC","iocEurotherm2408")

epicsEnvSet("TOP","/usr/local/epics-nfs/apps/Eurotherm2408/1.0")

epicsEnvSet("NFS","/usr/local/epics-nfs")

epicsEnvSet("SUPPORT","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support")

epicsEnvSet("ASYN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/asyn-R4-33")

epicsEnvSet("STREAM","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/stream-R2-7-7c")

epicsEnvSet("MODBUS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/modbus-R2-11")

epicsEnvSet("EPICS_BASE","/usr/local/epics-nfs/base/R3.15.6")

epicsEnvSet("ALIVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/alive-R1-1-0")

epicsEnvSet("AUTOSAVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/autosave-R5-9")

epicsEnvSet("BUSY","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/busy-R1-7")

epicsEnvSet("CALC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/calc-R3-7-1")

epicsEnvSet("CAMAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/camac-R2-7-1")

epicsEnvSet("CAPUTRECORDER","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/caputRecorder-R1-7-1")

epicsEnvSet("DAC128V","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dac128V-R2-9")

epicsEnvSet("DELAYGEN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/delaygen-R1-2-0")

epicsEnvSet("DXP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dxp-R5-0")

epicsEnvSet("DXPSITORO","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dxpSITORO-R1-1")

epicsEnvSet("DEVIOCSTATS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/iocStats-3-1-15")

epicsEnvSet("IP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ip-R2-19-1")

epicsEnvSet("IPAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ipac-2-15")

epicsEnvSet("IP330","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ip330-R2-9")

epicsEnvSet("IPUNIDIG","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ipUnidig-R2-11")

epicsEnvSet("LOVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/love-R3-2-6")

epicsEnvSet("LUA","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/lua-R1-2-2")

epicsEnvSet("MCA","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/mca-R7-7")

epicsEnvSet("MEASCOMP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/measComp-R2-1")

epicsEnvSet("MODBUS_2_10_1","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/modbus-R2-10-1")

epicsEnvSet("MOTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/motor-R6-10-1")

epicsEnvSet("OPTICS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/optics-R2-13-1")

epicsEnvSet("QUADEM","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/quadEM-R9-1")

epicsEnvSet("SOFTGLUE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/softGlue-R2-8-1")

epicsEnvSet("SOFTGLUEZYNQ","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/softGlueZynq-R2-0-1")

epicsEnvSet("SSCAN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/sscan-R2-11-1")

epicsEnvSet("STD","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/std-R3-5")

epicsEnvSet("VAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/vac-R1-7")

epicsEnvSet("VME","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/vme-R2-9")

epicsEnvSet("YOKOGAWA_DAS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/Yokogawa_DAS-R1-0-0")

epicsEnvSet("XXX","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/xxx-R6-0")

epicsEnvSet("AREA_DETECTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1")

epicsEnvSet("ADCORE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADCore")

epicsEnvSet("ADSUPPORT","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADSupport")

epicsEnvSet("ADSIMDETECTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADSimDetector")

epicsEnvSet("SNCSEQ","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/seq-2-2-5")

epicsEnvSet("ALLEN_BRADLEY","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/allenBradley-2-3")

epicsEnvSet("BL","PNR")

# Configuração da linha de luz

< /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408/Eurotherm.config

epicsEnvSet("SERIAL_PORT","COM10")

epicsEnvSet("E_SHM","eurotherm")

epicsEnvSet("BAUD","9600")

epicsEnvSet("MBUS_SL_ADDR",1)

epicsEnvSet("MBUS_READ",3)

epicsEnvSet("MBUS_WRITE",6)

epicsEnvSet("MBUS_POLL",1000)

epicsEnvSet("STREAM_PROTOCOL_PATH","/usr/local/epics-nfs/apps/Eurotherm2408/1.0/db")

cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0

## Register all support components

dbLoadDatabase "dbd/Eurotherm.dbd"

Eurotherm_registerRecordDeviceDriver pdbbase

## Parameters to ModBus on /dev/ttyUSB0

## used to USB

#drvAsynSerialPortConfigure("EMODBUS","10.20.41.43:4001",0,0,0)

drvAsynIPPortConfigure("EMODBUS","10.20.41.43:4002",0,0,1)

###############################################################################

###############################################################################

# Set up ASYN HYPPIE ports

# pxiCreateSM(asyn, shared memory name)

# drvasynPXIConfig(port, COM port, shared memory name, serial type)

#asynSetOption("EMODBUS", 0, "${BAUD}", "9600")                  

#asynSetOption("EMODBUS", 0, "bits", "8")                      

#asynSetOption("EMODBUS", 0, "parity", "none")                

#asynSetOption("EMODBUS", 0, "stop", "1")                      

## Configure

modbusInterposeConfig("EMODBUS",1,3000,0)

# drvModbusAsynConfigure(portName,      => create a name

#                       tcpPortName,    => defined before

#                       slaveAddress,   => defined on equipament

#                       modbusFunction, => 3 : Read Holding Register (16-bit)

#                       modbusStartAddress, => adress of register

#                       modbusLength,  => the length of data segment

#                       dataType,  => default data type

#                       pollMsec,

#                       plcType);     => Equipament name, not used

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_ATUNE", "EMODBUS", 1,3, 3072, 6,0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_ATUNE", "EMODBUS", 1,6, 3072, 6,0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PV", "EMODBUS", 1,3, 1, 3,0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PV", "EMODBUS", 1, 6, 1, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_WSP", "EMODBUS", 1,3, 5, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_RR", "EMODBUS", 1, 3, 35, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_RR", "EMODBUS", 1, 6, 35, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_MAN", "EMODBUS", 1, 3, 273, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_MAN", "EMODBUS", 1, 6, 273, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PID", "EMODBUS", 1, 3, 351, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PID", "EMODBUS", 1, 6, 351, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_P", "EMODBUS", 1, 3, 6, 3, 0, 1000, "");

#####ADDED FOR DEBUG. ###

asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 HEX

PNR-Eurotherm2408-B-Eurotherm01.cmd line 73: Illegal integer 'HEX'

asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 ERROR|DRIVER

PNR-Eurotherm2408-B-Eurotherm01.cmd line 75: Illegal integer 'ERROR|DRIVER'

#####################################

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_I", "EMODBUS", 1, 3, 8, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_D", "EMODBUS", 1, 3, 9, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", 1, 6, 6, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_I", "EMODBUS", 1, 6, 8, 3, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_D", "EMODBUS", 1, 6, 9, 3, 0, 1000, "");

#############################################################################################################################

#Commands added 19/04/2022 by Marco Montevechi, Junior Cintra and Jo  o Pedro Burle Ishida

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_PROG", "EMODBUS", 1, 3, 22, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_PROG", "EMODBUS", 1, 6, 22, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PSP", "EMODBUS", 1, 3, 163, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PSP", "EMODBUS", 1, 6, 163, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_CYC", "EMODBUS", 1, 3, 59, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_CYC", "EMODBUS", 1, 6, 59, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_SEG", "EMODBUS", 1, 3, 56, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_SEG", "EMODBUS", 1, 6, 56, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_STYP", "EMODBUS", 1, 3, 29, 1, 0, 1000, "");

drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_STYP", "EMODBUS", 1, 6, 29, 1, 0, 1000, "");

#############################################################################################################################

## Load record instances

dbLoadRecords("db/dbEurotherm2408.db", "BL=PNR")

Error: syntax error

 at or before "Readback" in file "db/dbEurotherm2408.db" line 423

## Load record instances

#dbLoadRecords("db/xxx.db","user=gabrielfedelHost")

cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408

iocInit

Starting iocInit

############################################################################

## EPICS R3.15.6

## EPICS Base built Sep 27 2021

############################################################################

iocRun: All initialization complete

## Start any sequence programs

#seq sncxxx,"user=gabrielfedelHost"

2022/04/19 15:47:39.215 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3

2022/04/19 15:47:39.215 PNR:EU2408:P devAsynInt32::processCallbackOutput process error

epics>


From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: 19 April 2022 15:12
To: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>
Cc: Junior Cintra Mauricio <junior.mauricio at lnls.br>; João Pedro Burle Ishida <joao.ishida at lnls.br>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: RE: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed

 

Hi Marco,

 

This is an ao record and one of the links is P.ASLO.  This means that depending on whether the link is broken the actual integer value being written to the device could change, since ASLO affects that.

 

According to page 48 of the Modbus reference document

https://epics-modbus.readthedocs.io/en/latest/_downloads/c210fb586108fe21da5a09d202ab86d1/Modbus_Application_Protocol_V1_1b.pdf

 

Modbus exception 3 is “ILLEGAL DATA VALUE”.  This means:

A value contained in the query data field is not an allowable value for server (or slave). This indicates a fault in the structure of the remainder of a complex request, such as that the implied length is incorrect. It specifically does NOT mean that a data item submitted for storage in a register has a value outside the expectation of the application program, since the MODBUS protocol is unaware of the significance of any particular value of any particular register.

 

So according to the specification exception 3 should only be returned when the command syntax is wrong, not if the data value is outside the allowed range.  However, it is always possible that Eurotherm has not following the spec, and it is returning exception 3 for a data value outside the allowed range.

 

Please send the complete error message when you get the exception.

 

It may also be helpful to put the following 2 commands in your startup script:

asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 HEX

asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 ERROR|DRIVER

 

That will show the Modbus messages sent to and received from the device.

 

Mark

 

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Marco A. Barra Montevechi Filho via Tech-talk
Sent: Tuesday, April 19, 2022 11:01 AM
To: tech-talk at aps.anl.gov
Cc: Junior Cintra Mauricio <junior.mauricio at lnls.br>; João Pedro Burle Ishida <joao.ishida at lnls.br>
Subject: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed

 

Hello all and good evening.

We are working with a modbus IOC, the one i asked about compiling errors here previously and Mark answered about removing modbus.dbd and leaving only modbusSupport.dbd to make it work.
The IOC has several modbus functions defined in its st.cmd file like:
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", ${MBUS_SL_ADDR}, ${MBUS_WRITE}, 6, 3, 0, ${MBUS_POLL}, "");

where MBUS_SL_ADDR=1, MBUS_WRITE=6 and MODBUS_POLL=1000.
EMODBUS was defined in drvAsynIPPortConfigure("EMODBUS",{EUROTHERM_IP},0,0,1)

The above modbus function is used by a PV:

record(ao, "${BL}:EU2408:P:SOMETHING") {

  field(DESC, "P Param")

  field(DTYP, "asynInt32")

  field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_P,0,1000)MODBUS_DATA")

}

 and it works fine if the PV name doesnt end stop in ":P". If the PV name is only "${BL}:EU2408:P", then we get modbus exception 3 when initializing the IOC and the PV doesnt work.
I suppose this happens because some other PV has a link to it and the link breaks when the name is changed. I dont know if there could be any cause to this behaviour.

The only PVs we found refering to "${BL}:EU2408:P:SOMETHING" PV are:

record(dfanout, "${BL}:EU2408:SETASLO") {

        field(OMSL, "closed_loop")

        field(DOL, "${BL}:EU2408:CALCASLO PP")

        field(OUTA, "${BL}:EU2408:SP.ASLO")

        field(OUTB, "${BL}:EU2408:SP:RBV.ASLO")

        field(OUTC, "${BL}:EU2408:RR.ASLO")

        field(OUTD, "${BL}:EU2408:RR:RBV.ASLO")

        field(OUTE, "${BL}:EU2408:PV:RBV.ASLO")

        field(OUTF, "${BL}:EU2408:P.ASLO")   #HERE

        field(OUTG, "${BL}:EU2408:P:RBV.ASLO")

        field(FLNK, "${BL}:EU2408:SETPREC")

}
and
record(dfanout, "${BL}:EU2408:SETPREC") {

        field(OMSL, "closed_loop")

        field(DOL, "${BL}:EU2408:PREC.RVAL")

        field(OUTA, "${BL}:EU2408:SP.PREC PP")

        field(OUTB, "${BL}:EU2408:SP:RBV.PREC PP")

        field(OUTC, "${BL}:EU2408:RR.PREC PP")

        field(OUTD, "${BL}:EU2408:RR:RBV.PREC PP")

        field(OUTE, "${BL}:EU2408:PV:RBV.PREC PP")

        field(OUTF, "${BL}:EU2408:P.PREC PP")    ######HERE

        field(OUTG, "${BL}:EU2408:P:RBV.PREC PP")

}
so i suppose altering PVs PREC and ASLO alters the correct modbus function needed to access the parameter, but this makes no sense to me since the parameter stored in the equipment should still be the same.
Does someone know what am i missing?

Thanks in advance
🙂

Marco

 

Aviso Legal: Esta mensagem e seus anexos podem conter informações confidenciais e/ou de uso restrito. Observe atentamente seu conteúdo e considere eventual consulta ao remetente antes de copiá-la, divulgá-la ou distribuí-la. Se você recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente.

Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately.


Replies:
Re: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed Marco A. Barra Montevechi Filho via Tech-talk
References:
drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed Marco A. Barra Montevechi Filho via Tech-talk
RE: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed Mark Rivers via Tech-talk
Re: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed Marco A. Barra Montevechi Filho via Tech-talk
RE: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed Mark Rivers via Tech-talk
Re: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed Marco A. Barra Montevechi Filho via Tech-talk
RE: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed Mark Rivers via Tech-talk
Re: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed Marco A. Barra Montevechi Filho via Tech-talk

Navigate by Date:
Prev: RE: Eiger Stream API problems Mark Rivers via Tech-talk
Next: Olog Features Larregui, Julian via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
Navigate by Thread:
Prev: Re: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed Marco A. Barra Montevechi Filho via Tech-talk
Next: Re: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed Marco A. Barra Montevechi Filho via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·