we would like to have to set AMSG for normal PVs and PVs with links.
below is the test database file I have used for testing. I have added a Calc PV that just increment from 0 to 5 with High alarm set to major when value = 5. However, the alarm message string is not set
record(calc, "$(P):$(R):COUNTER") {
field(VAL, "0")
field(INPA, "5")
field(CALC, "VAL = A? 0: VAL+1")
field(HIGH, "5")
field(HSV, "MAJOR")
field(AMSG, "COUNTER IN AN ALARM STATE")
field(SCAN, "1 second")
}
record(calcout, "$(P):$(R):CALC") {
field(INPA, "0x101")
field(CALC, "A")
field(SCAN, "1 second")
}
record (mbbiDirect, "$(P):$(R):SIMULATED") {
field("DESC", "mbbiDirect from calcout")
field(INP,{pva:{pv:"$(P):$(R):CALC", serv: "MS", proc:"CP"}})
}
record(bi, "$(P):$(R):SIMULATED:B0") {
field(INP, {pva:{pv:"$(P):$(R):SIMULATED.B0", proc:"CP"}})
field(ZNAM, "OFF")
field(ONAM, "ON")
field(OSV, "MAJOR")
field(AMSG, "I AM IN AN ALARM STATE")
}
Regards
Aqeel
ISIS Controls
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*From:* Michael Davidsaver <mdavidsaver at gmail.com>
*Sent:* 16 February 2025 00:27
*To:* Alshafei, Aqeel (STFC,RAL,ISIS) <Aqeel.Alshafei at stfc.ac.uk>
*Cc:* tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>; Finch, Ivan (STFC,RAL,ISIS) <ivan.finch at stfc.ac.uk>
*Subject:* Re: IOC, QServ, and AMSG / alarm.message
Hello Aqeel,
field(INP,{pva:{pv:"$(P):$(R):CALC", proc:"CP"}})
Try setting the "sevr" key to "MS".
field(INP,{pva:{pv:"$(P):$(R):CALC", sevr:"MS", proc:"CP"}})
I have also updated PR #100, however this is only a change to the test
code, which was not testing everything I thought it was.
On 2/14/25 07:53, Aqeel Alshafei - STFC UKRI wrote:
Hello Michael,
I have switched the test IOC to use pvxs. I've pulled the changes from https://urldefense.us/v3/__https://github.com/epics-base/pvxs/pull/100__;!!G_uCfscf7eWS!Z6EvnRv0uZpu2-5tpfa-eWbruUmdHDvYFuD2e3Hqz8btrWMPr7Mbd5da1kY-Kh2iqsPVIsllxL7xenGFhtxHi3Xfqg$ <https://urldefense.us/v3/__https://github.com/epics-base/pvxs/pull/100__;!!G_uCfscf7eWS!Z6EvnRv0uZpu2-5tpfa-eWbruUmdHDvYFuD2e3Hqz8btrWMPr7Mbd5da1kY-Kh2iqsPVIsllxL7xenGFhtxHi3Xfqg$> <https://urldefense.us/v3/__https://github.com/epics-base/pvxs/pull/100__;!!G_uCfscf7eWS!Z6EvnRv0uZpu2-5tpfa-eWbruUmdHDvYFuD2e3Hqz8btrWMPr7Mbd5da1kY-Kh2iqsPVIsllxL7xenGFhtxHi3Xfqg$ <https://urldefense.us/v3/__https://github.com/epics-base/pvxs/pull/100__;!!G_uCfscf7eWS!Z6EvnRv0uZpu2-5tpfa-eWbruUmdHDvYFuD2e3Hqz8btrWMPr7Mbd5da1kY-Kh2iqsPVIsllxL7xenGFhtxHi3Xfqg$>>
the alarm.message is not set based on AMSG field. alarm.message string value set to "STATE" then alarm is Minor or Major.
AMSG was set only when the record/PV is in the invalid state. I also tried NMSG field, it behave the same as AMSG, except when PV is invalid is set the alarm.message to "UDF"
so, alarm.message is set when alarm.severity = 3 AND alarm.status = 2. Otherwise, it does not use the AMSG field and set the string value "STATE"
the database below should be able to reproduce what I am encountering. a quick way to make the bi record invalid is to set proc to true instead of "CP" then the alarm.message would be set.
record(calcout, "$(P):$(R):CALC") {
field(INPA, "0x101")
field(CALC, "A")
field(SCAN, "1 second")
}
record (mbbiDirect, "$(P):$(R):SIMULATED") {
field("DESC", "mbbiDirect from calcout")
field(INP,{pva:{pv:"$(P):$(R):CALC", proc:"CP"}})
}
record(bi, "$(P):$(R):SIMULATED:B0") {
field(INP, {pva:{pv:"$(P):$(R):SIMULATED.B0", proc:"CP"}})
field(ZNAM, "OFF")
field(ONAM, "ON")
field(OSV, "MAJOR")
field(NAMSG, "I AM IN AN ALARM STATE")
}
Best Regards
Aqeel AlShafei
ISIS Controls
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*From:* Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
*Sent:* 13 February 2025 21:53
*To:* Finch, Ivan (STFC,RAL,ISIS) <ivan.finch at stfc.ac.uk>
*Cc:* tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
*Subject:* Re: IOC, QServ, and AMSG / alarm.message
Hi Ivan,
On 2/13/25 08:21, Ivan Finch - STFC UKRI via Tech-talk wrote:
> Hello,
>
> We have setup a simple IOC with bi records triggered by forward links such as the following:
What you are trying to do should work.
Can you test with: https://urldefense.us/v3/__https://github.com/epics-base/pvxs/pull/100__;!!G_uCfscf7eWS!Z6EvnRv0uZpu2-5tpfa-eWbruUmdHDvYFuD2e3Hqz8btrWMPr7Mbd5da1kY-Kh2iqsPVIsllxL7xenGFhtxHi3Xfqg$ <https://urldefense.us/v3/__https://github.com/epics-base/pvxs/pull/100__;!!G_uCfscf7eWS!Z6EvnRv0uZpu2-5tpfa-eWbruUmdHDvYFuD2e3Hqz8btrWMPr7Mbd5da1kY-Kh2iqsPVIsllxL7xenGFhtxHi3Xfqg$> <https://urldefense.us/v3/__https://github.com/epics-base/pvxs/pull/100__;!!G_uCfscf7eWS!Z6EvnRv0uZpu2-5tpfa-eWbruUmdHDvYFuD2e3Hqz8btrWMPr7Mbd5da1kY-Kh2iqsPVIsllxL7xenGFhtxHi3Xfqg$ <https://urldefense.us/v3/__https://github.com/epics-base/pvxs/pull/100__;!!G_uCfscf7eWS!Z6EvnRv0uZpu2-5tpfa-eWbruUmdHDvYFuD2e3Hqz8btrWMPr7Mbd5da1kY-Kh2iqsPVIsllxL7xenGFhtxHi3Xfqg$>> ?
...
> We’ve investigated setting the AMSG and NAMSG fields in the record, but suspect that this is intended to be set programmatically?
The idea is for device support to change to recGblSetSevrMsg()
in places where recGblSetSevr() is used to signal an alarm.
> int recGblSetSevrMsg(void *precord,
> epicsEnum16 new_stat,
> epicsEnum16 new_sevr,
> const char *msg, ...)
So printf() format strings can be used, although there is a
limit of 40 characters (aka. DB_AMSG_SIZE).
> Thank you in advance for any assistance you can provide,
>
> Ivan Finch
>
> ISIS Controls
>