03-27-2026 06:23 AM
Hi everyone. I have a ESP32 where a simple program installed. It sends me answers depending on the commands. Answers are several string of simple text. All types of answers are ending with marker "<----- END ----->". It works ideally throw Serial monitor? but I want to communicate with it using Labview. My code doesn't work, but I can't find the problem. Please, help. I saw a lot of videos, but I still stuck with it.
03-27-2026 08:09 AM
Could you supply some more information on how you have the ESP32 programed? Or maybe a screenshot of a command and response through your serial terminal program? I'm looking for the actual command protocol.
My guess is that you are trying to receive multiple lines in the response. This could be a problem since your termination character is the Line Feed. With this in mind, I would set the termination character to > (62, 0x3E) and attempt to read 4096 characters at a time. This should catch the final string from the response and everything before that.
You also do not need the wait or the Bytes At Port in your loop. If this is done properly, you should not need the shift register either.
03-27-2026 09:32 AM
I changed code for ESP32 а bit. Now it starts blinking in additional to text responses like on
the first screenshot. But is still doesn't work. I have also taken the example from YouTube, where the same staff perfectely worked (second screenshot) just to try, but it didn't help.
I noticed that despite commands aren't delivered to ESP and the photodiode doesn't blink, the usb is still loaded, so I can't connect throw Serial monitor of Arduino IDE while Labview is working. Am I out of my mind?
03-28-2026 07:52 AM - edited 03-28-2026 07:53 AM
Does your ESP32 require a termination character for it to receive the message? You should try adding an End Of Line Constant to the end of your command before writing.
Personally, I would do a setup link this.

I used an Event Structure so that the message is only sent when a value changes. There is no real need to bog your microcontroller down with repeated messages.
The Termination Character is set to be the '>' character, setting up the VISA Read to read your entire message. I am also a big fan of the Format Into String, so I would utilize it here to create the message.
In the format, '%d' formats something into an integer. In the case of a boolean, it will format it into "0" for FALSE and "1" for TRUE.
The '\n' in the format is the code for a Line Feed. Terminal programs rely on you pressing the Enter key before sending, which will include the Line Feed. So if it works in a terminal program, this is likely what you are missing.
Not shown in the image, but the VISA Close is in the stop event case. I used the "Panel Close?" event to shut the program down, but you could just as easily use a stop button.
03-28-2026 12:33 PM
@crossrulz wrote:
Does your ESP32 require a termination character for it to receive the message? You should try adding an End Of Line Constant to the end of your command before writing.
Personally, I would do a setup link this.
I used an Event Structure so that the message is only sent when a value changes. There is no real need to bog your microcontroller down with repeated messages.
The Termination Character is set to be the '>' character, setting up the VISA Read to read your entire message. I am also a big fan of the Format Into String, so I would utilize it here to create the message.
In the format, '%d' formats something into an integer. In the case of a boolean, it will format it into "0" for FALSE and "1" for TRUE.
The '\n' in the format is the code for a Line Feed. Terminal programs rely on you pressing the Enter key before sending, which will include the Line Feed. So if it works in a terminal program, this is likely what you are missing.
Not shown in the image, but the VISA Close is in the stop event case. I used the "Panel Close?" event to shut the program down, but you could just as easily use a stop button.
No, it doesn't. If the ESP means Ecolab Serial Protocol it is an unfortunate bastardisation of anything resembling common practice. Fortunately, Ecolab DOES have access to a vilib that I AUTHORED about a dozen years ago! You may need to travel to Eagan, MN. Ask about the code that washes dishes. The ESP32.LVLIB is in there!