Who doesn't love LabVIEW? it's nice visual programming language makes it easy to solve complex engineering problems fast.

In this tutorial we’ll explain:

  1. How to send values from LabVIEW.
  2. How to read values from LabVIEW

Sending Values

We'll use a Sine wave simulator in LabVIEW and then send its data to Ubidots by making an HTTP Post request to this URL:

https://things.ubidots.com/api/v1.6/devices/{DEVICE_LABEL}/?token={YOUR-TOKEN}

In this case, the device label will be "labview", so the data will appear in Ubidots under a device named "labview":

You can change the name, but not the API label, since it is the unique ID used to identify the device in your account. Here's the source code image:

This is how the interface looks like:

Here's a link to the VI file. Finally, we can build a nice Ubidots dashboard with the incoming data:

Getting Values from Ubidots

This example will  read the last value of a Ubidots variable using this endpoint URL: 

https://things.ubidots.com/api/v1.6/devices/{DEVICE_LABEL}/{VARIABLE_LABEL}/values?page_size=1&token={YOUR-TOKEN}

Where:

  • Device Label: The unique identifier of the device in your Ubidots account that contains the variable you wish to read. In our case "labview".
  • Variable Label: The unique identifier of the variable within the device. In our case "signal".

So our URL to make the GET request is:

https://things.ubidots.com/api/v1.6/devices/labview/signal/values?page_size=1&token={YOUR-TOKEN}

Here's the source code image:

This is the actual interface:

You can find our GET Vi project here. This animation shows the successful reading of a Ubidots value inside LabVIEW. In this case, we're using a control widget to send a value to the "signal" variable, which is then read by LabVIEW to update the Gauge in our VI. 

Hope you enjoy these examples!

Did this answer your question?