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: | <[email protected]> |
To: | <[email protected]>, <[email protected]> |
Date: | Thu, 18 Sep 2014 14:48:37 +0000 |
To start with. Is that meant to be an output command or an input command? I was assuming output, but you are using a longin record with an INP field. IF it is output (ie you are attempting to write the value of the record as the number) Then what you need is an exception handler. The protocol would look something like: Battery { out “Battery On %d”; in “OK”; @mismatch { in “Error:%(BatteryError)s”; } } Where BatteryError is a stringin record. IF it is an input (ie you are requesting the status from a particular battery) then have one record for each battery and pass the number as a protocol variable: Record (stringin, “battery-3-On”) { Field(DTYP, “stream”) Field(INP, “myDev.proto Battery(3) dev”) } Battery { out “Battery On \$1”; in “%s”; } Pete From: Goff, Steven J [mailto:[email protected]]
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 --
|