Example program
Using the example programs This document contains sample applications of our products for certain areas of application. The application notices provided here are based on typical features of our products and only serve as examples. The notices contained in this document explicitly do not refer to specific applications. The user 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. |
The program presented here reads the individual values from the terminal and visualizes them. The process data "Status" and "Control" are linked as WORD in the System Manager and decomposed into the individual bits in the PLC.
The visualization displays both channels above each other; the control takes place via the "Control" section. If a field is highlighted in color, the associated bit is TRUE.
The measuring mode can be changed via the numerical entry in the field on the right next to the mode entry. In the two single shot settings a new measurement can be requested by clicking on Start.
The Autorange function can be disabled by clicking on "Dis. Autorange". The measuring range can then be selected manually via the numeric field to the right of the range.
Download (example file)
After opening the .tsm file with the System Manager the EtherCAT master must be notified of the current MAC address. Click the "Search..." button:
Procedure for starting the program
- After clicking the Download button, save the zip file locally on your hard disk, and unzip the *.TSM (configuration) and the *.PRO (PLC program) files into a temporary working folder.
- The *.pro file can be opened by double click or by the TwinCAT PLC Control application with menu selection “File/ Open”. The *.tsm file is provided for the TwinCAT System Manager (to review or overtake configurations).
- Connect the hardware and connect the Ethernet adapter of your PC to the EtherCAT coupler (further information on this can be found in the corresponding coupler manuals)
- Select the local Ethernet adapter (with real-time driver, if applicable) under System configuration, I/O configuration, I/O devices, Device (EtherCAT); then on the “Adapter” tab choose “Search...”, select the appropriate adapter and confirm (see Fig. Searching the Ethernet adapter + Selection and confirmation of the Ethernet adapter).
- Activate and confirm the configuration (Fig. Activation of the configuration + Confirming the activation of the configuration)
- Confirm new variable mapping, restart in RUN mode (Fig. Generate variable mapping + Restarting TwinCAT in RUN mode)
- In TwinCAT PLC, under the “Project” menu, select “Rebuild all” to compile the project (Fig. Compile project)
- In TwinCAT PLC: log in with the “F11” button, confirm loading the program (Fig. Confirming program start), run the program with the “F5” button