LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Posting data to a Website using LV

Solved!
Go to solution

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
}
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 3
(2,350 Views)
Solution
Accepted by topic author MogaRaghu

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)

Example_VI_BD.png


GCentral
Message 2 of 3
(2,323 Views)

@cbutcher

 

Thanks. The exact bunch of VIs that I was looking for ( but did not look hard enough ;-))

 

Shall try and revert back.

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 3
(2,294 Views)