Closed hinxx closed 5 years ago
BTW, this is on Linux, with EPICS R3.15.5, asyn R4-33 and streamDevice 2-7-11, if it matters.
On 10.04.19 14:37, Hinko Kočevar wrote:
Why did scanned value of |0.0100000| turn into |{<14>
G z<84>?|?
That are the 8 bytes of 0.0100000 in a double. Don't worry. :-) 0.0100000 = 0x3F847AE147AE147B In little endian: 0x7B 0x14 0xAE 0x47 0xE1 0x7A 0x84 0x3F Of those some are ASCII chars: 0x7B='{' 0x47='G' 0x7A='z' 0x3F='?'
I am more surprised by having "success" followed by "failure":
2019/04/10 14:30:56.010815 DET.DC1 StreamEpics.cc:532:
streamScanfN(PBILAB:DC1:SOUR:CCUR_R) success, value="{<14>
Let me do some tests.
BTW: "%g[^\r\n]" will not read a double followed by a char that is no return or newline, it will read a double followed by the literal string "[^\r\n]".
Also better don't use ExtraInput = Ignore unless absolutely necessary because it robs you of valuable consistency checks. For example if you expect a double like 1.00e-05 but data corruption changes it to 1.00f10 then you get the double 1.00 and the rubbish "f-05". If you ignore the rubbish reading will succeed and you end up with a value which off by 5 orders of magnitude and no error.
When I switch on errors (var streamError 1) I see this:
2019/04/10 15:30:26.755120 DET.DC1 StreamEpics.cc:532: streamScanfN(PBILAB:DC1:SOUR:CCUR_R) success, value=""
2019/04/10 15:30:26.755140 DET.DC1 PBILAB:DC1:SOUR:CCUR_R: Input "...000000E-02<0a>" mismatch after 11 bytes
2019/04/10 15:30:26.755158 DET.DC1 PBILAB:DC1:SOUR:CCUR_R: got "<0a>" where "[^" was expected
2019/04/10 15:30:26.755174 DET.DC1 StreamCore.cc:1149: StreamCore::readCallback(PBILAB:DC1:SOUR:CCUR_R) match failure
When I made errors switchable I did not switch it on automatically when debug is on. I will change that in the future. Also errors are off by default because people complained about error flooding. I will switch it back on by default in a future version.
Closed by accident.
Thanks @dirk-zimoch it works now! Couldn't notice my blunder without the var streamError 1
..
I have an ai record:
The protocol entry for getG() is:
I get this in the IOC shell when I do
dbpf $(ACQ_PREFIX)SOUR:CCUR_R.PROC 1
:I'm especially worried about these lines, from above:
Why did scanned value of
0.0100000
turn into{<14><ae>G<e1>z<84>?
?