When a make the calculation manually, I get a different result than the one I obtain through my script (and displayed thanks to a System.print(chk) command).
I also tried with a (volume1).toString(16) conversion, but result is still not correct.
If I take the example of a volume1 = 13 (decimal), I should have at the end the following RS 232 command: