mcNewAsset()

Makes a MindSphereAsset available in the CtrlMindConnect Ctrl Extension for further operations.

Synopsis

int mcNewAsset(mapping assetData, uint &assetId);

Parameters

Parameter Description
assetData

This parameter contains all the Information that is stored in the MindSphere Asset (WinCC OA-)Data point and its connected MindSphere Data sources and MindSphere Data points.

This mapping can and should be created by calling the getMappingFromAssetDP function defined in wincc_oa_path/scripts/libs/classes/mindSphere/MindSphereAsset.ctl

assetId Contains the assigned Id for the new MindSphere Asset. This Id must be provided for further operations with this MindSphere Asset. If the function fails, the assetId is set to maxUINT().

Return value

The function mcNewAsset returns 0 when it was successfully executed and -1 when arguments are missing.

Error

The function mcNewAsset returns 0 when it was successfully executed and -1 when arguments are missing. The errors of the MindSphere API are shown in the log viewer.

Description

Makes a MindSphereAsset available in the CtrlMindConnect Ctrl Extension for further operations.

#uses "CtrlMindConnect"
#uses "classes/mindSphere/MindSphereAsset"

void main() 
{
   string dp = "NameOfMindSphereAsset"; // This MindSphere Asset must already exist
   uint assetId;
   int err = mcNewAsset(getMappingFromAssetDP(dp), assetId);
   DebugTN(err, assetId);
}

Assignment

MindSphere

Availability

UI