Samples | I/O string.Empty, null); // Apply address parameters from AddressInfo node string xml = string.Format( " {0} ", xmlAddress.OuterXml); device.ConsumeXml(xml); devices.Add(device); } // Scan boxes/terminals for each found device foreach (ITcSmTreeItem device in devices) { string xml = " 1 "; try { device.ConsumeXml(xml); } catch (Exception ex) { Console.WriteLine("Warning:
{0}", ex.Message); } foreach (ITcSmTreeItem box in device) { Console.WriteLine(box.Name); } } PowerShell sample $ioDevicesItem = $systemManager.LookupTreeItem("TIID") # ProduceXml(false) triggers an implicit ScanDevices and returns found devices $scannedXml = $ioDevicesItem.ProduceXml($false) [xml]$xmlDoc = $scannedXml $xmlDeviceList = $xmlDoc.SelectNodes("TreeItem/DeviceGrpDef/FoundDevices/Device") $devices = @() $deviceCount = 0 foreach ($node in $xmlDeviceList) { $itemSubType = [int]$node.SelectSingleNode("ItemSubType").InnerText $xmlAddress = $node.SelectSingleNode("AddressInfo") $deviceCount++ # Create device in I/O configuration $device = $ioDevicesItem.CreateChild("Device_$deviceCount", $itemSubType, "", $null) # Apply address parameters from AddressInfo node $xml = " $($xmlAddress.OuterXml) " $device.ConsumeXml($xml) $devices += $device } # Scan boxes/terminals for each found device foreach ($device in $devices) { try { $device.ConsumeXml(" 1 ") } catch { Write-Warning $_.Exception.Message } } Special feature of CX/K-bus devices for the CX9020 and KL terminals For CX controllers with a K-bus interface, an explicit ReloadDevices must be called on the I/O node before the box scan.
Without this step, ScanBoxes will not return any results for these devices. Calling ReloadDevices forces the driver to rescan the connected hardware. TE1000 248 Version: 1.7.0