You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking into having https://www.instrumart.com/assets/GE-Druck-DPI104-Communications-Manual.pdf supported in EPICS using streamdevice.
The commands include a checksum that is a modulo 100 of the command bytes. This results in checksum values 00 .. 99.
So far I've added my own checksum calculation method to support the modulo 100 checksum.
Looking at the debug output in the IOC shell I can see that the actual message contains a checksum with three digits which my device is not happy to see.
My checksum calculation function:
// Checksum used by Druck DPI104 pressure gauge
static uint32_t dpi104(const uint8_t* data, size_t len, uint32_t sum)
{
while (len--)
{
sum += *data++;
}
sum %= 100;
return sum;
}
...
static checksum checksumMap[] =
..
{"dpi104", dpi104, 0x00, 0x00, 1} // 0x4D
..
Proto (not handling the input as-per the device docs ATM):
getString {
out "\$1?:%+<dpi104>";
in "%\$2[^\r\n]";
ExtraInput = Ignore;
}
DB:
# Get serial number
record(stringin, "$(P)$(R)SN")
{
field(DESC, "Serial number string")
field(DTYP, "stream")
field(INP, "@gedpi104.proto getString(SN,39) $(PORT) 0")
}
I'm looking into having https://www.instrumart.com/assets/GE-Druck-DPI104-Communications-Manual.pdf supported in EPICS using streamdevice.
The commands include a checksum that is a modulo 100 of the command bytes. This results in checksum values 00 .. 99.
So far I've added my own checksum calculation method to support the modulo 100 checksum.
Looking at the debug output in the IOC shell I can see that the actual message contains a checksum with three digits which my device is not happy to see.
My checksum calculation function:
Proto (not handling the input as-per the device docs ATM):
DB:
IOC shell:
Notice the
"SN?:082<0d><0a>"
being sent, whereas"SN?:82<0d><0a>"
is expected by the device.Any tips or tricks on how to only get 2 digit decimal checksum?
The text was updated successfully, but these errors were encountered: