How to compress an hexadecimal number into a short string?

First off the line should simple be like this

tagEPCBytes[counter][x] = nano.msg[31 + x];

but the real reason you are having a problem is because tagEPCBytes is not an array. It is defined on line 63 as a byte variable.

...R

PS ... I hope you now see the value of posting a complete program every time.