Dear all,
sorry for reviving this old thread, but I received several questions if
and how I solved this problem during the last weeks.
Since it was never answered in Tech-Talk and the solution cannot be
found in the stream device documentation, I wanted to share it here:
To get the checksum as ASCII string one can use the "+" flag. So the
protocol for the example below would look like:
getActRotspd {
# get actual frequency for pump
# Example of command:
# field (INP, "@Pfeiffer_TCP350.proto getActRotspd($(ADD)) $(PORT)")
out "\${1}0030902=?%+<sum8>";
in "\${1}1030906%06u%+<sum8>";
}
Best regards,
Florian
On 11/21/2013 11:04 AM, Florian Feldbauer wrote:
Hey Dirk,
we want to control some turbo drag pumps from Pfeiffer Vacuum with EPICS.
The pumps have a RS485 interface, so we can use StreamDevice and asyn
for the
communication.
The protocol from Pfeiffer looks like this (using ASCII symbols):
3 digit address
2 digit action (read "00" or write "10")
3 digit parameter number
2 digit data length
x digits data (according to data length)
3 digit checksum
CR
The checksum is the sum of all ASCII symbols up to preceding checksum
modulo 256 (decimal)
converted into ASCII string.
As an example, reading the actual rotation speed for address 123 would
be:
"1230030902=?112\r"
Would it be possible to add a corresponding pseudo-converter to
StreamDevice with little effort,
or would it be easier to use records for the calculation?
In principal we need something like %<sum8> but formatted like %d
Best regards,
Florian