How to See Also How to... section [ } 69] , ITcSysManager [ } 30] Built on Tuesday, Mai 01, 2001 8.2 How to link variables Requirements To link variables in a configuration, an instance of the TwinCAT System Manager must be created, and the two variables must be referenced by their pathnames Procedure The ProgId " TCatSysManager.TcSysManager " can be used to create an instance of the System Manager that implements the ITcSysManager [ } 30] interface. This interface has a LinkVariables [ } 33] method. To link the two variables " TIPC^Project 1^Standard^Outputs^MyOutput " and " TIID^Device 1 (C220)^Box 1^Term 1^Channel 1^Output " the following vbscript code can be used: Sample (vbscript):
dim tsm set tsm = CreateObject("TCatSysManager.TcSysManager") call tsm.OpenConfiguration("c:\twincat\myConfig.wsm") call tsm.LinkVariables("TIPC^Project1^Standard^Outputs^MyOutput", "TIID^Device 1 (C220)^Box1^Term 1^ Channel 1^Output") call tsm.SaveConfiguration If the two variables have different sizes, the LinkVariables [ } 33] method has three further optional parameters to specify which bits and bytes are to be linked together. See Also How to...
section [ } 69] , ITcSysManager [ } 30] , ITcSysManager::LinkVariables [ } 33] Built on Tuesday, Mai 01, 2001 8.3 How to unlink variables Requirements To unlink variables in a configuration, an instance of the TwinCAT System Manager must be created and the two variables to be unlinked from each other must be referenced by their pathnames An alternative is to reference only to one variable and all linkages of that variable will be removed. Procedure The ProgId " TCatSysManager.TcSysManager " can be used to create an instance of the System Manager that implements the ITcSysManager [ } 30] interface. This interface has an UnlinkVariables [ } 34] method.
To unlink the variable "TIPC^Project 1^Standard^Outputs^MyOutput" from "TIID^Device 1 (C220)^Box 1^Term 1^Channel 1^Output" the following vbscript code can be used: Sample (vbscript): dim tsm set tsm = CreateObject("TCatSysManager.TcSysManager") call tsm.OpenConfiguration("c:\twincat\myConfig.wsm") call tsm.UnlinkVariables("TIPC^Project1^Standard^Outputs^MyOutput", "TIID^Device 1 (C220)^Box1^Term 1^Channel 1^Output") call tsm.SaveConfiguration Automation Interface 70 Version: 1.2