From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
Because you only do something with the data from the VISA read if you get at least 19 bytes. If it is less than 19 bytes, you concatenate it to another string that is stored in a shift register (by the way, you say array, but you don't have any arrays). But at any point of time you do get at least 19 bytes in your VISA read, you don't do anything with that data, and that shift register gets an empty string put into it.
I agree and suspected as much when I saw that image of yours. This is why it is important to attach the actual code. If you had done that initially, there would have been less time wasted in guessing.
p.s. Disable the termination character if you are reading binary.
If you look at the snippet that I posted earlier, you will notice that the delay in the loop is 10ms. It can be greater, but I would not make it any smaller value.