Sample programs
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. |
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.
- 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...”:
- Checking NetId: the “EtherCAT” tab of the EtherCAT device shows the configured NetId:.
The first four numbers must 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 must be entered; 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
Preparation to start the sample program (tpzip file/ TwinCAT 3)
- After clicking the Download button, save the zip file locally on your hard disk, and unzip the *.tpzip -archive file into a temporary working folder.
- Create a new TwinCAT project as described in section:
TwinCAT Quickstart, TwinCAT 3, Startup - Open the context menu of "PLC" within the "Solutionexplorer" and select "Add Existing Item..."
- Select the beforehand unpacked .tpzip file (sample program).
Further Information
- Sample program 1 and 2 (offset/gain)
- Sample program 3 (write LookUp table)
- Sample program 4 (generate LookUp table)
- Sample program 5 (write filter coefficients)
- Sample program 6 (interlacing of measured values)
- Sample program 7 (general decimation in the PLC)
- Sample program 8 (diagnosis messages)
- Sample program 9 (measuring range combination)
- Sample program 10 (reading and writing TEDS data)
- Sample program 11 (FB for real time diagnosis)
- Sample program 12 (scripts for generation and transformation of filter coefficients)
- Sample program 13 (R/W signature of calibration)
- Sample program 14: Reading the BIC from the CoE