Each Device Module implements the device for the associated Altivar type for Modbus TCP. The device is added under the Industrial Ethernet manager in your configuration with the instance name assigned within the Add Function From Template dialog box.
The device is preconfigured. The configuration includes the ModbusTCP channel for the cyclic data exchange with the device. The repetition rate for the channel is selected with 10 ms.
Global Variable List - GVL_<name device module>
The Device Module implements a GVL. This GVL is added under the Application node in the folder with the name assigned within the Add Function From Template dialog box. The GVL has the same name as the device instance with the prefix GVL_.
The GVL contains the variables which build the interface from the implemented program code to the application. 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 assigned within the Add Function From Template dialog box. The program has the same name as the device instance with the prefix Prg_. A program-call is added automatically to the associated task.
For basic control functions, the program code does not need to be modified, all required signals and control parameter are linked to the associated variables in the GVL.
The program is divided into several actions. These are described in the following table.
|
Name of the action |
Description |
|---|---|
|
A01_ComStat |
Processes the functions to monitoring and control of the Modbus TCP communication with the device. |
|
A02_Ctrl_ATV |
Contains a selection of function blocks calls to control and monitor the Altivar. Each function block is called in each program cycle. |
|
A03_Config_ATV |
Contains a selection of function blocks calls to write a set of parameters to the Altivar. |
|
A04_FbErrorDetection |
Contains the logic for the evaluation of the error messages which are provided by the motion control (MC_) function blocks. |
NOTE: For monitoring the communication state of the device, the channel ID of the configured Modbus TCP channel must be set as value for the variable GVL_<name device module>.c_uiChannelId. The channel ID is automatically generated when the device is added to the project and can be obtained through the Device Editor in the tab Modbus TCP Slave configuration.
Further information about the control logic is available inside the program in terms of comments.