DIY LabVIEW Crew Documents

Showing results for 
Search instead for 
Did you mean: 

Example - How to connect your LabVIEW app to Pachube

What is Pachube?


Pachube is a web service available at that enables you to connect, tag and share real time sensor data from objects, devices, buildings and environments around the world.

The key aim is to facilitate interaction between remote environments, both physical and virtual. Apart from enabling direct connections between any two environments, it can also be used to facilitate many-to-many connections: just like a physical "patch bay" (or telephone switchboard) Pachube enables any participating project to "plug-in" to any other participating project in real time so that, for example, buildings, interactive installations or blogs can "talk" and "respond" to each other.

Pachube is a little like YouTube, except that, rather than sharing videos, Pachube enables people to monitor and share real time environmental data from sensors that are connected to the internet. Pachube acts between environments, able both to capture input data (from remote sensors) and serve output data (to remote actuators). Connections can be made between any two environments, facilitating even spontaneous or previously unplanned connections. Apart from being used in physical environments, it also enables people to embed this data in web-pages, in effect to "blog" sensor data.


Once I had created my Home Energy Monitor app in LabVIEW - I started experimenting with ways of making the data accessible. The built in web server is one way - but I am very wary about letting anyone know the URL!

Then I found Pachube. So my app now logs to a Pachube feed and I can log on and view a history of power and temperature (that's all for now) via the web. But that data is also available to anyone. Say for example a university researcher wants to get some idea of daily energy usage across a range of locations. He can access the Pachube community to do this. And because the data is tagged using EEML ... well power is power regardless of how it gets up there (from my LV app, from other apps written in PHP, from apps written for an Arduino board)

Functional Description

The main vi's have some useful information in their descriptions

Pachube Update - takes data in CSV or EEMl and updates a Pachube feed (* requires API key)

build - builds a simple EEML string for power and temperature (just to show you how)

Pachube Get - retrieves live data in CSV or EEML from a Pachube feed (* requires API key)

Pachube Get Feed - retrieves a 24 hour history of a single datastream from a Pachube feed. Data is at 15 min intervals giving 96 values

Example - Get Pachube - uses the vi above to retrieve history and display it on a graph - default values retrieve the power history from my feed.

How to get started

A quick summary of how to get started with the VIs and Pachube. A good resource for getting started with Pachube itself is

1. Signup with Pachube and request an API key ( ie password)

2. Create a feed - follow the instructions on

     You will need a manual feed (ie you post data to Pachube rather than providing a web service for Pachube to pull data from you)

     You can create datastreams (ie channels with units etc) now  - this is necessary if you are going to use simple CSV to update the feed but if you decide to use EEML (read about this here this will overwrite this info

3. Once the feed is created you will get a feed id - the one for my home energy monitor is 1564

4. You can then use Pachube Update to update the feed. You will need to wire in your API key, feed id and the data.

5. If you are going to use EEML then the feed id will end with .xml (eg 1564.xml). You can also use simple CSV in which case the feed id will end with .csv (eg 1564.csv)

6. If using EEML then you will need to format your string data as EEML - look at build for a simple example. If using CSV then you would use the built in LabVIEW function Format into String to create a comma seperated list (eg for two datastreams it would look like this "1.234,5.678" [without the quote marks])

Caveats and Additional Notes

The Pachube service is still in beta and your will need to request access and an API key to use the service - especially if you want to create and update a feed yourself.

I have kept the vi's based on core LabVIEW - using only TCP/IP and string handling - even where XML is involved. This should mean that they are pretty much platform agnostic (Windows, Linux, Mac, RT, ARM, Blackfin, Microprocessor SDK, even the Student Edition) but I haven't tested on anything other than Windows (yet).

If you test the vi's on other platforms - please add to this document to let the community know.


Thanks to Anders for downloading - and trying the vi's within an hour of me posting and for letting me know about the missing vi. This is now corrected.

10th April 2009 - Library now briefly tested and working on Linux - specifically with LabVIEW 8.6.1 on Ubuntu 8.10 (note - Ubuntu is not an officially supported Linux distro for LabVIEW - but you can get it working if you know what you're doing - or you are good at searching the forums like me!)

10th April 2009 - added library built for LabVIEW 8.0 - 8.5

16th July 2009 - added some brief "How to get started" instructions

16th May 2011 - Pachube has released a new API, please see the Pachube v2 API documentation at Updated the POST and GET methods to reflect the new capabilities and syntax.


Great stuff. About 2 years ago I had a similar idea to Pachube (at that time I didn't know that it existed) for the European Satellite navigation Competition - basically a combination of measurements (noise, air quality, anything) with GPS data and synchronized time presented as heat map or in similar format to LabVIEW is perfect to for such application.

NI Employee (retired)

Thanks asper for the API V2 update. I have been meaning to take a look at the new API and do a new version - and now I don't have too. Aaah the power of a community!