Sample program for KL register communication via EtherCAT on KL3314 exemplary

Using the sample programs

This document contains sample applications of our products for certain areas of application. The application notes provided here are based on typical features of our products and only serve as examples. The notes contained in this document explicitly do not refer to specific applications. The customer is therefore responsible for assessing and deciding whether the product is suitable for a particular application. We accept no responsibility for the completeness and correctness of the source code contained in this document. We reserve the right to modify the content of this document at any time and accept no responsibility for errors and missing information.

Program description / function

This example program (TwinCAT 3) provides change of single register values of the KL3314 as selection of the element type, characteristical settings of the feature register R32 and user scaling offset and gain (R33/ R34) similar as per KS2000.

Sample program for KL register communication via EtherCAT on KL3314 exemplary 1:
Settings of KL3314 via visualisation of TwinCAT 3

At least following configuration setup shall be present:

[coupler (e.g. BK1120) or embedded PC] + KL3314 + KL9010.

Sample program for KL register communication via EtherCAT on KL3314 exemplary 2: Download:
Programlink

Preparations for starting the sample programs (tnzip file / TwinCAT 3)

  • Click on the download button to save the Zip archive locally on your hard disk, then unzip the *.tnzip archive file in a temporary folder.
  • Sample program for KL register communication via EtherCAT on KL3314 exemplary 3:
    Opening the *. tnzip archive
  • Select the .tnzip file (sample program).
  • A further selection window opens. Select the destination directory for storing the project.
  • For a description of the general PLC commissioning procedure and starting the program please refer to the terminal documentation or the EtherCAT system documentation.
  • The EtherCAT device of the example should usually be declared your present system. After selection of the EtherCAT device in the “Solutionexplorer” select the “Adapter” tab and click on “Search...”:
  • Sample program for KL register communication via EtherCAT on KL3314 exemplary 4:
    Search of the existing HW configuration for the EtherCAT configuration of the example
  • Checking NetId: the “EtherCAT” tab of the EtherCAT device shows the configured NetId:Sample program for KL register communication via EtherCAT on KL3314 exemplary 5:.
    The first 4 numbers have to be identical with the project NetId of the target system. The project NetId can be viewed within the TwinCAT environment above, where a pull down menu can be opened to choose a target system (by clicking right in the text field). The number blocks are placed in brackets there next to each computer name of a target system.
  • Modify the NetId: By right clicking on “EtherCAT device” within the solution explorer a context menu opens where “Change NetId...” have to be selected. The first four numbers of the NetId of the target computer have to be entered; the both last values are 4.1 usually.
    Example:
    • NetId of project:       myComputer (123.45.67.89.1.1)
    • Entry via „Change NetId...“:     123.45.67.89.4.1