10-05-2019 09:57 AM - edited 10-05-2019 10:04 AM
This is an IoT project.
In the current setup I have a machine controlled by LabVIEW. I collect all the critical data from the machine , convert it into a comma separated string and send it to ESP32 WiFi module. This module then posts the data to a website via the clients router.
Since LabVIEW is quite capable of handling TCP packets, I thought why not completely eliminate the ESP32 module and directly post from LabVIEW. To help understand what I need to post the relevant code in "C" is given below which runs on the ESP32 module.
Question is how to do this in LabVIEW. ( I searched the examples and located a E-Mail sending VI … it did not work anyway )
void postMachineData () { HTTPClient http; //Declare object of class HTTPClient http.begin("http://abcdefgh.com/datacoll.php"); //Specify request destination http.addHeader("Content-Type", "application/x-www-form-urlencoded" ); //Specify content-type header int httpCode = http.POST(postData); //Send the request String payload = http.getString(); //Get the response payload Serial.println(httpCode); //Print HTTP return code http.end(); //Close connection }
Solved! Go to Solution.
10-05-2019 10:32 AM - edited 10-05-2019 10:37 AM
It sounds like you need to use the HTTP Client VIs.
They include VIs that can manipulate headers and set data payloads, along with POSTing requests.
I suspect something similar to the following might get you most of the way (with necessary changes to the data payload)
10-05-2019 12:10 PM
@cbutcher
Thanks. The exact bunch of VIs that I was looking for ( but did not look hard enough ;-))
Shall try and revert back.