The Device Module implements the device Preventa XPSMCM for EtherNet/IP. This device is added under the Industrial Ethernet manager with the name selected within the Add Function From Template dialog box.
The device is preconfigured. The configuration includes the connection with the assemblies 150 (output) and 100 (input). The Request Packet Interval (RPI) is selected with 20 ms.
Global Variable List - GVL_<name device module>
The Device Module implements a GVL. This GVL is added under the Application node within a folder with the name selected within the Add Function From Template dialog box. The GVL gets the same name as the folder and the device but with the prefix GVL_.
The GVL contains two groups of variables.
oOne group is linked to the program code and builds the interface to the application for monitoring and control EtherNet/IP communication with the device.
oThe other group of variables is directly mapped to the inputs and outputs of the device and can be used in the application according to their meaning.
The clear name of the GVL and the uniform naming of the variables facilitate a simple and structured implementation into the application.
Program - Prg_<name device module>
The Device Module implements a program. This program is added under the Application node within a folder with the name selected within the Add Function From Template dialog box. The program gets the same name as the folder and the device but with the prefix Prg_. Besides, the program-call is added automatically to the associated task.
The program is divided into several actions. These are described in the following table.
Name of the action |
Description |
---|---|
A01_ComCtrl |
Processes the functions to monitoring and control of the EtherNet/IP communication with the device. |
A02_IOMapping |
In this action the single bits from the input and output bytes are assigned to boolean variables with a meaningful name to be used in the application. For this Device Module, only the bits with a unique meaning are assigned to the corresponding variables from GVL. |
Further information about the control logic is available inside the program in terms of comments.