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: Output records in StreamDevice
From: "Leblanc, Gregory via Tech-talk" <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 20 Mar 2023 14:44:18 +0000
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: Output records in StreamDevice Zimoch Dirk via Tech-talk

Navigate by Date:
Prev: RE: using macros in Action, Execute Command Zhang, Tong via Tech-talk
Next: Re: Output records in StreamDevice Zimoch Dirk 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: Phoebus: using macros in Action, Execute Command Paul Sichta via Tech-talk
Next: Re: Output records in StreamDevice Zimoch Dirk 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 ·