How to compress an hexadecimal number into a short string?

Some "string" functions can analyze occurrence of "substring" within a string starting at selected position, even "from the end" toward the beginning of the string.
( i did not look on your implementation of "analyzing loop", but using substring analysis could be more fun).

Hex notation is just a convenient shorthand , it is still binary number occupying 4 bits, all you can really do is
to remove unwanted spaces before storing the string.

all you can really do is to remove unwanted spaces before storing the string

You can actually do much better: convert two ASCII hex digits to binary (0 to 255 in decimal notation), and store each pair in one byte rather than two bytes.

Please see replies #5, #8, #9 and #10 for more information.

jremington:
You can actually do much better: convert two ASCII hex digits to binary (0 to 255 in decimal notation), and store each pair in one byte rather than two bytes.

Please see replies #5, #8, #9 and #10 for more information.

Hex notation is just a convenient shorthand , it is still binary number occupying 4 bits,,,

232:
Hex notation is just a convenient shorthand , it is still binary number occupying 4 bits, all you can really do is
to remove unwanted spaces before storing the string.

There is NO string to be stored.

Just 12 (or 5) bytes.

...R

I tried follwing code changes. In the old code i converted it to HEX, now i get it raw.

old code
Serial.print(nano.msg[31 + x], HEX);

new code
Serial.print(nano.msg[31 + x])

for (byte x = 0 ; x < tagEPCBytes ; x++)
      { 
        Serial.print(nano.msg[31 + x]);
        Serial.print(F(" "));
      }
      Serial.print(F("]"));

I get this in Serial Monitor

226 0 0 23 34 10 0 55 20 112 127 158
226 0 0 23 34 10 0 57 20 112 127 159
226 0 0 23 34 10 0 56 20 112 127 151
226 0 0 23 34 10 0 81 20 112 127 189
226 0 0 23 34 10 0 113 20 112 127 223

How to store the Values in a 2 dimensional array[50][12] without duplicates and with a minimum on Bytes

Never mind about converting the bytes to something a human can read - which is the purpose of Serial.prin().

Just save the bytes into an array

byte myArray[5][12]; // creates 5 arrays each with 12 bytes (I hope)
for (byte x = 0 ; x < 12 ; x++)
{ 
         myArray[0][x] = nano.msg[31 + x]; // stores the values in the first of the 5 rows
}

...R

If I try

byte tagEPCBytes[50][12];
for (byte x = 0 ; x < tagEPCBytes ; x++)
      { 
        tagEPCBytes[counter][x] = nano.msg[31 + x];
        Serial.print(nano.msg[31 + x]);
        Serial.print(F(" "));
      }

I get the following errors

error: invalid types 'byte {aka unsigned char}[int]' for array subscript

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


                            ^


invalid types 'byte {aka unsigned char}[int]' for array subscript

I tried to change the type of tagEPCBytes[50][12]; to int or char. No one works.

pekabo:

for (byte x = 0 ; x < tagEPCBytes ; x++)

{
        tagEPCBytes[counter][x] = nano.msg[31 + x];
        Serial.print(nano.msg[31 + x]);
        Serial.print(F(" "));
      }

As you have not posted the complete program I can't tell how the variable counter is defined

...R

I wrote all the code in post #7.
From then on, only the code that was changed

int counter = 0;

after each scanned TAG the counter is increased by 1

Serial.println(counter++);

I think, I've got the wrong type. I am trying to store the an int in a byte. I try to cast it to byte

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

this gives me following error

error: invalid types 'byte {aka unsigned char}[byte {aka unsigned char}]' for array subscript

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

now i am confused :astonished:

pekabo:
now i am confused :astonished:

So am I.

Help us to help you. Post the complete program that gave rise to the error mentioned in Reply #17 and don't expect us to stitch things together - mainly because we might make a mistake while doing so.

...R

Robin2:
Help us to help you. Post the complete program that gave rise to the error mentioned in Reply #17 and don't expect us to stitch things together - mainly because we might make a mistake while doing so.
...R

It's definitely a lot easier to copy / paste into the IDE if you only have to copy from one place.

This code

#include <SoftwareSerial.h> 

SoftwareSerial softSerial(2, 3); 

#include "SparkFun_UHF_RFID_Reader.h" 
RFID nano; 

#define BUZZER1 10

#define BUZZER2 9

boolean tagDetected; 
long lastSeen = 0; 
int counter = 0; 

void setup()
{
  Serial.begin(115200);

  pinMode(BUZZER1, OUTPUT);
  pinMode(BUZZER2, OUTPUT);

  digitalWrite(BUZZER2, LOW); 

  while (!Serial); 

  if (setupNano(38400) == false) 
  {
    Serial.println(F("Das Modul hat nicht reagiert. Bitte überprüfen Sie die Anschlüsse."));
    while (1); 
  }

  nano.setRegion(REGION_NORTHAMERICA); 

  
  nano.setReadPower(2700); 
  

  nano.startReading(); 

  Serial.println("Scannprozess läuft!");

  lowBeep(); 
  tagDetected = false;
}

void loop()
{
  byte myEPC[12]; 
  byte myEPClength;
  byte responseType = 0;

  byte tagEPCBytes[50][12];

  if (nano.check() == true) 
  {
    byte responseType = nano.parseResponse(); 

    if (responseType == RESPONSE_IS_TAGFOUND)
    {      
      long timeStamp = nano.getTagTimestamp(); 
      byte tagEPCBytes = nano.getTagEPCBytes(); 

      Serial.print(F("RFID-Tag detektiert: "));
      Serial.println(counter++);
     
      
      Serial.print(F("RFID-Daten EPC["));
      for (byte x = 0 ; x < tagEPCBytes ; x++)
      {
        if (nano.msg[31 + x] < 0x10) Serial.print(F("0")); 
        Serial.print(nano.msg[31 + x], HEX);
        Serial.print(F(" "));
      }      
      Serial.println(F(" "));

      
      Serial.print(F("Bin-Daten["));
      for (byte x = 0 ; x < tagEPCBytes ; x++)
      { 
        tagEPCBytes[(byte *) &counter][x] = nano.msg[31 + x];
        Serial.print(nano.msg[31 + x]);
        if (x != 11) Serial.print(F(" "));
      }
      Serial.print(F("] "));
      
      if (tagDetected == false) 
      {
        tagDetected = true;
        highBeep();
      }
      else if (millis() - lastSeen > 250) 
      {
        highBeep();
      }
      lastSeen = millis();

    }
  }

  if (tagDetected == true && (millis() - lastSeen) > 1000)
  {
    Serial.println(F("Kein RFID-Tag gefunden..."));

    tagDetected = false;
    lowBeep();
  }

  
  if (Serial.available())
  {
    nano.stopReading(); 

    Serial.read(); 
    Serial.println("Scannen angehalten. Drücken Sie die Taste, um fortzufahren.");
    while (!Serial.available());
    Serial.read(); 

    nano.startReading(); 
  }
}



boolean setupNano(long baudRate)
{
  nano.begin(softSerial); 

  

  
  
  softSerial.begin(baudRate); 
  while (!softSerial); 

  
  while (softSerial.available()) softSerial.read();

  nano.getVersion();

  if (nano.msg[0] == ERROR_WRONG_OPCODE_RESPONSE)
  {
    
    nano.stopReading();

    Serial.println(F("Modul liest kontinuierlich. Modul soll kontinuierlich lesen beenden...."));

    delay(1500);
  }
  else
  {
    
    softSerial.begin(115200); 

    nano.setBaud(baudRate); 

    softSerial.begin(baudRate); 
  }

  
  nano.getVersion();
  if (nano.msg[0] != ALL_GOOD) return (false); 

  
  nano.setTagProtocol(); 

  nano.setAntennaPort(); 

  return (true); 
}

void lowBeep()
{
  tone(BUZZER1, 130, 150); 
  
}

void highBeep()
{
  tone(BUZZER1, 2093, 150); 
  
}

gives me following Error

error: invalid types 'byte {aka unsigned char}[byte {aka unsigned char}]' for array subscript

         tagEPCBytes[(byte *) &counter][x] = nano.msg[31 + x];

                                         ^

exit status 1
invalid types 'byte {aka unsigned char}[byte {aka unsigned char}]' for array subscript

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.

  byte tagEPCBytes[50][12]; //<<<<<<<<<<<<<<<<<<<<<<<<

  if (nano.check() == true) 
  {
    byte responseType = nano.parseResponse(); 

    if (responseType == RESPONSE_IS_TAGFOUND)
    {      
      long timeStamp = nano.getTagTimestamp(); 
      byte tagEPCBytes = nano.getTagEPCBytes();  //<<<<<<<<<<<<<<<<<<<<<<<<
warning: unused variable 'tagEPCBytes' [-Wunused-variable]
   byte tagEPCBytes[50][12];

set your compiler warnings to ALL

Variable Shadowing

Error with compiler warnings to ALL

Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Uno"

D:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\Program Files (x86)\Arduino\hardware -hardware AppData\Local\Arduino15\packages -tools D:\Program Files (x86)\Arduino\tools-builder -tools D:\Program Files (x86)\Arduino\hardware\tools\avr -tools AppData\Local\Arduino15\packages -built-in-libraries D:\Program Files (x86)\Arduino\libraries -libraries \Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path AppData\Local\Temp\arduino_build_354337 -warnings=all -build-cache AppData\Local\Temp\arduino_cache_815643 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.arduinoOTA.path=AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -verbose RFID-Array.ino
D:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware D:\Program Files (x86)\Arduino\hardware -hardware AppData\Local\Arduino15\packages -tools D:\Program Files (x86)\Arduino\tools-builder -tools D:\Program Files (x86)\Arduino\hardware\tools\avr -tools AppData\Local\Arduino15\packages -built-in-libraries D:\Program Files (x86)\Arduino\libraries -libraries \Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path AppData\Local\Temp\arduino_build_354337 -warnings=all -build-cache AppData\Local\Temp\arduino_cache_815643 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.arduinoOTA.path=AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -verbose RFID-Array.ino
Using board 'uno' from platform in folder: AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21
Using core 'arduino' from platform in folder: AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21
Detecting libraries used...
"AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "AppData\Local\Temp\arduino_build_354337\sketch\RFID-Array.ino.cpp" -o "nul"
"AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SoftwareSerial\src" "AppData\Local\Temp\arduino_build_354337\sketch\RFID-Array.ino.cpp" -o "nul"
"AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SoftwareSerial\src" "-I\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\src" "AppData\Local\Temp\arduino_build_354337\sketch\RFID-Array.ino.cpp" -o "nul"
Using cached library dependencies for file: AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SoftwareSerial\src\SoftwareSerial.cpp
"AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SoftwareSerial\src" "-I\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\src" "\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\src\SparkFun_UHF_RFID_Reader.cpp" -o "nul"
Generating function prototypes...
"AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SoftwareSerial\src" "-I\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\src" "AppData\Local\Temp\arduino_build_354337\sketch\RFID-Array.ino.cpp" -o "AppData\Local\Temp\arduino_build_354337\preproc\ctags_target_for_gcc_minus_e.cpp"
"D:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "AppData\Local\Temp\arduino_build_354337\preproc\ctags_target_for_gcc_minus_e.cpp"
Sketch wird kompiliert...
"AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "-IAppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SoftwareSerial\src" "-I\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\src" "AppData\Local\Temp\arduino_build_354337\sketch\RFID-Array.ino.cpp" -o "AppData\Local\Temp\arduino_build_354337\sketch\RFID-Array.ino.cpp.o"
RFID-Array.ino: In function 'void loop()':

RFID-Array:99: error: invalid types 'byte {aka unsigned char}[byte {aka unsigned char}]' for array subscript

         tagEPCBytes[(byte *) &counter][x] = nano.msg[31 + x];

                                         ^

RFID-Array.ino:79:12: warning: unused variable 'timeStamp' [-Wunused-variable]

       long timeStamp = nano.getTagTimestamp(); //Liefert die Zeit (ms) seit der letzten Keep-Alive-Meldung.

            ^

RFID-Array.ino:67:8: warning: unused variable 'myEPC' [-Wunused-variable]

   byte myEPC[12]; //Die meisten EPCs sind 12 Bytes groß.

        ^

RFID-Array.ino:68:8: warning: unused variable 'myEPClength' [-Wunused-variable]

   byte myEPClength;

        ^

RFID-Array.ino:69:8: warning: unused variable 'responseType' [-Wunused-variable]

   byte responseType = 0;

        ^

RFID-Array.ino:71:8: warning: unused variable 'tagEPCBytes' [-Wunused-variable]

   byte tagEPCBytes[50][12];

        ^

Bibliothek SoftwareSerial in Version 1.0 im Ordner: AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SoftwareSerial  wird verwendet
Bibliothek SparkFun_Simultaneous_RFID_Tag_Reader_Library-master in Version 1.0.4 im Ordner: \Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master  wird verwendet
exit status 1
invalid types 'byte {aka unsigned char}[byte {aka unsigned char}]' for array subscript

The problem is that you have two variable using the same name. Give them different names.

EDIT following helpful comments by @BulldogLowell in Reply #28

You have an global array local to the loop function

byte tagEPCBytes[50][12];

and a local byte with the same name local to that block of code

byte tagEPCBytes = nano.getTagEPCBytes();

and the local variable in the block takes precedence.

The byte variable tagEPCBytes is used to hold the number of bytes in the tag so maybe it would be better called tagEPCByteCount

...R

Robin2:
You have an global array local to the loop function

 byte tagEPCBytes[50][12];

and a local byte with the same name local to that block of code

the array name acts like a pointer... thus your errors/warnings

@BulldogLowell, thanks for spotting that. I have updated my Reply.

...R

i have successfully modified the source code as follows.

#include <SoftwareSerial.h> 
#include <stddef.h>

SoftwareSerial softSerial(2, 3); 

#include "SparkFun_UHF_RFID_Reader.h" 
RFID nano; 

#define BUZZER1 10

#define BUZZER2 9

boolean tagDetected; 
long lastSeen = 0; 
int counter = 0; 

void setup()
{
  Serial.begin(115200);

  pinMode(BUZZER1, OUTPUT);
  pinMode(BUZZER2, OUTPUT);

  digitalWrite(BUZZER2, LOW); 

  while (!Serial); 

  if (setupNano(38400) == false) 
  {
    Serial.println(F("Das Modul hat nicht reagiert. Bitte überprüfen Sie die Anschlüsse."));
    while (1); 
  }

  nano.setRegion(REGION_NORTHAMERICA); 

  
  nano.setReadPower(2700); 
  

  nano.startReading(); 

  Serial.println("Scannprozess läuft!");

  lowBeep(); 
  tagDetected = false;
}

void loop()
{
  byte myEPC[12]; 
  byte myEPClength;
  byte responseType = 0;

  uint8_t tagEPCBytes[50][12];

  if (nano.check() == true) 
  {
    byte responseType = nano.parseResponse(); 

    if (responseType == RESPONSE_IS_TAGFOUND)
    {
      long timeStamp = nano.getTagTimestamp(); 
      byte tagEPCByteCount = nano.getTagEPCBytes(); 

      Serial.print(F("RFID-Tag detektiert: "));
      Serial.println(counter++); 

      
      Serial.print(F("RFID-Daten EPC["));
      for (byte x = 0 ; x < tagEPCByteCount ; x++)
      {
        if (nano.msg[31 + x] < 0x10) Serial.print(F("0")); 
        Serial.print(nano.msg[31 + x], HEX);
        if (x != 11) Serial.print(F(" "));
      }
      Serial.println(F("] "));

      
      Serial.print(F("Bin-Daten["));
      for (byte p = 0 ; p < tagEPCByteCount ; p++)
      {
        tagEPCBytes[counter][p] = ((uint8_t) nano.msg[31 + p]);
        Serial.print(nano.msg[31 + p]);
        if (p != 11) Serial.print(F(" "));
      }
      Serial.println(F("] "));

      if (tagDetected == false) 
      {
        tagDetected = true;
        
      }
      else if (millis() - lastSeen > 250) 
      {
        
      }
      lastSeen = millis();

    }
  }

  if (tagDetected == true && (millis() - lastSeen) > 1000)
  {
    Serial.println(F("Kein RFID-Tag gefunden..."));

    tagDetected = false;
    
  }

  
  if (Serial.available())
  {
    nano.stopReading(); 
    Serial.read(); 
    
    delay(1000);
    
    Serial.println("Array Ausgabe:\n");
    delay(333);
    int i, j;    
    for (i = 0; i < 50; i++) {
      for (j = 0; j < 12; j++) {
        Serial.print(tagEPCBytes[i][j]);
        Serial.print(" ");
        if (j == 11) {
          Serial.println(" ");
        }
      }
    }
    delay(333);
    Serial.println("Scannen angehalten. Drücken Sie die Taste, um fortzufahren.");

    while (!Serial.available());
    Serial.read(); 

    nano.startReading(); 
  }
}



boolean setupNano(long baudRate)
{
  nano.begin(softSerial); 

  

  
  
  softSerial.begin(baudRate); 
  while (!softSerial); 

  
  while (softSerial.available()) softSerial.read();

  nano.getVersion();

  if (nano.msg[0] == ERROR_WRONG_OPCODE_RESPONSE)
  {
    
    nano.stopReading();

    Serial.println(F("Modul liest kontinuierlich. Modul soll kontinuierlich lesen beenden...."));

    delay(1500);
  }
  else
  {
    
    softSerial.begin(115200); 

    nano.setBaud(baudRate); 

    softSerial.begin(baudRate); 
  }

  
  nano.getVersion();
  if (nano.msg[0] != ALL_GOOD) return (false); 

  
  nano.setTagProtocol(); 

  nano.setAntennaPort(); 

  return (true); 
}

void lowBeep()
{
  tone(BUZZER1, 130, 150); 
  
}

void highBeep()
{
  tone(BUZZER1, 2093, 150); 
  
}

I get follwing serial monitor output.

Scannprozess läuft!
RFID-Tag detektiert: 0
Bin-Daten[226 0 0 23 34 10 0 55 20 112 127 158] 
RFID-Tag detektiert: 1
Bin-Daten[226 0 0 23 34 10 0 56 20 112 127 151] 
RFID-Tag detektiert: 2
Bin-Daten[226 0 0 23 34 10 0 55 20 112 127 158] 
RFID-Tag detektiert: 3
Bin-Daten[226 0 0 23 34 10 0 56 20 112 127 151] 
RFID-Tag detektiert: 4
Bin-Daten[226 0 0 23 34 10 0 55 20 112 127 158] 
RFID-Tag detektiert: 5
Bin-Daten[226 0 0 23 34 10 0 113 20 112 127 223] 
RFID-Tag detektiert: 6
Bin-Daten[226 0 0 23 34 10 0 55 20 112 127 158] 
RFID-Tag detektiert: 7
Bin-Daten[226 0 0 23 34 10 0 56 20 112 127 151] 
RFID-Tag detektiert: 8
Bin-Daten[226 0 0 23 34 10 0 81 20 112 127 189] 
RFID-Tag detektiert: 9
Bin-Daten[226 0 0 23 34 10 0 113 20 112 127 223] 
RFID-Tag detektiert: 10
Bin-Daten[226 0 0 23 34 10 0 56 20 112 127 151] 
RFID-Tag detektiert: 11
Bin-Daten[226 0 0 23 34 10 0 56 20 112 127 151] 
RFID-Tag detektiert: 12
Bin-Daten[226 0 0 23 34 10 0 113 20 112 127 223] 
Array Output:

226 0 0 23 34 10 0 55 20 112 127 158  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 55 20 112 127 158  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 55 20 112 127 158  
226 0 0 23 34 10 0 113 20 112 127 223  
226 0 0 23 34 10 0 55 20 112 127 158  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 81 20 112 127 189  
226 0 0 23 34 10 0 113 20 112 127 223  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 113 20 112 127 223  
226 0 0 23 34 10 0 55 20 112 127 158  
226 0 0 23 34 10 0 81 20 112 127 189  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 57 20 112 127 159  
226 0 0 23 34 10 0 81 20 112 127 189  
226 0 0 23 34 10 0 113 20 112 127 223  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 81 20 112 127 189  
226 0 0 23 34 10 0 113 20 112 127 223  
226 0 0 23 34 10 0 57 20 112 127 159  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 81 20 112 127 189  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 81 20 112 127 189  
226 0 0 23 34 10 0 55 20 112 127 158  
226 0 0 23 34 10 0 57 20 112 127 159  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 113 20 112 127 223  
226 0 0 23 34 10 0 81 20 112 127 189  
226 0 0 23 34 10 0 57 20 112 127 159  
226 0 0 23 34 10 0 55 20 112 127 158  
226 0 0 23 34 10 0 81 20 112 127 189  
226 0 0 23 34 10 0 56 20 112 127 151  
226 0 0 23 34 10 0 113 20 112 127 223  
220 93 169 149 222 117 79 139 22 252 208 175  
69 82 162 142 124 127 3 174 81 242 43 136  
153 4 98 75 88 163 79 241 31 166 107 54  
239 4 62 52 164 91 117 244 229 29 171 246  
220 78 136 193 254 233 129 190 104 61 190 140  
90 93 27 15 55 225 197 194 122 223 11 64  
60 9 93 59 127 216 212 59 53 59 218 58  
202 125 253 214 139 117 207 98 40 166 23 145  
103 91 6 249 0 0 255 36 6 249 0 0  
7 17 3 108 29 35 2 108 157 41 216 144  
33 17 0 2 54 4 187 7 132 0 193 1  
202 0 1 1 108 7 7 1 201 0 1 201  
1 201 0 0 0 0 2 208 0 0 0 0  
Scannen angehalten. Drücken Sie die Taste, um fortzufahren.

The Problem is solved, I can now write the RFID-values in a 2D-Array.
I don't know why i have much more data in the array uint8_t tagEPCBytes[50][12] than i have scanned?

I have a other question, but it is better to open a new thread. Because it has nothing to do with this problem.

Thanks to all those who helped me.