|
Hi Varuna,
I realize there is another problem with your scalcout record.
You are reading the stringin record contents into the A field with INPA. That is incorrect, the A field is for numeric values only. String values need to be read with INAA into the AA field.
Also you are using PP in the input link, but that is not needed because that stringin record just processed and did an FLNK to the scalcout record.
So your record should be:
record(scalcout, "$(acc):$(sys)_$(group):calc_nsChannel$(channel_id)Vrms")
{
field(INAA, "$(acc):$(sys)_$(group):nsChannel$(channel_id)Vrms")
field(CALC, "LEN(AA)==0 ? 0 : DBL(A)")
field(PREC, "2")
field(EGU, "V")
field(DESC, "Channel $(channel_id) Vrms")
}
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
Sent: Thursday, March 19, 2026 5:56 PM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>; Varuna Crishan Meddage <vmeddage at fnal.gov>
Subject: Re: scalcout EPICS Record Error
Hi Varuna,
You should look at the scalcout record documentation here:
Your calc _expression_ is this:
field(CALC, "IF(STRLEN(A)==0, 0, VAL(A))")
That syntax is incorrect.
I think the CALC field should be this, but I have not tested it.
field(CALC, "LEN(A)==0 ? 0 : DBL(A)")
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Varuna Crishan Meddage via Tech-talk <tech-talk at aps.anl.gov>
Sent: Thursday, March 19, 2026 5:28 PM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: scalcout EPICS Record Error
Hi,
I have following record instance defined in my .db file.
====================================================================
record(stringin, "$(acc):$(sys)_$(group):nsChannel$(channel_id)Vrms")
{
field(SCAN, "10 second")
field(DTYP, "Snmp")
field(INP, "@$(HOST) $(COMMUNITY) $(W)::nsChannel$(channel_id)Vrms.0 STRING: 100")
field(DESC, "Channel $(channel_id) Vrms")
field(FLNK, "$(acc):$(sys)_$(group):calc_nsChannel$(channel_id)Vrms")
}
=========================================================================
I want to convert the string value of above record to a numerical value using a scalcout EPICS record. For that purpose, I defined the following scalcout record which caused the runtime errors as pasted below. (Here I want to output 0 if string value is empty
and numerical value otherwise)
========================= SCALCOUT RECORD =============================
record(scalcout, "$(acc):$(sys)_$(group):calc_nsChannel$(channel_id)Vrms")
{
field(INPA, "$(acc):$(sys)_$(group):nsChannel$(channel_id)Vrms PP")
field(CALC, "IF(STRLEN(A)==0, 0, VAL(A))")
field(PREC, "2")
field(EGU, "V")
field(DESC, "Channel $(channel_id) Vrms")
}
=======================================================================
==================================== ERROR MESSAGE ===============================
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel1Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel2Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel3Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel4Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel5Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel6Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel7Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel8Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel9Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel10Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel11Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel12Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel13Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel14Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel15Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel16Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel17Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel18Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel19Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel20Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel21Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel22Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel23Vrms
recGblRecordError: scalcout:init_record Error (514,3) PV: PIP2:TIME_CTRL_GPS:calc_nsChannel24Vrms
PIP2:TIME_CTRL_GPS:calc_nsChannel1Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel2Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel3Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel4Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel5Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel6Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel7Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel8Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel9Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel10Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel11Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel12Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel13Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel14Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel15Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel16Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel17Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel18Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel19Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel20Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel21Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel22Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel23Vrms DSET write does not exist
PIP2:TIME_CTRL_GPS:calc_nsChannel24Vrms DSET write does not exist
==================================================================================
Any solutions solve this problem ?
Thanks
Varuna Meddage
|