Use the systemLinkUtilization data type to log utilization data for assets in SystemLink.

Use one of the following options to initiate the instance.

  • systemLinkUtilization myUtil = sys:systemLink:createUtilization(jsonValue assetIdentifications, text utilizationCategory, text taskName, (opt.)text userName)
  • [systemLinkUtilization myUtil, systemLink:createUtilization status] = sys:systemLink:createUtilization(jsonValue assetIdentifications, text utilizationCategory, text taskName, (opt.)text userName)

Example: SystemLink Utilization

programm
        ...
        systemLinkUtilization myUtil
        systemLinkUtilization:start startStatus
        systemLinkUtilization:stop stopStatus
        systemLinkUtilization:status statusStatus

        // building assetIdentifications
        jsonObject Obj
        jsonArray Array
        jsonValue modelName("NI PXIe-8881")
        jsonValue modelNumber(123)
        jsonValue serialNumber("329B353")
        jsonValue vendorName("National Instruments")
        jsonValue vendorNumber(4244)
        jsonValue busType("BUILT_IN_SYSTEM")
        Obj:addOrSetValue("modelName",modelName)
        Obj:addOrSetValue("modelNumber",modelNumber)
        Obj:addOrSetValue("serialNumber",serialNumber)
        Obj:addOrSetValue("vendorName",vendorName)
        Obj:addOrSetValue("vendorNumber",vendorNumber)
        Obj:addOrSetValue("busType",busType)
        jsonValue assetIdentificationsValue(Obj)
        Array:addValue(assetIdentificationsValue)
        jsonValue assetIdentifications(Array)

        // create utilization
        myUtil = sys:systemLink:createUtilization(assetIdentifications, "category", "taskname", "username")

        startStatus = myUtil:start()
        statusStatus = myUtil:status()
        stopStatus = myUtil:stop()
        ...
endprogram

JSON String for SystemLink Utilization

The assetIdentifications variable defines a JSON string. The JSON string identifies the SystemLink asset to which the utilization is added.

Example: JSON String

       {
          "modelName": "NI PXIe-6368",
          "modelNumber": 123,
          "serialNumber": "01BB877A",
          "vendorName": "NI",
          "vendorNumber": 4244,
          "busType": "BUILT_IN_SYSTEM"
       }

Keys for SystemLink Utilization

Use keys to identify the asset in the workspace. The following keys are optional.

Table 53. Optional Keys
Key Description
text utilizationCategory Freely definable utilization category
text taskName Freely definable utilization task name
text userName Optional variable to define a user name for the utilization

Example: SystemLink Utilization Keys

program
	...
	systemLinkUtilization myUtil

	// building assetIdentifications
	jsonObject Obj
	jsonArray Array
	jsonValue modelName("NI PXIe-8881")
	jsonValue modelNumber(123)
	jsonValue serialNumber("329B353")
	jsonValue vendorName("National Instruments")
	jsonValue vendorNumber(4244)
	jsonValue busType("BUILT_IN_SYSTEM")
	Obj:addOrSetValue("modelName",modelName)
	Obj:addOrSetValue("modelNumber",modelNumber)
	Obj:addOrSetValue("serialNumber",serialNumber)
	Obj:addOrSetValue("vendorName",vendorName)
	Obj:addOrSetValue("vendorNumber",vendorNumber)
	Obj:addOrSetValue("busType",busType)
	jsonValue assetIdentificationsValue(Obj)
	Array:addValue(assetIdentificationsValue)
	jsonValue assetIdentifications(Array)
	
	// create utilization
	myUtil = sys:systemLink:createUtilization(assetIdentifications, "category", "taskname", "username")
	...
endprogram