Dear Community User! We will start the migration process in one hour.
The community will be then in READ ONLY mode.
Read more: Important information on the platform change.

Smart Function Kit ctrlX CORE X3 etherCAT Connection

Smart Function Kit using a ctrlX CORE connected through EtherCAT

sanX
New Contributor

1. Introduction

The Smart Function Kit is suitable for many pressing and joining applications with forces up to 70 kN. The web-based software allows for both easy creation of a sequence by means of drag & drop of sequential modules and for the recording of the force/path development and its subsequent evaluation (OK/NOK) by envelopes, windows and limit value.

Find more information about the Smart Function Kit and its functionalities: 

With the purpose to increase the configuration options of the Smart Function Kit, it will be shown how to connect it to a ctrlX CORE using the EtherCAT connection. Once connected, you will learn how to configure the program of the ctrlX PLC Engineering to perform some basic functions.

Smart Function Kit with ctrlX CORE etherCAT connection

2. Prerequisites

3. Smart Function Kit configuration

To be able to connect the Smart Function Kit (SFK) to the ctrlX CORE it is required to change the connection configuration in the SFK interface:

1. Connect the SFK (Indutrial PC) to the Engineering Computer Ethernet port and configure the static IP address. 

Engineering computer with Industrial PC Connection

  • It is recommended to check the instructions shown in the following link: Quick Start Guide ctrlX CORE To follow this tutorial, it is needed to consider that the default static IP address of the Smart Function Kit is 192.168.0.1. Therefore, a 192.168.0.X IP Address should be chosen.

2. In a web browser, enter the SFK IP Address (192.168.0.1) and configure the EtherCAT connection:

  1. Access configuration menu
  2. Press the "System" tab

Smart Function Kit System tab access

  • In the same tab, scroll down to the Fieldbus configuration section, choose the Ethercat connection and save the configuration

EtherCAT selection

4. ctrlX IO Engineering configuration

First, it will be shown how to import the IO configuration to save time. In the case, the user would like to understand the configuration and personalize it, it will also be shown how to perform this configuration.

4.1. ctrlX IO file import

1. Connect the ctrlX CORE to the Smart Function Kit using the EtherCAT port (X23 P1). 

CORE_ID-Cs.png

 

2. Download the file provided at the end of this article ("Smart Function Kit IO Configuration"), and open the ctrlX IO Engineering program

  1. Press "Open project"
  2. Search the downloaded file and select it
  3. Press "Open"

IO_Engineering_Open.png

2. Check connection between ctrlX CORE and engineering computer

  1. Right click over the ctrlX CORE node
  2. Select "Communication settings"

Access to Communication settings Menu

  • Introduce the ctrlX CORE IP address, and check the connection by clicking the "Run" button. Once checked press the Apply button.

3. Once the program and the ctrlX CORE are correctly connected, transfer the configuration to the ctrlX CORE

  1. Right click over "ethercatmaster"
  2. Press "Download"

IO_Engineering_Download.png

4.2. ctrlX IO Engineering step by step configuration

1. Connect the ctrlX CORE to the Smart Function Kit using the etherCAT port.
2. Open ctrlX IO Engineering program 

  1. Press "New project"
  2. Select the ctrlX CORE IO Template
  3. Provide a project name
  4. Close the window by pressing "Ok"

ctrlX IO Project creation

3. Add device

  1. Right click over "ethercatmaster"
  2. Select "Scan for Devices"

Devices scan

4. Select the IndraDrive device 

  • Press the shown button to add the scanned device

Indradrive device addition

  • The device name could be adapted (t.e. SFK_01), then press "Apply" and close the window

ScanForDevices.png

5. Enable expert settings

  1. Double click over the previously added device
  2. Select the "General" tab
  3. Enable "Expert settings"

ExpertSetting.png

6. Configure inputs

  • Access "Expert Process Data" window

ExpertSettings2.png

  • Edit Status word variable
  1. Select "S-0-0016"
  2. Select the "Master control word" variable
  3. Press the "Edit" button
  4. Write the name: "statusword"
  5. Change the data type to "WORD"
  6. Save the configuration pressing "Ok"

statusword variable definition

  • Delete the shown variable
  1. Select the desired variable: In this case S-0-0051
  2. Press the "Delete" button

Delete variables

  • Create the "ResponseHandle" variable
  1. Select the blank space
  2. Press the "Insert" button
  3. Write the variable name
  4. Select the variable type
  5. Write the Pset and Offset values
  6. Select the data type
  7. Save the configuration pressing "Ok"

ResponseHandle variable configuration

  • Perform the same steps for each variable
  1. Select black space
  2. Press "Insert" button
  3. Configure the variable

Input variables configuration

  • The final screen should look as follows. NOTE: Be careful with the data type

PDO_Status.png

NOTE: The Inputs group name can also be changed pressing the "Edit" button, but this is not mandatory.

Edit Input group name

7. Configure outputs

  • Perform the same steps as done with the Inputs
  • The final screen should look as follows:

PDO_Control.png

8. Once the inputs and outputs have been configured, transfer the configuration to the ctrlX CORE

  1. Right click over "ethercatmaster"
  2. Press "Download" / "Transfer field bus configuration"

DownloadConfig.png

5. ctrlX PLC Engineering configuration

1. Start the ctrlX PLC Engineering program and create a new project

  1. Press "New project"
  2. Select the ctrlX CORE template
  3. Provide a project name
  4. Close the window by pressing "Ok"

PLC project creation

2. Communicate to the ctrlX CORE

  1. Right click over "Device"
  2. Press over "Communication settings"

Access to communication settings menu

3. Enter the IP Address of the ctrlX CORE, press "Run" button to check the connection, and close the window by pressing "Ok

4. Insert code and variables

  • Download the zip file which can be found at the end of this article, and save it in a reachable folder
  • In the ctrlX PLC Engineering program, in the "Project" tab, press "Import"

Access to file import menu

  • In the window, select the "PLC_SFK_Pressing_v1_0.export" file provided in this article, and press "Open"
  • Select all the files and press "Ok"

PLC_Import.png

 

 

 

 

 

 

 

IMPORTANT: To be able to import the folder, it is required that in the project tree, "Application" is selected. Otherwise, the insertable items will not be visible even though they are in the import file.

  • In the case some errors appear due to the lack of the OSCAT package, follow the steps:

Download the OSCAT library as a package from CODESYS store: Link

Select "Tools" and press over "Add-on installer". After please close the ctrlX PLC Engineering.

Note: Before versions 1.20, this menu is called "Package Manager". 

Tools_Add-On_installer.png

The Add-on installer will be opened and then click over install and select the downloaded "OSCATBasic.package":

Add-on_Installer.png

Note: due to several versions the look and feel will be quite different. But the functionality will be the same.

  • Allow unsigned packages and press "Ok"
  • Follow the installation process:

Troubleshooting: It can be possible that it is not able to install the package because ctrlX PLC or I/O Engineering is open. Make sure that all the ctrlX tools are closed. 

  • Once successfully installed, it is needed to add the library within the PLC Engineering project.
  1. Open the PLC Engineering project
  2. Double click over "Library Manager"
  3. Press over "Add library"

Access to library addition window

  • Expand the Miscellaneous tree and select "BASIC". Press "Ok" to close the window

AddLibrary_BASIC.png

Important

It is possible that OSCAT does not show up under Miscallaneous, but under Application -> Utils -> BASIC. If this is the case, also the Namespace of the Library has to be changed to BASIC

Namespace-BASIC.png

 

 

 

 

 

 

 

 

 

 

 

Now, let us call the demo program...

In the "PLC_PRG" code section it is required to call to the Smart Function Kit program to be able to execute it

  1. Double click over "PLC_PRG"
  2. In the code section, just write "SFK_Example_Program();" and the program will be able to run

PLC_CallPRG.png

5. Map variables

  1. Right click over "DataLayer_Realtime
  2. Press over "Select realtime data"
  3. Press "Selectively from ctrlX CORE"

PLC_Datalayer.png

  1. In the new window, click over the black space and it will expand
  2. Select "ethercat_master_instances_ethercatmaster"

EtherCAT instances addition

NOTE: This will only appear if the the communication between ctrlX CORE and Engineering computer is successful (See step 2)

  1. Include the ethercatmaster instances
  2. Press the button to add the instances to the PLC project

Datalayer_choose_more.png

  • Check that the variables have been added and close the window

Datalayer_Config.png

6. Variable mapping. In this section it will be shown how to map the data received from the Smart Function Kit with the defined variables in the PLC program

  1. Double click over SFK_01
  2. Select the Datalayer Node IO Mapping tab 
  3. Double click over the "responseHandle" input variable and click on the three dots. NOTE: The statusword variable will not be mapped

PLC_Datalayer_Node.png

  • Extend the tree: Application -> Smart Function Kit -> SFK_GlobalVariables -> InputDataContainer. Select it and press "Ok", or double click over the variable

Choose_Variable.png

  • At the end of each variable description, indicate which variable of the array is assigned
  • For the "responseHandle" variable, position "0" is assigned as shown below:

Variable.png

  • Perform the same steps for all the variable as shown in the image. Make sure that all of them match.

Datalayer_IO_Mapping.png

6. Testing

1. Open the visualization window

Visu.png

2. Generate code and login to the ctrlX CORE

Code generation and Login buttons

3. Press the "Run" button and test the program

Run PLC program

3 Comments
mat_vietz
Member

Hello @sanX ,

the exported PLC project is not the same as shown in the tutorial. Can you please update the tutorial or advise the steps with the new PLC project?

LunatiX
New Contributor

Hi @mat_vietz , thanks for your feedback. I'll update the tutorial as soon as possible. Best regards.

akrosis
Established Member

Hello @LunatiX,


EDITED: I was having an error with OSCAT library. After installation, firstly, it didn't show up on Miscellaneous, it showed up on Application>Utils>BASIC. Secondly, even if I add it, project still gave error about not recognizing "identifier BASIC".  I'm using CtrlX Works 1.20.11. 
I've just found the problem, when you add the library, its namespace is not BASIC, its BASIC_OSCAT. You just need to change this to BASIC, and it'll work. I don't know why you didn't get this issue but this may be useful for other people so I wanted to share. 

Thank you for the guide.

akrosis_0-1729431483553.png

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