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  <20232024  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  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: Output records in StreamDevice
From: Zimoch Dirk via Tech-talk <tech-talk at aps.anl.gov>
To: "leblanc at ohio.edu" <leblanc at ohio.edu>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 20 Mar 2023 14:51:18 +0000
Hi Greg,

You use % formats just as for the inputs:

setSourceVoltage {
    out "source:voltage \$1,(@\$2) %E";
}

'out' works like printf() while 'in' works like scanf().

Dirk


On Mon, 2023-03-20 at 14:44 +0000, Leblanc, Gregory via Tech-talk wrote:
> Hi folks,
> 
> I'm struggling a bit to wrap my head around how to use output records in StreamDevice.  I'm missing the link between the value going into the PV and sending that value to my device.  
> 
> Background: I'm using EPICS base 7.0 checked out from GIT, running on CentOS 7. I've also installed asyn, calc, and streamdevice from git.   I'm communicating with an HP/Agilent/Keysight 34980A mainframe over ethernet.  I'm reading from the mainframe DMM without any issues.  Snippets of the protocol file and record file look like:
> 
> getResistance {
>     out "measure:resistance? \$1,\$2,(@\$3)";
>     in "%E";
> }
> 
> And
> 
> record(ai, "$(P)$(R)switcherMagnetVoltage") {
>     field(DESC, "Switcher Magnet Voltage")
>     field(DTYP, "stream")
>     # field(SCAN, "1 second")
>     field(SCAN, "Passive")
>     field(INP,  "@devKS_34980A_EPICS.proto getVoltageDC(100,0.0001,1001) $(PORT) $(A)")
>     field(EGU, "Volts")
>     field(PINI, "YES")
> }
> 
> Where I'm stuck is on writing values to the mainframe to control the DACs.  I've got a section of the protocol file that looks like:
> 
> setSourceVoltage {
>     out "source:voltage \$1,(@\$2)";
> }
> 
> Where the first parameter is the DC voltage (-16V to 16V), and the second parameter is the output channel to set.  I've written an AO record, which is where I think the problem is like this:
> 
> record(ao, "$(P)$(R)writeOutput1") {
>     field(DESC, "Write to Test Output 1")
>     field(DTYP, "stream")
>     field(PREC, "3")
>     field(EGU,  "Volts")
>     field(SCAN, "Passive")
>     field(OUT, "@devKS_34980A_EPICS.proto setSourceVoltage(3,2001) $(PORT) $(A)" )
>     field(PINI, "YES")
>     field(VAL, "0")
> }
> 
> From here, pvput to writeOutput1 will cause that output to get set back to 3V.  The presentation at:
> https://indico.fhi-berlin.mpg.de/event/52/contributions/578/attachments/182/578/StreramDeviceIntroduction2020.pdf
> has some AO records on page 24, but I still can't quite see how the value gets from the AO record into the string that streamdevice is sending out.
> 
> Any pointers on what I need to do are greatly appreciated,
>      Greg
> 
> P.S. More complete files are available at: https://github.com/leblancOUAL/KS_34980A_EPICS 
> 
> --
> Gregory Leblanc
> Accelerator Engineer
> Edwards Accelerator Lab - Ohio University
> 123 University Terrace
> Athens, OH 45701 USA
> leblanc at ohio.edu
> M: (401) 52-OUAL1 or (401) 526-8251
> 

Replies:
RE: [External] Re: Output records in StreamDevice Leblanc, Gregory via Tech-talk
References:
Output records in StreamDevice Leblanc, Gregory via Tech-talk

Navigate by Date:
Prev: Output records in StreamDevice Leblanc, Gregory via Tech-talk
Next: Re: [External] RE: using macros in Action, Execute Command Paul Sichta 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  <20232024 
Navigate by Thread:
Prev: Output records in StreamDevice Leblanc, Gregory via Tech-talk
Next: RE: [External] Re: Output records in StreamDevice Leblanc, Gregory 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  <20232024 
ANJ, 20 Mar 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·