Experimental Physics and
| |||||||||||||||
|
Hello Dirk, epics> 2013/10/21 11:16:51.892 192.168.1.198:9001 write 7I've done what you suggested. But I can't read passive records 2 values. MEASC\r\n 2013/10/21 11:16:51.906 192.168.1.198:9001 read 8 025 026 2013/10/21 11:16:51.914 192.168.1.198:9001 read 8 027 025 2013/10/21 11:16:51.925 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" [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 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.633 192.168.1.198:9001 <http://192.168.1.198:9001> write 6 MEASC\n 2013/10/07 10:59:53.647 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
| ||||||||||||||
ANJ, 20 Apr 2015 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |