Interface a HMI with Arduino mega through serial pins

Hello guys,

Iam trying to interface a HMI with Arduino mega through serial pins

iam able to receive data in form of string, when i press any key on HMI for eg keypad no.1 (A5 5A 06 83 00 11 01 00 01)

in which A5 and 5A serial High and low bit, 06 is byte length, 83 is reading command, 00 11 is LCD variable

00 01 is actual data or number

I want to extract data(0-2000) form string and store in a variable so i can use it

New post split from an old thread

How is the programming going so far?

To add a digit to the end of a number:

    number *= 10;  // Shortcut for "number = number * 10;"
  number += digit;  // Shortcut for "number = number + digit;"

All you have to do is figure out what digit each arriving message represents and pick some input to be the 'Enter' key so you know when the number is complete.