Integration

Do the following to integrate the functionality:

  1. Create an instance of the DataLogger function block (e.g. in the User_PRG program or in a global variable list)
    • fbDataLogger : SEW_PES_DataLogger.DataLogger;
  2. Initialize the DataLogger function block in the Init action of the User_PRG program, assign the recording channels and perform the basic settings for the measurement. The following code block example shows the initialization of the DataLogger function block in the Init action of the User_PRG program as well as the assignment of the recording channels and the basic settings for the measurement.
    • //Initialization of function block                        
      IF NOT xInitDoneDataLogger THEN                           
      xInitDoneDataLogger:=fbDataLogger.Init(
      diCycleTime:=ANY_TO_DINT(gc_uiTaskCycleTime)
      );
      END_IF

      //Default settings                                        

      //Assignment of channels                                  
      fbDataLogger.MapChannel(0,ADR(rDlcTemp),'T_DLC [°C]');    
      fbDataLogger.MapChannel(1,ADR(rMotCycCnt),'Motion Cycle');

      //Activation of channels                                  
      fbDataLogger.Logging.IN.axEnable[0]:=TRUE;
      fbDataLogger.Logging.IN.axEnable[1]:=TRUE;
      fbDataLogger.Logging.IN.axEnable[2]:=FALSE;
      fbDataLogger.Logging.IN.axEnable[3]:=FALSE;
      fbDataLogger.Logging.IN.axEnable[4]:=FALSE;
      fbDataLogger.Logging.IN.axEnable[5]:=FALSE;
      fbDataLogger.Logging.IN.axEnable[6]:=FALSE;
      fbDataLogger.Logging.IN.axEnable[7]:=FALSE;

      //Time base settings                                      
      fbDataLogger.Logging.IN.tIntervalTime:=T#5s;

      //Activation of DataLogger                                
      fbDataLogger.Logging.IN.xActivate:=TRUE;
  3. In the Main action of the User_PRG program, call the CallMain method of the instance of the DataLogger function block.
    • fbDataLogger.CallMain();
  4. In the HighPrio action in the User_PRG program, call the CallHighPrio method of the DataLogger function block instance.
    • fbDataLogger.CallHighPrio();
    • When you log on to the MOVI-C® CONTROLLER, you can now display the variables by double-clicking the User_PRG program or the selected global variable list in the device tree under the instance of the DataLogger function block.