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_DeviceIdentity_Drives).
  2. In the STRUCT element, declare a variable of the type SEW_MK_DeviceIdentity.ST_DR_Identity_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_DeviceIdentity).
  4. In the STRUCT element, declare a variable of the type SEW_MK_DeviceIdentity.ST_DR_Identity_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_DeviceIdentity_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_DeviceIdentity (in this case: DeviceIdentity) 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_Identity for the MOVI-C® CONTROLLER in the User_PRG program (in this case: fbController_Identity) as well as function blocks of the type FB_DriveRadar_Drive_Identity for the MOVI-C®drive systems (in this case: fbMOVIGEAR_1_Identity and fbMOVIGEAR_2_Identity).
  9. In the User_PRG.Main program, call the function block fbController_Identity with the variable GVL_DriveRadar.DeviceIdentity.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_Identity with GVL_DriveRadar.DeviceIdentity.Drives.MOVIGEAR_1, and fbMOVIGEAR_2_Identity with GVL_DriveRadar.DeviceIdentity.Drives.MOVIGEAR_2).
    • uiEtherCATAddress with the EtherCAT® address of the drive system to which the software module is to be applied.