Have you tried using the width field - ie:
in "\${1}1034006%6E%*u";
Pete
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Florian Feldbauer
Sent: 27 March 2013 09:05
To: EPICS Tech Talk
Subject: Fix length of exponent in Streamdevice %E
Dear all,
I'm trying to read out a Pfeiffer TCP350 via serial interface. This device controls a vacuum pump and a vacuum gauge.
To request data from the device the ascii sting looks like this:
3 digits address
2 digits action ("00" for reading)
3 digits parameter number
2 digits data length
"=?" as data
and 3 digit checksum followed by CR.
The reply looks the same except, that data contains the actual value.
The checksum is the sum of all ASCII characters modulo 256 and this converted to a 3 digit ascii string.
E.g.: the sum of all ASCII chars is 786, 786%256 = 18, than the checksum would be "018".
Now I have the following problem. I want to read out the pressure measured by the gauge using streamDevice.
The value is transmitted as exponential.
I have the following protocol:
out "\${1}0034002=?\${2}";
in "\${1}1034006%E%*u";
$1 is the module address, $2 the (hardcoded) checksum for the data request.
Here are some examples of the reply from the device
00110340061.6E-1039 where 1.6E-1 is the value, 039 the checksum
00110340065.6E-4046 where 5.6E-4 is the value, 046 the checksum
00110340064.3E-4042 where 4.3E-4 is the value, 042 the checksum
Using above protocol leads to an error because streamDevice reads the checksum as a part of the exponent. Is there a way to tell streamDevice that the exponent is only one digit (+sign) long?
Or that the whole value has always 6 digits?
Best regards,
Florian
--
----------------------------------------
| Dr. Florian Feldbauer |
| |
| Helmholtz-Institut Mainz / |
| Johannes Gutenberg-Universität Mainz |
| Johann-Joachim-Becher-Weg 45 |
| D-55128 Mainz |
| |
| Office: 01/217 |
| Phone: (+49)6131 / 39-25829 |
----------------------------------------