Be more specific, what is your program doing? Do you need to see all the values or just the non-zero ones?
Did you try using a chart? This displays all data.
Or an array? Or write values to a file?
If it just needs slowing down, use a wait function in the loop? (may not be appropriate depending on your functionality.
Many other ways to do it if you have more information. Maybe upload your VI.
I am trying to read in serial from an arduino, but I cannot tell if it is receiving properly. Attached is my Vi.
I expect the "Bytes at port" needs to be moved inside the while loop (but still before the case structure)? At the moment it only gets read at the beginning and your bottom loop will forever be reading the true case and overwriting the indicators.
Did you start from some example code? What is the expected flow of execution?
If you are just quick debugging, consider wiring the string to the edge of the while loop, set the tunnel to indexing, and make an array indicator. This will show you all the strings that have come in (though only after you press stop). Or log to a file. Or maintain the array in the loop.
Another thing you can do is use NI IO Trace (separate program that should have installed). You can use this to monitor the VISA activity. Open it, press the green arrow, then run your program.
It is obvious that the message is terminated with a Line Feed (0xA). The serial port is already set up to use that. The VISA Read will stop its read when 1) the number of bytes you told it have been read OR 2) the termination character is read. So if you set the number of bytes to read higher than the number of bytes you expect to ever come in a message, the read will stop with the termination character. This ensures you got a complete message.
So since you are seeing if a message has even started, you need to move the Bytes At Port inside of the loop. Just do no use it to tell the VISA Read how many bytes to read.
You can get rid of the local variables for the stop button. You should have your producer loop (the VISA Read loop) send a message to the consumer to tell it when it has stopped. The consumer can then stop itself. You can also set the button's mechanical action back to Latch When Released.
You really should not be using the Queue Status. Just let the Dequeue Element sleep while it is waiting for data to come in.
Thank you IanSh and CrossRulez, a combination of your solutions has solved the problem. I needed bytes at port inside the while loop and to manually set the visaread bytes.