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:
al registerGet the station id:
al infoFor 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:
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 idmetric namevalueunitmetric type, for examplefloatserial, optionalurl, defaulthttp://127.0.0.1:5700/error in
Suggested outputs:
status coderesponse bodyerror out
POST the Autumn Labs envelope
In the block diagram:
- Build the compact metric JSON.
- Put that JSON string into the envelope
messagefield. - Serialize the envelope JSON.
- Use LabVIEW HTTP Client VIs to POST it to
http://127.0.0.1:5700/. - Wire LabVIEW error clusters through every node.
Envelope Format
Every request body is one JSON envelope:
{
"file": "metrics",
"message": "{\"sid\":\"...\"}",
"source_type": "sdk",
"station_id": "..."
}Fields:
file: one ofmetrics,logs,units,states, orassets.message: JSON string containing the compact event payload.source_type: alwayssdk.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:
{
"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:
{
"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:
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.
Recommended Station Flow
- Send station state
running. - Send unit in for serial
SN123. - Send metric
voltage = 3.31 V. - Send log
Voltage measurement recorded. - Send unit out with result
passed. - Send station state
idle.
Push a Log
Compact log payload:
{
"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:
{
"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:
{
"sid": "STATION_ID",
"slt": "",
"ser": "SN123",
"utc": 1714412345678901,
"loc": "GMT-07:00",
"mod": "",
"tag": [],
"typ": "",
"dir": "input",
"res": "",
"met": null
}Unit out compact payload:
{
"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:
{
"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
messageis a JSON string, not a nested object. - Confirm
station_idand payloadsidmatch. - Start with one metric, then add logs, unit events, and station state.