HTTP GET fromLabVIEW

I am completely new to Spark, but experienced at LabVIEW. I have an example app on my core that updates a variable called readBMP with data from a temperature sensor.

I can read the temperature by pointing my web browser at:

https://api.spark.io/v1/devices/CoreID/readBMP?access_token=Token

but I would like to be able to interrogate the sensor data remotely using LabVIEW.

Has anyone got an example of how to do this? I assume the GET.vi in LabVIEWHTTPClient.Lib is the vi to use, but I don’t know how to use it. Can someone help?

Thanks

Ben

Take a read at this:
http://zone.ni.com/reference/en-XX/help/371361H-01/lvcomm/http_client_get/

Sorry i did not install my Labview on laptop and can’t help test and give a working example

Output file: Leave blank, unless you want to save the data you called

Client Handle: Leave blank since only Spark Cloud API is used and not mixed with other services

URL: https://api.spark.io/v1/devices/CoreID/readBMP?access_token=Token

Error in: empty as well

Headers & Body is the 2 things you want to display for a start on the UI

Give it a try! :smiley:

1 Like

Actually, I’ve got it working now. Apparently someone at work had switched off my core, and I’m working from home. It works now. Just need to wire the URL to the GET.vi and it returns the data in the Body output. Just need to parse it now.

Ben

2 Likes

I made a LabVIEW API for Particle/Spark, and have just got around to cleaning up and posting. Hopefully it will save others some time when communicating with Cores/Photons/Electrons.

Let me know if you have any feedback on it.
Thanks!

I have had success using the LabView GET.vi and POST.vi blocks e.g. to give a LabView interface with the Tinker code.
To read an analog input just build a string into the URL terminal:https://api.spark.io/v1/devices/deviceID/analogread/?access_token=access_token
Then build a string input into the ‘data’ terminal:
analogread=A0
The search for the return-value in the returned body to read the value.
The POST.vi can also be used to toggle digital ports.

Has anyone managed to get LabView to display a Published value?