This is an old revision of the document!
Javascript Live Data API
Location
The Javascript API files are actually included in the ARDI installation - they are located in /plugins/optrix/ardiclient.js.
Usage
The ARDI client class is called ARDIHMI.
Below is an example of using the API….
var connection = new ARDIHMI();
//Subscribe Each Dynamic Property
connection.Subscribe("20:22:measurement",function (val) {
val = parseFloat(val).toFixed(2) + " Deg C";
$('#measurement_20_22').html(val);
});
connection.ConnectTo("myservername");
Functions
The steps required to get live data are…
1) Create the ARDIHMI object.
2) Call the Subscribe function with both the name of the data point and the callback function that is called every time a change is detected.
3) Connect to your ARDI server with the ConnectTo function.