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: Populate a waveform from substitutions file
From: Mark Rivers via Tech-talk <[email protected]>
To: Dariush Hampai <[email protected]>, Dariush Hampai <[email protected]>
Date: Tue, 11 Nov 2025 23:30:32 +0000
Hi Dariush,

What you are trying to do is really simple if you use the EPICS sscan record.  It takes care of waiting for motors to get to the target position, waits for detectors to get done, etc.  It designed for exactly what you are doing, namely scans.  It works using ca_put_callback().  That generates a callback when the caput is really done.

If you want to use an SNL program then you should do your pvPut with the SYNC option.  That will use ca_put_callback(), and your SNL program will pause until that pvPut is really complete.

Mark


-----Original Message-----
From: Dariush Hampai <[email protected]> 
Sent: Tuesday, November 11, 2025 12:39 PM
To: Dariush Hampai <[email protected]>; Mark Rivers <[email protected]>
Subject: Populate a waveform from substitutions file

Hi community,
Hi Mark,

I'm trying to do a SNL state machine, however I need some help in order to conlude the work.
This SNL is really simple: a scan acquisition (from start to and end with step movement), i.e. a motor and a detector. Up to now, I did the while loop and the sequence of commands is right. However, as the motors and the detectors need a waiting time (to reach the position or to wait the end acquisition) I hade to include a nested while loop to wait the "hardware ready". Unfortunately, as all the devices have different way to say "I'm ready", I put a substitution file in order to have the list for all the terminators.
file db/scan.db {
        pattern {ioc, ready}
                {"mm4006_1", "@"}
                {"pi_1", "0"}
                {"pi_2", "1"}
                {"ortec_1", "1"}
                ...
}
Has I define which device I'm using ad a record in db record(stringout, $(user):motor_device) {
        field(DESC, "Num device motor")
}
so for example
caput xlabsrv2:motor_name mm4006_1
How can I prepare two waveforms (or and array with 2 columns) and populate them as one reads from the substitution file the IOCs, the second the terminatro character, record(waveform, $(user):ioc) {
        field(DESC, "IOC loaded")
        field(NELM, "200")
        field(FTVL, "STRING")
        field(PINI, "YES")
}
record(waveform, $(user):ready) {
        field(DESC, "Terminators loaded")
        field(NELM, "200")
        field(FTVL, "STRING")
        field(PINI, "YES")
}

find the index that correspond to the IOC selected, and extract the corresponding charater?
Have you any idea?
Thank you in advance

Dariush


PhD Dr. Dariush Hampai

INFN - LNF
X-Lab Frascati
Via E. Fermi, 54 (ex 40)
I-00044 Frascati (RM)
Italy

Room: +39.06.9403.5248
Lab.: +39.06.9403.2286
Mob.: +39.06.9403.8025
Fax.: +39.06.9403.2597

Replies:
Re: Populate a waveform from substitutions file Dariush Hampai via Tech-talk
References:
Populate a waveform from substitutions file Dariush Hampai via Tech-talk

Navigate by Date:
Prev: Re: Anyone using Zaber motion controllers? [SEC=UNOFFICIAL] CHEN, Simin via Tech-talk
Next: sigmakoki controller motor driver 백호령 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: Populate a waveform from substitutions file Dariush Hampai via Tech-talk
Next: Re: Populate a waveform from substitutions file Dariush Hampai 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 ·