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

Subject: Re: snl 2.2.4 question
From: Benjamin Franksen <benjamin.franksen@helmholtz-berlin.de>
To: Pierrick Hanlet <hanlet@fnal.gov>, Tech Talk <tech-talk@aps.anl.gov>
Date: Wed, 1 Feb 2017 16:31:05 +0100
On 31.01.2017 19:03, Pierrick Hanlet wrote:
> I have a number of records over which I'm looping to assign values to
> fields such as alarm limits.
> The records and fields are assigned and then I assign a pointer to a
> struct to each of these so
> as to be able to loop over them.
> 
> However, I  also have some records in this list which don't have these
> fields; e.g. binaries and
> so there is no connection the missing fields, but still to the PV. So,
> within the loop, before writing
> a seq_pvPut(), I'd like to check if there is a valid connection to the
> field.  I've tried
> seq_pvConnected(ss_id,ndx+i) and seq_pvAssigned(ss_id,ndx+1), where ndx is
> the PV and ndx+1 is assigned to the different fields of that PV.
> Any ideas?

The pvConnected built-in function should indeed do the trick. However,
if you use version 2.2 and write the function in SNL, not in C, there is
a much cleaner and less error prone solution: you can use an array of
unions, where each variant of the union reflects the fields available
for the record type behind it.

Cheers
Ben
-- 
"Make it so they have to reboot after every typo." ― Scott Adams

Attachment: signature.asc
Description: OpenPGP digital signature


References:
snl 2.2.4 question Pierrick Hanlet

Navigate by Date:
Prev: Problem of Running RTEMS/EPiCS Application on BSP altcycv_devkt Jianxium Yan
Next: Re: seq 2.2.4 problem? Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: snl 2.2.4 question Pierrick Hanlet
Next: pvaPy conda recipe? Lentz, Zachary L
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 14 Feb 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·