01-10-2025 10:57 AM
Hi everyone, first of all I want to say that I am a beginner at this. I am using an ESP32 along with 3 sensors (humidity, temperature and water level) Each one gives a different value... How can I make each value be represented in a separate indicator? I tried with VISA but it gives me the 3 measurements together that I send to print to the serial monitor from the code.
01-10-2025 11:39 AM
Depending on how often you send data, you must package it so you can reliably unpackage it properly.
Example,
You can send the data with a timestamp as well,
<Timestamp>,<Temperature>,<Humidity>,<WaterLevel><NewLine>
Now, when you read the serial in LabVIEW, you can split the data by <NewLine> and then split by comma, and knowing the order of fields, you can obtain the respective values.
01-10-2025 12:29 PM
I'd recommend sending your message in the form of [ID][data][termchar]. Put a delimeter between each field, for example, a comma.
For example, "Reading,46,14,75" for values of 46% humidity, 14 degrees, and 75% full of water (or whatever).
ABSOLUTELY use a termchar. Then, you can set up VISA on LabVIEW to read until a termchar, then use Scan from String to get your values, like this:
On the ESP side (assuming you're using Arduino core), use Serial.printf(Reading:%f,%f,%f\n,humidity,temp,level)
(If you're not using Arduino there will be a similar printf style function you can use).