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 protocol files question? |
From: | Emmanuel Mayssat <[email protected]> |
To: | "Goff, Steven J" <[email protected]>, EPICS mailing list <[email protected]> |
Date: | Wed, 17 Sep 2014 12:53:02 -0700 |
The info you provide is confusing.
If your record is a longin, its value is an integer (not a string, not an error message, ...). In your protocol, the out line is what the computer writes on the bus to fetch the status of the device. Base on what I understand, you probably should use a binary out (bo record) for each of your batteries. You can pass the battery number in the OUT line as a parameter to the protocol record(bo, $(prefix):$(number):BatteryOn") { field(DTYP, ... field(out, "mydev.proto getStatus($prefix,$number)) dev) } record(stringin, $(prefix):$(number)Message") { } with protocol getStatus { out "Battery On \$2"; in "OK"; @mismatch { out "Battery On \$2"; in "%(\$1:\$2Message.VAL)s"; # Write on another PV } } The mismatch should not be required if you know all the allowed values for $number. If that's the case, you just dbLoadRecords with the allowed $number parameters I hope this helps. -- Emmanuel Mayssat http://www.epicsqt.org From: [email protected] To: [email protected] Subject: Stream device protocol files question? Date: Wed, 17 Sep 2014 16:22:11 +0000 Hello,
I am trying to understand how to setup a particular command in a protocol file.
The command looks like this:
Battery On “number”
And the command returns either: “OK” or ”Error: err msg”.
I think my protocol file might look like this:
Battery { Out “Battery On %d”; }
And my db file would look like this:
Record (longin, “batteryOn”) { Field(DTYP, “stream”) Field(INP, “myDev.proto Battery dev”) }
How do I get the status that the command returns?
I want to do something like
Battery { Out “Battery On %d”; In “%s”; }
But I am already using an input for the battery number. So how do I do both?
Thanks In advance.
Steve Goff
|