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  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  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  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: [SNL] possibility to cut the argument string.
From: "Laznovsky Michael \(PSI\) via Tech-talk" <[email protected]>
To: "'[email protected]'" <[email protected]>
Date: Fri, 26 Apr 2019 12:34:53 +0000

Hi- I can think of at least two ways of doing what you want; one a standard feature of SNL, and the

other a "weird trick".

 

#1: Use "pvAssign" in a loop, with generated PV names (as shown below):

https://www-csr.bessy.de/control/SoftDist/sequencer/search.html?q=pvassign

 

#2: Dynamic arg string: if the macro names and values are easily generated as suggested in

the original post, you could write a separate SNL wrapper program which builds the arg string

at runtime and then calls your program with it, for example (macro & variable declarations

omitted):

 

      program run_myExample ( ... meta-macros? ... )

      ss run_myExample

      {

        state doit {

          when (1) {

 

              %% extern struct seqProgram seqmyExample;    // ref to your SNL program

 

              %% static char args[ ARGBUF_SIZE ];    // arg buffer: should be large enough to hold

                                                     // full final string

              args[0] = '\0';

              for ( n = 1; n <= N; n++ ) {           // append macros for devices 1..N

 

                %% sprintf(

                %%      &args[ strlen(args) ],

                %%      "%smacro%d=MyExp:MyDevice-%02d:Unit",

                %%      (n > 0)? "," : "",

                %%      n,n );

              }

 

              %% seq( & seqmyExample, args, STACK_SIZE );  // start your main SNL program; seq is

                                                           // just another function, after all

            } state done

        }

 

        state done {

          when (delay(999999)) {} state done         // delay forever (or maybe exit?)

        }

      }

 

Then in the startup script just run "seq &run_myExample" instead of the original.  You could also add

macros to the wrapper to generate different PV names, as you suggest.

 

Example compiles but not tested, but I use basically this method to start a variable number of per-device

seq threads based on the runtime contents of in-memory EPICS DBs.

 

cheers

Mike

https://www.psi.ch

 

 

 

 

 

From: [email protected] <[email protected]> On Behalf Of GAGET Alexis via Tech-talk
Sent: Montag, 15. April 2019 17:22
Subject: [SNL] possibility to cut the argument string.

 

Dear All,

I have a SNL sequence with a lot of macro, i find the call in the iocshell really not readable

i.e :

seq myExample “macro1=MyExp:MyDevice-01:Unit, macro2=MyExp:MyDevice-02:Unit, macro3=MyExp:MyDevice-03:Unit, macro4=MyExp:MyDevice-04:Unit….To infinity and beyond”

 

Is there any way to maybe cut the string ?

i.e :

seq myExample “macro1=MyExp:MyDevice-01:Unit”+

“macro1=MyExp:MyDevice-02:Unit”+

“macro2=MyExp:MyDevice-03:Unit”+

“ macro3=MyExp:MyDevice-04:Unit”+

“….To infinity and beyond”

(of course it doesn’t work, I’ve tried different possibility but I haven’t found… maybe it’s obvious

 

I want my sequence as much generic as possible, so substitutions macros offers a good possibility to call differents PVs.

 

If it’s not possible yet, is it possible to maybe create an issue somewhere to ask the feature ?

 

Thanks for your help.

...

Alexis GAGET

CEA Saclay - DRF/Irfu/DIS/LDISC

[email protected]

 

 


Replies:
RE: [SNL] possibility to cut the argument string. Laznovsky Michael (PSI) via Tech-talk
References:
[SNL] possibility to cut the argument string. GAGET Alexis via Tech-talk

Navigate by Date:
Prev: Re: database or new record for blocking setpoint/readback process control Pearson, Matthew R. via Tech-talk
Next: RE: [SNL] possibility to cut the argument string. Laznovsky Michael (PSI) via Tech-talk
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  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: [SNL] possibility to cut the argument string. Johnson, Andrew N. via Tech-talk
Next: RE: [SNL] possibility to cut the argument string. Laznovsky Michael (PSI) via Tech-talk
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  2018  <20192020  2021  2022  2023  2024 
ANJ, 26 Apr 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·