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  2019  2020  2021  2022  2023  2024  <20252026  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  2019  2020  2021  2022  2023  2024  <20252026 
<== Date ==> <== Thread ==>

Subject: RE: Newbie question about SNL
From: Mark Rivers via Tech-talk <[email protected]>
To: Dariush Hampai <[email protected]>, "[email protected]" <[email protected]>
Date: Fri, 28 Nov 2025 18:14:17 +0000

Hi Dariush,

 

I don’t understand this block:

 

                when (test==3) {
                        command=4;
                        pvPut(command, SYNC);
                        pvPut(motor, 1, SYNC); 
                        test=6;
                        pvPut(command, SYNC);
                        pos=pvGet(motor, SYNC);
                        printf("IOC and Device %s\n", motor);
                        printf("Position =%f\n", pos);
                        test=0;
                        pvPut(test);
                } state idle

 

Why are you setting “test=6”, since you never use “test” before you set it to 0 later in the block.  Is that an error and you meant to set “command=6”?

 

In the code you included you never define the “state loop” state.  What is that?

 

I think you should consider using the EPICS sscan record for this task rather than an SNL program.


Mark

 

 

From: Dariush Hampai <[email protected]>
Sent: Friday, November 28, 2025 10:35 AM
To: [email protected]; Mark Rivers <[email protected]>
Subject: Newbie question about SNL

 

Hi community,
i'm trying to create a sequencer by SNL.
I would like to create a scan with a motor and for each step an acquisition.
Using the db of the scan IOC, I defined my IOC to control

 "{user}:motor" and "{user}:create_command_label" are in the scan IOC db, and I need them to generate the record that I want to control

[…]
string motor;
assign motor to "{user}:motor";
monitor motor;
double command;
assign command to "{user}:create_command_label";
monitor command;
[…]

ss scan_test {
        state init {
                when (test==0) {
                        printf("Ready for Loop\n");
                        } state idle
        }
        state idle {
                when (test==1) {
                        printf("Start Loop\n");
                        test=2;
                        pvPut(test);
                } state loop
                when (test==3) {
                        command=4;
                        pvPut(command, SYNC);
                        pvPut(motor, 1, SYNC); 
                        test=6;
                        pvPut(command, SYNC);
                        pos=pvGet(motor, SYNC);
                        printf("IOC and Device %s\n", motor);
                        printf("Position =%f\n", pos);
                        test=0;
                        pvPut(test);
                } state idle
       }
[...]
}

When I start the IOCs (by procServ), and I pass in the test=3 state I receive:
IOC and Device mm4006_1_1_2:pos
Position =0.000000

However
caget mm4006_1_1_2:pos
mm4006_1_1_2:pos               1000

Where do I wrong?

 

-- 
************************************
 
Dr. Dariush Hampai, PhD
 
INFN - LNF
X-Lab Frascati
Via E. Fermi, 54 (ex 40)
I-00044 Frascati (RM)
Italy
 
Mail Address:
XLab-Frascati
LNF-INFN
Casella Postale 13
Frascati (RM)
Italy
 
Room:   +39.06.9403.5248
Lab.:   +39.06.9403.2286
Mob.:   +39.06.9403.8025
Fax.:   +39.06.9403.2597
 
************************************

References:
Newbie question about SNL Dariush Hampai via Tech-talk

Navigate by Date:
Prev: Newbie question about SNL Dariush Hampai via Tech-talk
Next: Re: Streaming from quadEM to HDF5 Mark Rivers 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  2019  2020  2021  2022  2023  2024  <20252026 
Navigate by Thread:
Prev: Newbie question about SNL Dariush Hampai via Tech-talk
Next: mtca-evr-300rf,mrfioc2:failed to find/create object SDH 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  2019  2020  2021  2022  2023  2024  <20252026 
ANJ, 19 Mar 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·