Configuration On a physical controller, this functionality can also be called via Automation Interface and then returns an XML representation of all found I/O devices including their corresponding address information. When a TwinCAT configuration should be activated on the controller, the required address information needs to be set for all I/O devices that are part of the configuration. This can be done by calling the "Scan Devices" functionality via Automation Interface and setting the address information for the I/O devices in the configuration. This will be explained in more detail now.
Creating an offline configuration There are several articles which explain how to create an offline TwinCAT configuration. Please refer to our Product Description [ } 8] page to get an overview. Switching to an online configuration If you finally have created a TwinCAT configuration that should now be activated on the physical controller, the following steps need to be taken to ensure that all required address information is available before downloading the configuration: Step 1 [optional]: Connecting to the target device Step 2: Scanning the device for available I/Os Step 3: Iterating through XML and configuring address information of I/Os Step 4:
Activating the configuration Of course, you can also always create an online configuration directly by using the ScanDevices functionality. There is an own sample [ } 77] which shows you exactly how to do that. Step 1 [optional]: Connecting to the target device If the physical controller is not located on the same machine as the Automation Interface code runs on, you can use the ITcSysManager [ } 30] :: SetTargetNetId() [ } 35] method to connect to the remote device and then continue with the next steps. Step 2:
Scanning the device for available I/Os The "Scan Devices" functionality mentioned above can be triggered via Automation Interface by calling the ITcSmTreeItem::ProduceXml() method on the I/O devices node. Automation Interface 28 Version: 1.2