Thanks for the quick reply ShaunR!
The message string does always have the same number of values but its values aren't padded so the total length of the string can differ from time to time.
Using "1,HS,%2s,%d,%d,%d,%d,%f" as format string did work when using the "Scan from string", except the last float, which just gave me an integer (for example 1.4 became 1 after the scan).
When changing the 6th parameter to float, "1,HS,%2s,%d,%d,%f,%d,%f", I get an error saying that the input string wasn't in the expected format.
The actual input string when the error message shows up is "1,HS,OK,0,21,0,0,1\r".
Thanks again!