SDK

LabVIEW

Push LabVIEW station data to Autumn Labs with direct HTTP POST

LabVIEW stations can push data directly to the local Autumn Labs Vector HTTP source installed with the station client. You do not need a Python bridge, C# bridge, DLL, or separate service.

Use this path when you want to integrate an existing LabVIEW station quickly. A packaged LabVIEW palette may come later, but it is not required to send metrics, logs, unit events, or station state.

Prerequisites

  • Autumn Labs station client installed on the station PC.
  • Station registered with al register.
  • LabVIEW with the built-in HTTP Client VIs.
  • Optional: JSONtext or another maintained JSON library for safer JSON construction.

Quick Start

Register the station

Install the Autumn Labs station client, then register the station:

bash
al register

Get the station id:

bash
al info

For a pilot, copy the station id into a LabVIEW string control. For production, read it from ~/.autumnlabs/config/al.json.

Verify the local endpoint

Autumn Labs listens locally at:

text
http://127.0.0.1:5700/

LabVIEW will send HTTP POST requests to this URL with Content-Type: application/json.

Build a reusable push subVI

Create a LabVIEW subVI named Autumn Push Metric.vi.

Suggested inputs:

  • station id
  • metric name
  • value
  • unit
  • metric type, for example float
  • serial, optional
  • url, default http://127.0.0.1:5700/
  • error in

Suggested outputs:

  • status code
  • response body
  • error out

POST the Autumn Labs envelope

In the block diagram:

  1. Build the compact metric JSON.
  2. Put that JSON string into the envelope message field.
  3. Serialize the envelope JSON.
  4. Use LabVIEW HTTP Client VIs to POST it to http://127.0.0.1:5700/.
  5. Wire LabVIEW error clusters through every node.

Envelope Format

Every request body is one JSON envelope:

json
{
  "file": "metrics",
  "message": "{\"sid\":\"...\"}",
  "source_type": "sdk",
  "station_id": "..."
}

Fields:

  • file: one of metrics, logs, units, states, or assets.
  • message: JSON string containing the compact event payload.
  • source_type: always sdk.
  • station_id: registered Autumn Labs station id.

The important detail is that message is a string, not a nested JSON object.

Push a Metric

Compact metric payload:

json
{
  "sid": "STATION_ID",
  "slt": "",
  "ser": "SN123",
  "utc": 1714412345678901,
  "loc": "GMT-07:00",
  "mod": "",
  "tag": [],
  "nam": "voltage",
  "res": "",
  "rea": "",
  "met": {
    "value": 3.31,
    "unit": "V",
    "type": "float"
  },
  "lim": {
    "upper": null,
    "lower": null
  }
}

Envelope request body:

json
{
  "file": "metrics",
  "message": "{\"sid\":\"STATION_ID\",\"slt\":\"\",\"ser\":\"SN123\",\"utc\":1714412345678901,\"loc\":\"GMT-07:00\",\"mod\":\"\",\"tag\":[],\"nam\":\"voltage\",\"res\":\"\",\"rea\":\"\",\"met\":{\"value\":3.31,\"unit\":\"V\",\"type\":\"float\"},\"lim\":{\"upper\":null,\"lower\":null}}",
  "source_type": "sdk",
  "station_id": "STATION_ID"
}

Test with curl

Before wiring LabVIEW, verify the station accepts an event:

bash
curl -X POST http://127.0.0.1:5700/ \
  -H "Content-Type: application/json" \
  -d '{"file":"metrics","message":"{\"sid\":\"STATION_ID\",\"slt\":\"\",\"ser\":\"SN123\",\"utc\":1714412345678901,\"loc\":\"GMT-07:00\",\"mod\":\"\",\"tag\":[],\"nam\":\"voltage\",\"res\":\"\",\"rea\":\"\",\"met\":{\"value\":3.31,\"unit\":\"V\",\"type\":\"float\"},\"lim\":{\"upper\":null,\"lower\":null}}","source_type":"sdk","station_id":"STATION_ID"}'

Replace STATION_ID with the registered station id from al info.

  1. Send station state running.
  2. Send unit in for serial SN123.
  3. Send metric voltage = 3.31 V.
  4. Send log Voltage measurement recorded.
  5. Send unit out with result passed.
  6. Send station state idle.

Push a Log

Compact log payload:

json
{
  "sid": "STATION_ID",
  "slt": "",
  "ser": "SN123",
  "utc": 1714412345678901,
  "loc": "GMT-07:00",
  "mod": "",
  "tag": [],
  "nam": "test.step",
  "log": "Voltage measurement recorded",
  "lvl": "info"
}

Send with:

json
{
  "file": "logs",
  "message": "{\"sid\":\"STATION_ID\",\"slt\":\"\",\"ser\":\"SN123\",\"utc\":1714412345678901,\"loc\":\"GMT-07:00\",\"mod\":\"\",\"tag\":[],\"nam\":\"test.step\",\"log\":\"Voltage measurement recorded\",\"lvl\":\"info\"}",
  "source_type": "sdk",
  "station_id": "STATION_ID"
}

Track Units

Unit in compact payload:

json
{
  "sid": "STATION_ID",
  "slt": "",
  "ser": "SN123",
  "utc": 1714412345678901,
  "loc": "GMT-07:00",
  "mod": "",
  "tag": [],
  "typ": "",
  "dir": "input",
  "res": "",
  "met": null
}

Unit out compact payload:

json
{
  "sid": "STATION_ID",
  "slt": "",
  "ser": "SN123",
  "utc": 1714412345678901,
  "loc": "GMT-07:00",
  "mod": "",
  "tag": [],
  "typ": "",
  "dir": "output",
  "res": "passed",
  "met": {}
}

Send both with file = "units".

Set Station State

Compact state payload:

json
{
  "sid": "STATION_ID",
  "slt": "",
  "ser": "",
  "utc": 1714412345678901,
  "loc": "GMT-07:00",
  "mod": "",
  "tag": [],
  "nam": "running",
  "dsc": "Test sequence started"
}

Send with file = "states".

Troubleshooting

  • Confirm the station client is running.
  • Confirm the station was registered with al register.
  • Confirm the URL is exactly http://127.0.0.1:5700/.
  • Confirm the HTTP header is Content-Type: application/json.
  • Confirm message is a JSON string, not a nested object.
  • Confirm station_id and payload sid match.
  • Start with one metric, then add logs, unit events, and station state.

On this page