ITcSysManager::LinkVariables
The LinkVariables() method links two variables specified by their path names. The syntax of the path names must match the syntax described in LookupTreeItem. The method checks whether both items exist, are of the Variable type, and have compatible data types/sizes, and then sets the Mapping Modified flag.
Signature
HRESULT LinkVariables(BSTR bstrV1, BSTR bstrV2, long offs1, long offs2, long size);
Parameter
|
Name |
Type |
Description |
|---|---|---|
|
bstrV1 |
BSTR |
[in] Path name of the first variable. The full path name is required; each branch must be separated by a caret ( |
|
bstrV2 |
BSTR |
[in] Path name of the second variable. The syntax is the same as for |
|
offs1 |
long |
[in, defaultvalue(0)] Bit offset of the first variable (used when the variables are of different sizes or only part of them is to be linked). |
|
offs2 |
long |
[in, defaultvalue(0)] Bit offset of the second variable. |
|
size |
long |
[in, defaultvalue(0)] Number of bits to be linked. If set to |
Return value
|
Name |
Type |
Description |
|---|---|---|
|
(HRESULT) |
HRESULT |
|
Error codes
-
TSM_E_ITEMNOTFOUND: One of the path names could not be resolved. -
TSM_E_INVALIDITEMTYPE: A referenced item is not a variable. -
TSM_E_MISMATCHINGITEMS: The variables are not compatible with each other (type/size). -
E_ACCESSDENIED: System Manager is disabled.
See also
- LookupTreeItem: path name syntax
- UnlinkVariables: Remove an existing link