Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017 
<== Date ==> <== Thread ==>

Subject: Re: state notation code flags
From: Patrick Thomas <thomas_p@ligo-wa.caltech.edu>
To: Mark Rivers <rivers@cars.uchicago.edu>
Cc: tech-talk@aps.anl.gov
Date: Fri, 02 Oct 2009 15:20:06 -0700
It does seem to be related to that other variable, and occurs even if it is set to some constant instead. But I can't figure how it can be setting anything to do with the first variable. I'm going to write a piece of shorter test code...

Mark Rivers wrote:
I don't think the fact that variable 1 was set to variable2 is relevant.

But if you do a pvPut on variable1 that could cause variable2 to change
in your IOC, depending on the database logic, etc.  When the event flag
is set on variable2 is the value changing?

Here is a way to help figure it out:  run the following EPICS command
from the shell:

camonitor variable2

That will print a message every time a monitor is sent for variable2.
It should print a message each time you get an event on variable2 in
your SNL program.

Mark


-----Original Message-----
From: Patrick Thomas [mailto:thomas_p@ligo-wa.caltech.edu] Sent: Friday, October 02, 2009 4:47 PM
To: Mark Rivers
Cc: tech-talk@aps.anl.gov
Subject: Re: state notation code flags

I think I have it narrowed down. It appears that when I set variable1 equal to variable2 and variable2 has a flag synced to it (variable1 does

not), and then do a pvPut on variable1, sometimes the flag is set on variable2 and sometimes it isn't. Am I correct? Why does this occur?

Thank you,
Patrick

Mark Rivers wrote:
Patrick,

Event flags can be explicitly set, which is typically used to allow
communication between state sets.  Or event flags can be synced to a
PV,
and will be set whenever a monitor is received for that PV, as in the
example I sent you.

You can use the efTest() function outside of a when statement, just
like
any other function.

Mark


-----Original Message-----
From: Patrick Thomas [mailto:thomas_p@ligo-wa.caltech.edu] Sent: Thursday, October 01, 2009 5:20 PM
To: Mark Rivers
Cc: tech-talk@aps.anl.gov
Subject: Re: state notation code flags

Hi Mark,

Are the flags on a monitored variable set whenever the monitored variable is used in the code, including a pvPut, pvGet, assignment, calculation, or print statement? Is there a way to test if the flag is

set besides an efTest in a when statement?

Thank you,
Patrick

Mark Rivers wrote:
Hio Patrick,

Here are some code snippets from one of my SNL programs.  It has a
variable nelements assigned to a PV, and a monitor on that PV.  It has
an event flag, nelementsMon that is synced to nelements.  Whenever
nelements changes the event flag will be set.  In the init state I
clear
the event flag, just to be sure it is clear when the SNL code starts
running (after all PVs connect).  I then use efTestAndClear in a when
statement to take actions when that event flag is set, and to clear
it.
This works fine for me.
int     nelements;   assign nelements    to "{P}{R}Nelements.VAL";
monitor nelements;
evflag nelementsMon;    sync nelements  nelementsMon;


    /* Initialize things when first starting */
    state init {
        when() {
            /* Clear all event flags */
...

            efClear(nelementsMon);
        } state monitor_inputs
    }


...

    state monitor_inputs {

...

        when(efTestAndClear(nelementsMon) && (nelements>=1)) {
            /* If nelements changes, then change endPulses to this
value,
             * since this is what the user normally wants.  endPulses
can be
             * changed again after changing nelements if this is
desired. */
            if (moveMode == MOVE_MODE_RELATIVE)
                endPulses = nelements;
            else
                endPulses = nelements-1;
            pvPut(endPulses);
        } state monitor_inputs
    }

Mark

________________________________

From: tech-talk-bounces@aps.anl.gov on behalf of Patrick Thomas
Sent: Wed 9/30/2009 10:35 PM
To: tech-talk@aps.anl.gov
Subject: state notation code flags



Hi,

I was wondering if there is a way to track at what point in the state
notation code evflags are getting set and cleared, or if someone
could
clarify under what conditions they get set. I'm having trouble with
them
getting set somewhere and not being cleared, but I'm not sure where.

Thank you,
Patrick





References:
state notation code flags Patrick Thomas
RE: state notation code flags Mark Rivers
Re: state notation code flags Patrick Thomas
RE: state notation code flags Mark Rivers
Re: state notation code flags Patrick Thomas
RE: state notation code flags Mark Rivers

Navigate by Date:
Prev: Re: EPICS Python client application survey Matt Newville
Next: Re: state notation code flags Patrick Thomas
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017 
Navigate by Thread:
Prev: RE: state notation code flags Mark Rivers
Next: Re: state notation code flags Pete R. Jemian
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·