API Return Values 6.1.8 ITcSysManager::UnlinkVariables The UnlinkVariables() method unlinks two variables, which are specified by their names, or clears all links from the first variable if the name bstrV2 of the second variable is empty. The two variables represented by their tree path name will be unlinked. The path names must have the same syntax as described in ITcSysManager::LookupTreeItem [ } 35] . The same shortcuts [ } 35] can be used. HRESULT UnlinkVariables(BSTRbstrV1, BSTRbstrV2); Parameters Return Values Comments If bstrV2 is an empty string, the function clears all links of variable given by bstrV1 .
If bstrV2 is not empty only an existing link between both variables will be deleted. 6.1.9 ITcSysManager2::GetTargetNetId The GetTargetNetId() method returns the NetId of the current TwinCAT system. HRESULT GetTargetNetId(); Parameters None Automation Interface 34 Version: 1.2 size [in, defaultvalue(0)] bit count how many bits should linked. If size is 0 the minimum of the variable size of variable one and two is used. S OK _ function returns successfully. TSM E ITEMNOTFOUND _ _ (0x98510001) one or both path name(s) does not qualify an existing tree item. TSM E INVALIDITEMTYPE _ _ (0x98510002) one or both tree item(s) is not a variable.
TSM E MISMATCHINGITEMS _ _ (0x98510004) the two variables cannot link together. Maybe you have tried to link an output of one task with an output of another task or an output of a task with an input of a device or to variables of the same owner. E INVALIDARG _ the values of offs1, offs2 and/or size does not fit to the variables. bstrV1 [in] path name of the first variable. The full path name is required and each branch must be separated by a circumflex accent '^' or a tab. bstrV2 [in, defaultvalue(L"")] path name of the second variable. If set the full path name is required and each branch must be separated by a circumflex accent '^' or a tab. S OK _ function returns successfully.
S FALSE _ the two variables have no link between them. TSM E ITEMNOTFOUND _ _ (0x98510001) one or both of the path name(s) does not qualify an existing tree item. TSM E INVALIDITEMTYPE _ _ (0x98510002) one or both of the tree item(s) is not a variable. TSM E CORRUPTEDLINK _ _ (0x98510005) the two variables cannot unlinked.