![]() |
![]() ![]()
Experimental Physics and
| ||||||||||||||
|
Hello, everyone: I have a current-readout device, communicate with RS232, baud rate 115200, 8 bits data, 1 bit stop, no parity. For example, send "5A A5 55 00" as hexadecimal data, get "5a a5 03 06 7f 07", also as hexadecimal data. Now I use EPICS StreamDevice to connect the device, communication is correct, I want to save return dada to a record A and another record B. But I can not get right return data.Here attached the details. Does anyone know why? What's the problem here? How can I get all the returned data "ZZ ZZ" to two PVs such as A and B? Hope for your advice, thank you very much. record(ai, "data") { field(DTYP, "stream") field(INP, "@wcm.proto readdata wcm") field(SCAN, "1 second") } OutTerminator=CR LF; InTerminator=CR LF; readdata{ out "\x5A\xA5\x55\x00"; #it shows wrong if ther is a space " " between 5A and A5. in "\x5A\xA5\x03\x06%(A)2x%(B)2x" } I think I should get A=7f, B=07. But, the executing result: Then I try to use string type to get all the turned back data, it seems I can not do that. 2. Use string record (A, B,C,D)to receive returned data: { field(DTYP, "stream") field(INP, "@wcm.proto readdata wcm") field(SCAN, "1 second") } wcm.proto: OutTerminator=CR LF; InTerminator=CR LF; readdata{ out "\x5A\xA5\x55\x00"; in "\x5A\xA5%(A)28c" } Executing result: { field(DTYP, "stream") field(INP, "@wcm.proto readdata wcm") field(SCAN, "1 second") } wcm.proto: OutTerminator=CR LF; InTerminator=CR LF; readdata{ out "\x5A\xA5\x55\x00"; in "%s" } Executing result (The same as last one): Look forward to your advice. Thank you again. Best wishes, Kevin 6/19/2025
| ||||||||||||||
ANJ, 19 Jun 2025 |
![]() · Download · Search · IRMIS · Talk · Documents · Links · Licensing · |