This is DATA 1
RE00002200050046\00 0.00 0.1 0.125.9\0#####- 14 0##### \0 0##### 141.0\004.00 0: 00.000.0\00 4: 011:27 0: 015:27#\0###########2.00.0\0
Another data that i have is
This is DATA 2
RE000022601\0500460 0.00 0.1\0 0.236.8####\0# 57- 2#####- 3#####\0- 601.004.0\00 4: 00.000.\000 4: 013:37 0\0: 017:37#####\0#######2.00.\00
The above data is the response i get from an hospital machine,i have to parse the above values and fill it according to given format:-
BYTEs 2 2 4 128 2 2
+---------+--------+------------+-----------------+--------+-------+
| RE | 00 | machine no| Data part | Check | CRC |
| | | | | sum | |
+---------+--------+------------+-----------------+--------+-------+
As you can see from DATA 1 My data part begins from "000500.."
and DATA 2 My data part begins from "601\0500..."
While doing parsing i got into a problem that there is field named "Blood pump flow" whose length is 3 bytes from the "DATA 1" we get its value as "46" while from the
"DATA 2" i got its value as "460".
In actual its value should be "460"
If i get a data like DATA 1 my whole parsing logic suffers as because as "Blood pump flow" is "3 bytes" i get a value "46\0" and "0" is added to another field while "Blood pump flow" should be "460".
The above is just one case i get it many times for some other fields too.
How to resolve this problem.