Experimental Physics and Industrial Control System
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" <[email protected]> дµÀ£º
>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: [email protected] 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
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- 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
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024