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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Stream device - general concept how to use |
From: | "Arnold, Ned D. via Tech-talk" <tech-talk at aps.anl.gov> |
To: | Christian Pauly <pauly at physik.uni-wuppertal.de>, "Rivers, Mark L." <rivers at cars.uchicago.edu> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Thu, 16 Jul 2020 13:12:19 +0000 |
Christian -
I think you could do both of Mark's suggestion at the same time yielding periodically scanned status records that also get scanned immediately when an associated "set" record is written to.
Ned
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
Sent: Thursday, July 16, 2020 07:27 AM To: Christian Pauly <pauly at physik.uni-wuppertal.de> Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> Subject: Re: Stream device - general concept how to use Hi Christian,
> So: What is the general concept how to control such a device ? (This must be a "standard case"). > Use SCAN for each status variable ? I don't think there is a standard case. But here are a couple of popular options. 1) Have a status record #1 that is periodically scanned, e.g. SCAN="1 second". That record has its FLNK field set to status record #2, which in turn has a FLNK to status record #3, etc. You can then expose the SCAN field of status record #1 in the OPI so the use can control the readback rate of all of the status records. 2) For each output record have its FLNK field point to the readback record for that parameter. Then every time it writes a new value it reads it back into a different PV. There are no periodically scanned records. Mark ________________________________ From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Christian Pauly via Tech-talk <tech-talk at aps.anl.gov> Sent: Thursday, July 16, 2020 3:02 AM To: tech-talk at aps.anl.gov Subject: Stream device - general concept how to use Dear experts I am struggling right now with programming a control interface for a device using the streamdevice module. The device has several status variables (like eg "temperature"), and several control variables (like eg "pump speed"). My approach is, to have for each control variable two records: record getPumpSpeed (type analog input, ai) record setPumpSpeed (type analog output, ao) These are connected to two different protocol functions to set - or to read back the value. "caput setPumpSpeed xxx" works fine : The protocol gets executed, the pump speed is set. but "caget getPumpSpeed" does not execute the protocol, instead it just returns the record value. I could do a "caput getPumpSpeed xxx" first (with some arbitrary number xxx, to execute the record), then the protocol is executed, and a subsequent "caget getPumpSpeed" gives me the latest value... But that is not really what i want. (Naively) i am looking for a "realtime" readback everytime i do a caget. But from the documentation i see, that this is the intended behaviour. I could set the SCAN field of the caget record to have regular polls of the pump speed. But if i now imagine to have hundred such variables, i would get quite some traffic, and the return values are still not really "real time". So: What is the general concept how to control such a device ? (This must be a "standard case"). Use SCAN for each status variable ? Or combine the set- and get-record to a single record "PumpSpeed" ? And just assume, that the latest set value (which is then returned upon caget) is still the actual real value ? Or am i lacking some understanding of streamdevice ? Any help and advice greatly appreciated ! Thanks, Christian |