Declaring function blocks
- The IEC package of the software module has been downloaded from Online Support and installed.
- The IEC library included in the IEC package has been added to the IEC project.
- Add a new STRUCT element to the IEC project (in this case: ST_DR_DeviceVitality_Drives).
- In the STRUCT element, declare a variable of the type
SEW_MK_DeviceVitality.ST_DR_Vitality_Drive
for each MOVI-C® drive system for which the software module is to be used (in this case: MOVIGEAR_1
and MOVIGEAR_2
). If possible, use the same designations as in the MOVISUITE® project.
- Add a new STRUCT element to the IEC project (in this case: ST_DR_DeviceVitality).
- In the STRUCT element, declare a variable of the type
SEW_MK_DeviceVitality.ST_DR_Vitality_Controller
for the MOVI-C® CONTROLLER (in this case: Controller
). If possible, use the same designations as in the MOVISUITE® project.
- In the STRUCT element, declare a variable of the type
ST_DR_DeviceVitality_Drives
(in this case: Drives
).
- Add a global variable list to the IEC project (in this case: GVL_DriveRadar). This functions as a user interface. If a global variable list has already been created by using other software modules, you can skip this step.
- In the global variable list GVL_DriveRadar, declare a variable of the type
ST_DR_DeviceVitality
(in this case: DeviceVitality
) to use the variables created for the MOVI-C® CONTROLLER and the MOVI-C® drive systems in the user interface.
- Link the variables declared in the global variable list GVL_DriveRadar with the function blocks provided by the software module. To do so, declare a function block of the type
FB_DR_Controller_Vitality
for the MOVI-C® CONTROLLER in the User_PRG program (in this case: fbController_Vitality
) as well as function blocks of the type FB_DriveRadar_Drive_Vitality
for the MOVI-C®drive systems (in this case: fbMOVIGEAR_1_Vitality
and fbMOVIGEAR_2_Vitality
).
- In the User_PRG.Main program, call the function block
fbController_Vitality
with the variable GVL_DriveRadar.DeviceVitality.Controller
for the transfer parameter stController
.
- In the User_PRG.Main program, call each function block declared for the MOVI-C® drive systems using the following transfer parameters: