![]() |
![]() ![]()
Experimental Physics and
| ||||||||||||||
|
Hello Li Xing,
Your statements and your protocol file are not consistent. For the output, your statement seems to say that you send 8 bytes, and your 'out' string in the protocol is indeed sending 8 bytes. For the returned data, your statement seems to say that you expect 7 bytes, however, the 'in' part of your protocol is trying to receive 14 bytes (characters). Following your statement (receive 7 bytes), please try using a single record (longin or ai record, depending on desired conversion into a double; no calc needed) and an 'in' part that reads "raw" bytes. Do something like out "\xFE\x04\x00\x00\x00\x01\x25\ in "%*3r%02r%*2r" (ignore 3 bytes, read 2 unsigned bytes as big endian, ignore 2 bytes) If parts of the returned message are fixed, include them in your in format. E.g., if the return always starts with "FE 04", your in format could be "\xFE\x04%*1r%02r%*2r". This increases robustness, because if the communication gets out of sync, the protocol will not blindly decode bytes at the wrong position. Cheers, ~Ralph On Fri, Feb 16, 2018 at 11:27 AM, l123173 <[email protected]> wrote:
| ||||||||||||||
ANJ, 19 Feb 2018 |
![]() · Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |