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  <20132014  2015  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: How to Read Multiple Values using StreamDevice with array_in
From: Dirk Zimoch <[email protected]>
To: Yasemin Barutçu <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Mon, 21 Oct 2013 10:37:25 +0200
On 21.10.2013 10:22, Yasemin Barutçu wrote:
Hello Dirk,

I've done what you suggested. But I can't read passive records 2 values.

epics> 2013/10/21 11:16:51.892 192.168.1.198:9001
<http://192.168.1.198:9001> write 7
MEASC\r\n
2013/10/21 11:16:51.906 192.168.1.198:9001 <http://192.168.1.198:9001>
read 8
025 026
2013/10/21 11:16:51.914 192.168.1.198:9001 <http://192.168.1.198:9001>
read 8
027 025
2013/10/21 11:16:51.925 192.168.1.198:9001 <http://192.168.1.198:9001>
read 7
025 026
2013/10/21 11:16:52.025445 thermoIPConn M:TEMP1: Timeout after reading
23 bytes "... 026 027 025 025 026"


The timeout suggests that there is something wrong with your terminator settings. StreamDevice and asynDriver are waiting for more input but the device has stopped sending. I see no "\r\n" in the read debug output. Does the device send any terminator?


[root@105 ipThermo]# caput M:TEMP1 1
Old : M:TEMP1                        0
New : M:TEMP1                        1
[root@105 ipThermo]# caget M:TEMP1
M:TEMP1                        26
[root@105 ipThermo]# caget M:TEMP2
M:TEMP2                        0
[root@105 ipThermo]# caget M:TEMP3
M:TEMP3                        0
[root@105 ipThermo]# caget M:TEMP4
M:TEMP4                        0
[root@105 ipThermo]# caget M:TEMP5
M:TEMP5                        0
[root@105 ipThermo]# caget M:TEMP6
M:TEMP6                        0

I defined DTYP as "Raw Soft Channel".

Yasemin

Hello Yasemin

On 07.10.2013 10:03, Yasemin Barutçu wrote:

    Hello,

    I have a self-produced thermocouple and I connect to this device by RS 232.
    I want to read 6 different integers when I send"MEASC"  command to the
    device.

    in thermo.proto file, if I define %s, I can read all data by stringin.

    MEASC{
          out"MEASC";
          in"%s";
    }

    Example:
    2013/10/07 10:59:53.633192.168.1.198:9001  <http://192.168.1.198:9001>  <http://192.168.1.198:9001>
    write 6
    MEASC\n
    2013/10/07 10:59:53.647192.168.1.198:9001  <http://192.168.1.198:9001>  <http://192.168.1.198:9001>
    read 8
    029 030 029 028 028 028


    But I want to take all 6 datas in integer format. I search the
    streamdevice documentation and I found the following line.

There several possibilities to do this.


    MEASC{
          out"MEASC";
          array_in {separator="  "; in"%d";}
    }

    But it doesn't work. I got the following error.

No that does not work. What you wanted to do is:
MEASC{
     separator="  ";
     out"MEASC";
     in"%d";
}



But then you get an array of 6 values. Maybe you want to have the 6
values in separate records. You can do this using redirected input:

MEASC{
     out"MEASC";

in "%d %(\1:TEMP2)d %(\1:TEMP3)d %(\1:TEMP4)d %(\1:TEMP5)d %(\1:TEMP6)d";

}

Called from a record like this:
record (ai,"$(P):TEMP1") {
     field (DTYP,"stream)
     field (INP,"@thermo.proto MEASC($(P)) $(PORT)")
}

And 5 passive records like this:
record (ai,"$(P):TEMP2") {
}
record (ai,"$(P):TEMP3") {
}
record (ai,"$(P):TEMP4") {
}
record (ai,"$(P):TEMP5") {
}
record (ai,"$(P):TEMP5") {
}


Note that the 5 passive records have no "stream" support (in fact they
use "Soft Channel" or if you wish you can use "Raw Soft Channel").

Dirk







References:
Re: How to Read Multiple Values using StreamDevice with array_in Yasemin Barutçu

Navigate by Date:
Prev: Re: How to Read Multiple Values using StreamDevice with array_in Yasemin Barutçu
Next: RE: how to put value to other record in subroutine record Emmanuel Mayssat
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: How to Read Multiple Values using StreamDevice with array_in Yasemin Barutçu
Next: Base building problem on Win7 (both MinGW and VS 2012 Express) Koponen Jukka
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·