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  <20112012  2013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: When a record is changed twice very fast, camonitor only detects first change
From: Matthieu Bec <mbec@gemini.edu>
To: Mikel Rojo <mikelrojo5@hotmail.com>
Cc: tech-talk@aps.anl.gov
Date: Mon, 23 May 2011 11:26:27 -0400
Hi Mikel,

you may reconsider why your snl would need to pvGet on a channel you set to be monitored. As far as receiving monitors, stringin/out have MPST/APST fields - those will let you post value/archive monitors either On Change or Always (former is the default). In your test case, check how the record behaves once you set:

caput RECORD.MPST Always

Cheers,
Matthieu


On 05/23/11 11:02, Mikel Rojo wrote:
Hi,

I searched tech-talk for something similar but haven't found anything. I
hope I am not submitting an old claim. I have a sequencer program that
basically monitors a stringin record for when a command arrives from
some HW. Here is the basics of the program:

program xxx

/*RECORD is a stringin record that receives a string command when the HW
sends it*/
string input; assign input to "RECORD"; monitor input;
evflag change; sync input change;

ss xxx {
state IDLE {
entry {
efClear(change);
}
when(efTestAndClear(change)) {
} state PROCESS
}

state PROCESS {
when(1) {
pvGet(input);
[...some processing is done...]
sprintf(input,"");
pvPut(input);
} state IDLE
}
}

However, the PROCESS state is only reached when the input string is
different from the previous one. Here is what happens:
1. First the program is idle waiting for an input: camonitor and caget
RECORD both return ""
2. "STRING" gets sent from the HW and dumps on the RECORD
3. the monitor detects the change and raises the change flag
4. camonitor changes to "STRING"
4. PROCESS state begins, "STRING" gets loaded on the input variable
5. at the end of processing input is set to ""
6. with pvPut, the string "" gets written onto RECORD, this is done so
that the record can reprocess in case the same string comes in again.
7. program waits in idle state
8. At this point, caget RECORD returns "", however camonitor RECORD is
still stuck on "STRING", this does not change after waiting
9. If a new string is written to RECORD from the HW, the camonitor
detects a change and starts the process, but if it is the same "STRING"
again, the monitor believes there has been no change and does not
trigger the process

I don't understand how camonitor can say that a pv has one value, while
with caget we can see that it has a different one. I tried stopping the
monitor before clearing the variable and then starting the monitor again
afterwards but it does not change anything. I am using the latest
version of base (3.14.12.1) and sequencer (2.0.13). I would really
appreciate any help. Thank you in advance.
Mikel Rojo


Replies:
RE: When a record is changed twice very fast, camonitor only detects first change Mikel Rojo
References:
When a record is changed twice very fast, camonitor only detects first change Mikel Rojo

Navigate by Date:
Prev: When a record is changed twice very fast, camonitor only detects first change Mikel Rojo
Next: RE: vxWorks network problems Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: When a record is changed twice very fast, camonitor only detects first change Mikel Rojo
Next: RE: When a record is changed twice very fast, camonitor only detects first change Mikel Rojo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·