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  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: streamDevice output format question
From: Mark Rivers <[email protected]>
To: "'Eric Norum'" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Tue, 25 Nov 2014 22:52:59 +0000

Hi Eric,

 

Thanks for the suggestion, that works well.  Here’s an example:

 

From the database:

 

## Note that we need to use these scalcout records for the following ao records because

## the pump requires a value field that is exactly 5 characters, and we want

## get as much precision as possible. So we convert the value to a string and

## then use the first 5 characters.  We get 1.000, 10.00, 100.0, etc.

 

record(ao,"$(P)$(R)InfusionRate") {

    field(PINI, "YES")

    field(EGU,  "ml/m")

    field(PREC, "3")

    field(FLNK, "$(P)$(R)InfusionRateCalc")

}

 

record(scalcout,"$(P)$(R)InfusionRateCalc") {

    field(DTYP, "stream")

    field(OUT,  "@CPSyringe.proto setNoneString $(PORT)")

    field(INPA, "$(P)$(R)InfusionRate.VAL NPP NMS")

    field(INBB, "$(P)$(R)InfusionRate.EGU NPP NMS")

    field(CALC, "'ratei '+$P('%5.5s ',STR(A))+BB")

}

 

From protocol file:

 

setNoneString {

   out "%s";

   in "\r\n%*[><:NE]";

}

 

 

Mark

 

 

From: Eric Norum [mailto:[email protected]]
Sent: Monday, November 24, 2014 5:29 PM
To: Mark Rivers
Cc: Dirk Zimoch; [email protected]
Subject: Re: streamDevice output format question

 

Hmm….one wonders at the sort of recreational drugs available to instrument software developers……

 

How about using an scalcout record to format the number using  %.6f and then a protocol entry with %5c  ?

 

On Nov 24, 2014, at 2:54 PM, Mark Rivers <[email protected]> wrote:

 

Dirk and all,

 

I have a device that requires a command of the following format:

 

ratei NNNNN ml/h

 

where NNNNN is a number that is exactly 5 characters long including the decimal point.  For example if the rate is 9 then:

 

ratei 9.000 ml/h

 

If the rate is 10 then the string must be

 

ratei 10.00 ml/h

 

If one sends 10.000 (six characters) the command is rejected.

 

Is there a way to achieve this with streamDevice?

 

I can’t use the field width flag, since that just sets a minimum field width. I need to set a maximum field width.

 

I realize this is a ridiculous behavior for a device, but I need to deal with it.

 

Thanks,

Mark

 

-- 
Eric Norum
[email protected]




 


References:
streamDevice output format question Mark Rivers
Re: streamDevice output format question Eric Norum

Navigate by Date:
Prev: Re: CSS/BOY: how to force a Scaled Slider to rescale when the PV rescales Peter Milne
Next: Re: streamDevice output format question Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: streamDevice output format question Maren Purves
Next: RE: streamDevice output format question peter.owens
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·