2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 <2023> 2024 2025 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 <2023> 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Timestamp behaviour in pvmonitor vs camonitor |
From: | Andrew Johnson via Core-talk <core-talk at aps.anl.gov> |
To: | Timo Korhonen <Timo.Korhonen at ess.eu>, Michael Davidsaver <mdavidsaver at gmail.com> |
Cc: | EPICS Core Talk <core-talk at aps.anl.gov> |
Date: | Mon, 8 May 2023 09:26:59 -0500 |
Hi Timo, On 5/8/23 5:17 AM, Timo Korhonen via Core-talk wrote: The only reference to the VAL field in the sequence record C code is a call to db_post_events() that I believe will only happen at the end of record processing after doing the last put operation and setting the timestamp, and only when the record's alarm status/severity changes. That should happen on the first processing when the record comes out of UDF alarm.However, I can replicate the behavior with a minimal db like this: record(seq,"testSequence") { field(DOL0,"myInput") field(LNK0,"myOutput PP") field(DLY0,"1.0") } record(ai,"myInput"){ } record(ao,"myOutput"){ } on Base 7.0.7.1. timokorhonen@CIN-906975 Work % pvmonitor testSequence testSequence 2023-05-08 11:48:16.571 0 ^C timokorhonen@CIN-906975 Work % pvmonitor testSequence.VAL testSequence.VAL 2023-05-08 11:50:35.554 1 ^C timokorhonen@CIN-906975 Work % camonitor testSequence.VAL testSequence.VAL 2023-05-08 11:50:35.553895 1 No processing has happened in between. Apart from this oddity, I do not see any issues in how the sequence record works. This is just curious. I know that the VAL field in a sequence record does not do anything, just that a put to it causes the record to process. I can't explain how your VAL field went from 0 to 1 above, I think you must have done a put to it (to trigger processing?). There should be no difference between what camonitor and pvmonitor actually show since they both use the same monitor mechanism; if you think you are seeing a difference, please run both camonitor and pvmonitor simultaneously and repeat what you were doing to demonstrate. I have been wondering whether we should add functionality to the sequence record's VAL field as follows: When processing each link group in processCallback(), set the VAL field to the link group number that is being processed, then post a DBE_LOG monitor on VAL after the dbPutLink() operation. We already set the record's timestamp during the link group processing, thus the monitor will fire after the group has been done. Unfortunately pcb->index does not hold the value that I'd want to appear in VAL since pcb->grps[] only contains the groups that have a non-zero bit in the selection mask, so implementing this will need a new array of the group numbers adding to the seqRecPvt structure. It mustn't rely on the previous contents of the VAL field since it frequently gets over-written to trigger the sequence. This would probably be a decent Codeathon project for someone who wants to work on IOC internals. - Andrew On 2023-05-08, 07:03, "Michael Davidsaver" <mdavidsaver at gmail.com <mailto:mdavidsaver at gmail.com>> wrote: On 5/7/23 13:39, Timo Korhonen via Core-talk wrote:Hello, Can somebody remind me about timestamp handling with monitors? Namely, we see the following behaviour: caget -a <record> and pvget <record> and camonitor <record> give the same timestamp, but pvmonitor <record> gives a different one, rather far in the past. The record in question is a sequence record. VAL has no other meaning there except causing the record to process, right? VAL of the record in question is always null. Thus, there are no monitor updates (as far as I have seen). Interestingly enough, when I do pvmonitor <record>.VAL, I get the same timestamp as with the three other methods. I was asked why this happens but I could not figure out the reason. I vaguely remember some discussion on this but could not find any hints.I also can't think of a reason. Nor do I recall any discussion where "record" and "record.VAL" behave differently. Can you share details about the situation, including module versions? -- Complexity comes for free, Simplicity you have to work for. |