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.
  1. Add a new STRUCT element to the IEC project (in this case: ST_DR_DeviceVitality_Drives).
  2. 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.
  3. Add a new STRUCT element to the IEC project (in this case: ST_DR_DeviceVitality).
  4. 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.
  5. In the STRUCT element, declare a variable of the type ST_DR_DeviceVitality_Drives (in this case: Drives).
  6. 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.
  7. 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.
  8. 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).
  9. In the User_PRG.Main program, call the function block fbController_Vitality with the variable GVL_DriveRadar.DeviceVitality.Controller for the transfer parameter stController.
  10. In the User_PRG.Main program, call each function block declared for the MOVI-C® drive systems using the following transfer parameters:
    • stDrive with the variable created in GVL_DriveRadar for the respective drive system (in this case: fbMOVIGEAR_1_Vitality with GVL_DriveRadar.DeviceVitality.Drives.MOVIGEAR_1, and fbMOVIGEAR_2_Vitality with GVL_DriveRadar.DeviceVitality.Drives.MOVIGEAR_2).
    • uiEtherCATAddress with the EtherCAT® address of the drive system to which the software module is to be applied.