02/28/2023

PROFINET - ctrlX CORE plus X3 with IndraControl XM21

Β 

1. Overview

In this tutorial, it will be shown how to connect a IndraControl XM21 with a ctrlX CORE using PROFINET. To be able to connect to the XM21 through PROFINET, an RT-Ethernet extender will be used.Β 

In this case, the ctrlX CORE will act as PN device, and the XM21 will be the PROFINET controller (Master). The XM21 will contain a PLC program that will digitally simulate the inputs and outputs.

2. Prerequisites

3. ctrlX CORE configuration

1. First, ctrlX CORE will be connected to the Engineering computer and the ctrlX WORKS program will be started.

  • In ctrlX WORKS, check the recognised devices, and enter the ctrlX CORE web interface by clicking over the IP address

2. Install PROFINET device app. Download the app from thisΒ link

  • To perform this step, it is recommended to follow the instructions shown in the followingΒ article.
  • The app is installed. In the ctrlX CORE web interface the β€œSettings” menu is clicked -> Access β€œApps” -> Change to β€œService mode” because otherwise it will not be possible to install the app, and the β€œInstall from file” button is clicked. A new window will be opened where the previously downloaded file is selected.

3. Add PROFINET device:

  1. Access the PROFINET device app
  2. Check that the ctrlX CORE is in β€œService” mode (Otherwise it will give an error as shown in the figure)
  3. β€œAdd PROFINET device”

Error that appears in the case the PROFINET device is added in β€œOperating” mode

4. Add PROFINET device

5. Configure PROFINET device:

  1. Click the pencil button
  2. Select template (this has to be chosen in function of sent data from the connected device to the ctrlX CORE)
  3. Save configuration

6. Start the communication. 1. Change to β€œOperating” mode -> 2. Run PROFINET device app

Note: Before connecting both devices it is recommended to check that the ctrlX CORE IP address is of the same type as the XM22 device. In connectivity, change the eth1 to an IP address of a similar type.

4. IndraControl XM21 configuration

Note: It will be assumed that the user knows how to install the IndraWorks Engineering program

1. Connect the IndraControl XM21 to the Engineering computer using the Ethernet port located in the IndraControl XM21 (XF5) and plug it to the computer Ethernet port. Make sure to establish correctly the static IP address. Once done this, open the IndraWorks Engineering program and create a new project:

  1. Create a new project
  2. Select "empty project"
  3. Enter a project name
  4. Press "Ok"

2. Add device

  1. Right click over the project name
  2. Press "Add"
  3. Select "Add" again
  4. Choose the type of IndraControl (In this case we will use the IndraControl XM2 series)
  5. Double click over "IndraControl XM2"

  • Step 1: General Properties -> Introduce a device name and press "Next"

  • Step 2: Hardware/communication
  1. Select the Device release
  2. Select the communication type
  3. Introduce the XM2 IP address
  4. Select the PLC gateway
  5. Test the connection

  • Step 3: Extended settings. Keep everything as default

  • Step 4: Function packages. Only select "Programmable Logic Control"

  • Step 5: Interfaces
  1. Extensionmodule: In this case only the RT-Ethernet will be used
  2. sercos: Choose SercosIII Master
  3. Press "Finish" and wait until the configuration is performed

3. Set PROFINET device

  1. Right click over "Not_Used"
  2. Select "Set device"
  3. Select "PROFINET IO Controller XM"

  • Configure the device
  1. Double click over "PROFINET_IO_Controller_XM"
  2. Select the "General" tab
  3. Choose an IP address for the PN-Device
  4. Configure the IP address range

4. Add PN-Device description: To be able to scan and recognise the Profinet device or to add the PN-Device it is required to install the device description. In this case, the ctrlX CORE description is needed.

  • Press the followingΒ link and download the ctrlX CORE device description

  • Return to IndraWorks Engineering, Select "Tools" -> "Device database"

  • Press "Add devices"

  • Select the downloaded ctrlX CORE .xml file. Once finished, close the window.

5. Add PN-Device to the devices tree. There are two options to add the profinet device:

1. Scanning the device

NOTE: To be able to scan the devices, these requirements are necessary:

  • The ctrlX CORE must be connected to the IndraControl XM21.
  • The PROFINET Device app must be running. By pressing the "Run" button in the app it is enough to be able to recognize the ctrlX CORE.Β 

Once, these requirements have been checked, it is possible to scan the ctrlX CORE from the IndraControl XM21. If it does not work, follow the steps by adding the device manually

  1. Right click over "PROFINET_IO_Controller_XM"
  2. Select "Scan for devices"

3Β  Copy the device to the project

As in this "How-To" the ctrlX CORE has been configured with an "in_128_out_128" template, this is the result of the scan.

Reminder: The template can be selected in the configuration menu in the PROFINET Device app in the ctrlX CORE web interface

Troubleshooting:

In the case an error similar to the shown in the following image appears, some additional steps are required to do.

  • In the case, no Station name appears, it is necessary to write one name
  • An IP address that is in the same subnet as previously configured is necessary to configure. In this case, the 192.168.10.2 IP address will be written
  • For the Subnet Mask the 255.255.255.0 address will be configured

  1. Select the device description
  2. Press "Set Name and IP"

  1. Once the button has been pressed, the error should disappear and the device description will appear. As it can be seen, the 128bit output and input that was previously configured in the PROFINET Device app, appears
  2. Press "Copy All Devices to project" to add them to the project
  3. Close the window

2. Adding the device manually

  1. Right click over "PROFINET_IO_Controller_XM"
  2. Select "Add"
  3. Select "Add" again

  1. Select the PLC section
  2. Double click over ctrlX CORE
  3. Close the window

  • Set up the inputs and outputs

1. Extend the ctrlX CORE tree and start the configuration

  • Add output: Right click over "producer" -> "Set device" -> Select "module_out"

  • Add input:Β Right click over "consumer" -> "Set device" -> Select "module_in"

2. Choose the type of variable

  • Right click over "module_out" -> "Add" -> "Add"

  • Double click over "byte_128_out" and close the window

  • Right click over "module_in" -> "Add" -> "Add"

  • Double click over "byte_128_in"

  • Check the ctrlX CORE IP address and define a station name

6. Write a little program to write valuesΒ 

  • Global variables definition
  1. Double click over "UserVarGlobal"
  2. Define the variables

Β 

  • Local variables definition and PLC program

The PLC program is the following:

// Counter 
byCounter := byCounter + 1;

// Array element 0..3
FOR iIdx:=0 TO 3 BY 1 DO
// Copy the input bytes to the output bytes
UserVarGlobal.byArray_0_q[iIdx] := UserVarGlobal.byArray_0_i[iIdx];
END_FOR

// array element 4..7
FOR iIdx:=4 TO 7 BY 1 DO
// Fill the arrays with data
UserVarGlobal.byArray_0_q[iIdx] := byCounter + iIdx;
END_FOR

7. Map the variables

  • First, the ouput variable will be mapped
  1. Double click over "byte_128_out"
  2. Select the I/O Mapping tab
  3. Expand the tree
  4. Write the variable desired to map. In this case it will be the "byarray_0_q" in the position 4Β 

Note: To find easier the variable, double click over the black space and select the variable

  • The same steps are followed for the input variable:
  1. Double click over "byte_128_in"
  2. Select the I/O Mapping tab
  3. Expand the tree
  4. Write the variable desired to map. In this case it will be the "byarray_0_i" in the position 4Β 



5. Testing

1. Login and run the PLC program

  • Click over the login button

  • Accept the message and follow the steps

  • Run the PLC program -> Accept the message

Note: In the case the PROFINET Device app is still not working in the ctrlX CORE, the warnings shown in the next image will appear:

  • Run the program in the ctrlX CORE, and check the tree again

If the PROFINET communication is working properly, in the PROFINET Device app the "OP" state should be visible

  • Check received values in the Data Layer
  1. Go to "Settings"
  2. "Data Layer"
  3. Expand the tree as shown
  4. Check the realtime values

Note: If the user wants to read these values from the ctrlX WORKS PLC Engineering program, it is recommended to follow the steps shown in thisΒ article.

6. Related Links

2

Latest published/updated articles

Types
How-to