g+
g+ Communities
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  <20102011  2012  2013  2014  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014 
<== Date ==> <== Thread ==>

Subject: Re: how to use scalcout record in streamdevice?
From: Dirk Zimoch <dirk.zimoch@psi.ch>
To: marco_hair <marco_hair@163.com>
Cc: tech-talk <tech-talk@aps.anl.gov>
Date: Mon, 04 Jan 2010 11:39:33 +0100
Hi,

You don't need a scalcout to convert strings to numbers. That's exactly what StreamDevice is doing. Just use a protocol like:
{ in "%i"; } and StreamDevice converts "12345678" to 12345678.


record (longin, "$(NAME)")
{
field (DTYP, "stream")
field (INP, "@protocolfile read_number $(ASYN_PORT)")
}

protocolfile:
Terminator = CR LF; # or whatever your device sends at the end of a line
read_number {
out "give me the number";
in "%i";
}

Best regards,
Dirk


marco_hair wrote:
hi, Mark:

In fact, I tried to parse the string "12345678" with a ai/longin record of streamdevice, but I can't find how to do that. then I checked the streamdevice, seems that it can support scalcout record, not just in soft device mode? also there is an example with it, but too simple.
ps, today is Chrismas day, are you stil working? :-p


2009-12-25"Mark Rivers" <rivers@cars.uchicago.edu> д
>You could do that with an scalcout. But you would not use the streamDevice support, you would just use the soft device support, since you have already read the string with the stringin record (using streamDevice?).
> >But maybe you should back up a step. Are you trying to read a string from a device, and convert it into a number, for example for an ai or longin record? If so then you should just use the streamDevice support for the ai or longin record directly, there is no need to use stringin or scalcout. Just write a protocol file for the ai or longin and provide the format string needed to decode the string.
> >Mark
> >
>________________________________
>
>From: tech-talk-bounces@aps.anl.gov on behalf of Silver
>Sent: Thu 12/24/2009 10:04 AM
>To: tech-talk
>Subject: how to use scalcout record in streamdevice?
>
>
>
>hi,
>
> I want to try scalcout record in streamdevice, but I still can't use it after reading some example or document of streamdevice.
>for example, if I use stringin record to get a string like "12345678", then I want to convert it from ascii code to digital 12345678, can it be implemented by scalcout record?
> can anyone give me a hint? thanks a lot in advance.
>
>
>Best regards
>Geyang 2009-12-25
>
>
>
>





Navigate by Date:
Prev: Happy (21st) Birthday RTEMS! Lawrence T. Hoff
Next: Libera EPICS driver release Michael Abbott
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014 
Navigate by Thread:
Prev: Happy (21st) Birthday RTEMS! Lawrence T. Hoff
Next: Libera EPICS driver release Michael Abbott
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·