Additionally, a simple follow up question that I
am not able to solve in a simple way. Is there a simple way to create
a
"if" statement without the "else" part. As in, I would like the OUT
record processed only then the "if" condition is met.
I'm not positive I understand the question. But if you can make your
calculation "if" return 0 or non-zero then the calcout record has an
OOPT field that can be either "Transition To Zero" or "Transition To
Non-zero" (among other choices). That will write the output only
under the specified condition. It also has a DOPT field that lets you
write a different value from the result of the calculation if you set
it to "Use OCAL" rather than "Use CAL".
Mark
________________________________
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Donny
Domagoj Cosic via Tech-talk <tech-talk at aps.anl.gov>
Sent: Wednesday, June 3, 2020 6:45 AM
To: tech-talk at aps.anl.gov
Subject: Update a record at a specific time
Hello,
For archiving purposes I am trying to record a value from a PV everyday
at a specific time. I accomplished similar things using a Soft
Timestamp
record when a specific date/time field updates. ie:
record(stringin, "TeslaMeters:$(position):TimeStamp"){
field(DTYP, "Soft Timestamp")
field(PINI, "YES")
field(INP, "@%d")
}
record(calcout, "TeslaMeters:$(position):Calc"){
field(INPA, "TeslaMeters:$(position):TimeStamp CP")
field(INPB, "TeslaMeters:$(position)")
field(CALC, "B")
field(OUT, "TeslaMeters:$(position):Midnight PP")
}
record(ai, "TeslaMeters:$(position):Midnight")
{
field(PREC, "3")
field(EGU, "Tesla")
field(PINI, "YES")
}
Could I use a similar strategy to compare a time string generated by
the
Soft Timestamp? I see that there is a scalcout record, but i was not
able to get it to work. Additionally, a simple follow up question that
I
am not able to solve in a simple way. Is there a simple way to create a
"if" statement without the "else" part. As in, I would like the OUT
record processed only then the "if" condition is met.
Thank you,
Donny
--
Donny Domagoj Cosic
Institut Ruder Boskovic, Bijenicka cesta 54, 10000 Zagreb, Croatia