Data Transfer from the WinCC OA Process Image

Assign values to the Insights Hub Data Points via a CTRL script - see also chapter Example - Upload and View Values.

#uses "classes/mindSphere/MindSphereAsset"
main(mapping event)

{
    MindSphereAsset asset = MindSphereAsset("Connection_Asset");
    string dp1 = "Pump1_electrical_current";
    string dp2 = "Pump1_electrical_voltage";
    dyn_int values1 = makeDynInt(15, 12, 13);
    dyn_int values2 = makeDynInt(240, 220, 230);
    time now = getCurrentTime();
    dyn_time times = makeDynTime(now - 2, now - 1, now);
    int err1 = asset.prepareValues(dp1, values1, times);
    int err2 = asset.prepareValues(dp2, values2, times);
    int err = asset.uploadPreparedValues();
    DebugN("Values uploaded:", err);
}