ITcSysManager::LinkVariables

The LinkVariables() method links two variables, which are specified by their names. The two variables represented by their tree path name will be linked. The path names must have the same syntax as described in ITcSysManager::LookupTreeItem. The same shortcuts can be used.

HRESULT LinkVariables(BSTRbstrV1, BSTRbstrV2, longoffs1, longoffs2, longsize); 

Parameters

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] path name of the second variable. The full path name is required and each branch must be separated by a circumflex accent '^' or a tab.

offs1

[in, defaultvalue(0)] bit offset of the first variable (used if the two variables have different sizes or not the whole variable should be linked).

offs2

[in, defaultvalue(0)] bit offset of the second variable.

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.

Return Values

S_OK

function returns successfully.

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_MISMATCHINGITEMS (0x98510004)

the two variables cannot linked together. May be 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.