Configuring the PROFIBUS system

PROFIBUS masters and slaves are created under the I/O node using CreateChild. The SubType identifies the specific device. SubTypes 86 and 97 apply to the EtherCAT-based PROFIBUS cards EL6731 and EL6731-0010, respectively. After the device has been created, the desired hardware resource is selected using ClaimResources. ClaimResources assigns the physical adapter on which the fieldbus operates to the device.

Requirements

C# sample

The master and slave are created under the I/O node TIID with CreateChild. ResourcesCount then returns the number of hardware resources found. The ClaimResources statement assigns a specific resource to the device.

ITcSmTreeItem devices = sysManager.LookupTreeItem("TIID");

// Create Profibus master (SubType 86 = EL6731)
ITcSmTreeItem profiMaster = devices.CreateChild("Profibus Master (EL6731)", 86, "", null);

// Check available resources and claim hardware resource
Console.WriteLine("Available masters: " + profiMaster.ResourcesCount);
profiMaster.ClaimResources(1);  // Index 1 = first available resource

// Create Profibus slave (SubType 97 = EL6731-0010)
ITcSmTreeItem profiSlave = devices.CreateChild("Profibus Slave (EL6731-0010)", 97, "", null);
Console.WriteLine("Available slaves: " + profiSlave.ResourcesCount);
profiSlave.ClaimResources(1);

PowerShell sample

$devices = $sysManager.LookupTreeItem("TIID")

# Create Profibus master (SubType 86 = EL6731)
$profiMaster = $devices.CreateChild("Profibus Master (EL6731)", 86, "")
Write-Host "Available masters: $($profiMaster.ResourcesCount)"
$profiMaster.ClaimResources(1)  # Index 1 = first available resource

# Create Profibus slave (SubType 97 = EL6731-0010)
$profiSlave = $devices.CreateChild("Profibus Slave (EL6731-0010)", 97, "")
Write-Host "Available slaves: $($profiSlave.ResourcesCount)"
$profiSlave.ClaimResources(1)
Configuring the PROFIBUS system 1:

The index of ClaimResources starts at 1. Different SubType values apply to other PROFIBUS cards, such as the FC310x series. These are listed in the Automation Interface documentation under “Device SubTypes”.

Changing the fieldbus address

The fieldbus address of a PROFIBUS box is its station number on the bus. It is modified by calling ConsumeXml with the desired number as the value.

C#:

ITcSmTreeItem item = sysMan.LookupTreeItem("TIID^Device 1 (FC310x)^Box 1 (BK3100)");
item.ConsumeXml("44");

PowerShell:

$item = $sysMan.LookupTreeItem("TIID^Device 1 (FC310x)^Box 1 (BK3100)")
$item.ConsumeXml("44")