![]() |
![]() ![]()
Experimental Physics and
| ||||||||||||||
|
Hello everyone, I am using the stream device to gat data from a device, and have a problem about format conbersion. I hope to get some advice and will appreciate for your help. I want to send data, such as "09", in hexademical format to the device. the device will return a float data %f. Statements in the db file: recorrd(ai, "$(P)$(R)read") { field(DESC, "read pressure") field(DTYP, "stream") field(INP, "@pressure.proto SendCommand(09) $(PORT)") field(SCAN, "1 second") } Statements in the protocol file is like this: SendCommand{ out "\x\$1"; in "%f"; } when I run the st.cmd, an error occurs: Hex digit expected after \x: "\X"" if "09" is send directly, not as a variable "\$1": SendCommand{ out "\x09"; in "%f"; } everything goes well and I can get the returned %f correctly. I wonder how can I send "09" as a variable? How to change a variable in the record to be hexadecimal? Thank you very much for any advice, I will try it and give feedback. Bset wishes
Chunxia Yin
| ||||||||||||||
ANJ, 21 Aug 2020 |
![]() · Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |