IndraControl XM21 ctrlX CORE plus X3 Profinet connection

PROFINET - ctrlX CORE plus X3 with IndraControl XM21

sanX
New Contributor
 
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. 

ctrlX CORE plus X3 IndraControl XM21 Profinet Connection

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.

Settings access

App installation

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

Add profinet

Error that appears in the case the PROFINET device is added in “Operating” mode

Error in case of adding a profinet device in operating mode

4. Add PROFINET device

Profinet device addition

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

PROFINET Device app configuration

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

Activate profinet

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"

Project creation

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"

Device selection

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

General configuration

  • 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

Hardware/Communication configuration

  • Step 3: Extended settings. Keep everything as default

Extended settings configuration

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

Function packages configuration

  • 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

Interfaces configuration

3. Set PROFINET device

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

Profinet IO Controller addition

  • 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

Ethernet node configuration

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

ctrlX CORE device description download

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

Device Database Menu access

  • Press "Add devices"

Device addition

  • 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"

Devices scan

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.

Device to project copy

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

PROFINET Device app configuration

Troubleshooting:

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

Device scanning error

  • 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

Station name and IP Address configuration

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

Name and IP address configuration

  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

Add scanned devices to project tree

2. Adding the device manually

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

Device addition

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

ctrlX CORE device addition

  • 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"

Module_out device set up

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

Module_in device set up

2. Choose the type of variable

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

Variable addition

  • Double click over "byte_128_out" and close the window

Output variable addition

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

Variable addition

  • Double click over "byte_128_in"

Input variable addition

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

ctrlX CORE Network configuration

6. Write a little program to write values 

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

Global variables definition

 

  • Local variables definition and PLC program

Variables and PLC program definition

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 

Variable mapping

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

Variable mapping

  • 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 

Variable mapping

5. Testing

1. Login and run the PLC program

  • Click over the login button

Login button

  • Accept the message and follow the steps

Login confirmation message

  • Run the PLC program -> Accept the message

Run PLC program

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:

Connection check

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

Start Profinet Device app

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

Operation state check

  • 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

Read received data

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
sanX
sanX
Hi, I am Nicolas from the DCEM Application Team. I am temporary not available, if you have any questions, do not hesitate to contact LunatiX.
1 Comment
Must Read
Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist