Jump to content

Help with constructions!


Recommended Posts

I am new with labview and i am a little stuck! I build this in order to read the data from 2 senzors one for temperature and humidity and one for air quality conected to an esp32. What i want is to take the data and make it that the values i recevie to be put separately each one in his own output! What to do?

Screenshot (222).png

Screenshot (223).png

Link to comment

And what is the program on your ESP32 doing? Does it even listen on the according serial port? Does it know what it should do when seeing an *IDN?<new line> on that port? What does it send back when seeing that command?

The ESP32 is a capable microcontroller board but it needs a program that can implement the reading of your sensors and react to commands from your LabVIEW program and send something back. And that program needs to be implemented by you in one of the supported programming languages for the ESP32. Most likely you will want to use ESP-IDF as a plugin in either Eclipse or VSCode. 

Link to comment
On 4/22/2024 at 12:16 PM, Rolf Kalbermatter said:

And what is the program on your ESP32 doing? Does it even listen on the according serial port? Does it know what it should do when seeing an *IDN?<new line> on that port? What does it send back when seeing that command?

The ESP32 is a capable microcontroller board but it needs a program that can implement the reading of your sensors and react to commands from your LabVIEW program and send something back. And that program needs to be implemented by you in one of the supported programming languages for the ESP32. Most likely you will want to use ESP-IDF as a plugin in either Eclipse or VSCode. 

This is the code i use! It works, but what i want is to take the data in the response and to separate and to put separate!

sketch_mar23a.ino

Link to comment

Well, basically your program does never read anything from the serial port so your sending anything like *IDN? to it is totally superfluous and even wrong. As soon as it starts up it starts to spew a line of text every 500 ms, no matter if there is anyone listening or not.

Basically, you want to startup your LabVIEW program

- initialize the serial port with the correct parameters, leaving the Enable Termination character on as you now do

- do one read of at least 100 bytes or more, possibly even multiple times to make sure the serial port input buffer is cleaned from any partial or old data

- do NOT send anything to the device

- then do a VISA Read with something like 100 bytes at least, every 500 ms, DO NOT USE Bytes at Serial port!!!!!!!

You should see a string like "Temperature: <number> °C | Humidity: <number> % | Air Quality: <number>".

The degree sign ° and the pipe symbol | might however pose a problem. No sure what locale your Arduino device uses, but it may not be the same as your Windows computer uses and then those characters will not match with what you expect.

Edited by Rolf Kalbermatter
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.