EPICS Controls 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  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: SEQ with dynamic assignment of PV in array variable
From: Benjamin Franksen <[email protected]>
To: <[email protected]>
Date: Tue, 4 Jun 2013 12:15:22 +0200
Hi Emmanuel

I'm a bit late to the party but here goes:

On Monday, June 03, 2013 10:28:52 Emmanuel Mayssat wrote:
> I am working on a seq program.For that program, I am interacting with magnet
> power supplies.The interfaces to the power supplies are all the same (about
> 10 PV each). For each interface PV, I would like do to something like
> this...
> #define NB_OF_SUPPLIES  50short enable[NB_OF_SUPPLIES];assign enable[0] to
> "I:S001:PS:EnableBO";assign enable[1] to "I:SO10:PS:EnableBO";...monitor
> enable; but programmatically.
> I looked at the docs and they are somewhat confusing.

If in doubt, always refer to the SNL Reference ;-)

> Q: Is there a place to put the pvAssign statement?

pvAssign is not a statement, but a (built-in) function. See

http://www-csr.bessy.de/control/SoftDist/sequencer/Reference.html#pvassign

This means you can call it anywhere in action code. Typical places are: in a
global entry block, in an entry block of some initial state of some state set,
in a state transition from some initial state.

> Q: Should the array's cell
> be initialized/assigned to ""  during declaration?

Yes, this is necessary because all (potentially) assign'ed variables must be
known statically. There are shorthands for this:

array int x[20];
double v;

assign v; /* same as assign v to "" */
assign x to {}; /* assign all elements to "" */

> Q: Can I monitor a
> not-yet configured PV array?

If you mean: before pvAssign was called (on some or all of the elements),
then: yes.

> Q: How can I find out about the connection to
> each of the PVs?

There are built-in functions pvConnected and pvAssigned, see

http://www-csr.bessy.de/control/SoftDist/sequencer/Reference.html#pvconnected

and

http://www-csr.bessy.de/control/SoftDist/sequencer/Reference.html#pvassigned

> etc. If anyone has an example of using pvAssign on array
> variables (i.e. enable),  I would appreciate it.

If someone has a nice, self-contained example program to illustrate these
things, I will happily add it to the examples directory.

Cheers
--
Ben Franksen
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachm€nts

Attachment: signature.asc
Description: This is a digitally signed message part.


References:
SEQ with dynamic assignment of PV in array variable Emmanuel Mayssat

Navigate by Date:
Prev: RE: IP330 modules question Geon-Yeong Mun
Next: Re: SEQ with dynamic assignment of PV in array variable Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: SEQ with dynamic assignment of PV in array variable Mark Rivers
Next: Questionable code in aToIPAddr Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·