Beckhoff Automation GmbH & Co. KG — 8.6 How to change the fieldbus address (station no.) of a profibus box

How to 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 LookupTreeItem [ } 35] method that returns a ITcSmTreeItem [ } 37] pointer to a specific tree item given by its pathname. To change the path to a plc project and rescan the project " TIPC^MyProject " the following vbscript code can be used: Sample (vbscript):

dim tsm dim item set tsm = CreateObject("TCatSysManager.TcSysManager") call tsm.OpenConfiguration("c:\twincat\myConfig.wsm") set item = tsm.LookupTreeItem("TIPC^MyProject") call item.ConsumeXml(" c:\twincat\plc\NewProject.pro ProjectPath> 1 ") call tsm.SaveConfiguration The next sample just rescans the current project: dim tsm dim item set tsm = CreateObject("TCatSysManager.TcSysManager") call tsm.OpenConfiguration("c:\twincat\myConfig.wsm") set item = tsm.LookupTreeItem("TIPC^MyProject") call item.ConsumeXml(" 1 ") call tsm.SaveConfiguration See Also How to...

section [ } 69] , ITcSysManager [ } 30] , LookupTreeItem [ } 35] , ITcSmTreeItem [ } 37] , ConsumeXml [ } 61] Built on Tuesday, Mai 01, 2001 8.6 How to change the fieldbus address (station no.) of a profibus box Requirements To change the the fieldbus address (station no.) of a profibus box in a configuration, an instance of the TwinCAT System Manager must be created, and the configuration has to be opened. The LookupTreeItem [ } 35] method of the ITcSysManager [ } 30] interface returns a ITcSmTreeItem [ } 37] interface pointer implemented by the tree item referenced by its pathname. This interface contains a ConsumeXml [ } 61] method of the tree item.

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 LookupTreeItem [ } 35] method that returns a ITcSmTreeItem [ } 37] pointer to a specific tree item given by its pathname. To change the the fieldbus address (station no.) of a profibus box " TIID^Device 1 (FC310x)^Box 1 (BK3100) " to 44 the following vbscript code can be used: Sample (vbscript):

dim tsm dim item set tsm = CreateObject("TCatSysManager.TcSysManager") call tsm.OpenConfiguration("c:\twincat\myConfig.wsm") set item = tsm.LookupTreeItem("TIID^Device 1 (FC310x)^Box 1(BK3100)") Automation Interface 72 Version: 1.2