Bootstrap

ELAU运动控制器的应用――Watch3

ELAU运动控制器的应用――Watch3
2011年12月12日
  FUNCTION_BLOCK Watch3
  (* ------ Copyright (C) 2003 ELAU AG Germany ------------------------------------------------ last change: 24.09.2007 Requirements: Max4_V001500.lib or higher Explanation: MainsWatch (External Device Monitoring) :
  The input 'MainsWatch' is conected to an extra Contact of the Mains Contactor
  to monitor the proper functionality of the Mains Contactor.
  When the Mains Contactor is activated, the input 'MainsWatch' must be FALSE.
  With pos.edge of Enable and after every ErrorQuit of 'Error MainsOff', the functionality
  of the MainsWatch Contact is checked.
  The input MainsWatch must be TRUE at the start and become FALSE when the Mains Contactor
  is activated.
  *) VAR_INPUT
  Enable: BOOL; (* Enables the FB *)
  MainsWatch: BOOL; (* Mains contactor monitoring *)
  MainsOff: BOOL; (* switches Mains Contactor off *)
  PowerOnDelay: TIME; (* limited to minimum of 1sec *)
  Error1: BOOL; (* Error class1 *)
  Error2: BOOL; (* Error class2 *)
  Error3: BOOL; (* Error class3 *)
  MasterVel: REAL; (* Master velocity *)
  t_MasterStop: TIME; (* maximum time for master to stop *)
  ErrorQuit: BOOL; (* Error Quit, pos.edge resets the error *)
  END_VAR
  VAR_OUTPUT
  Active: BOOL; (* Shows if FB is active *)
  ErrorLevel: DINT; (* Error level *)
  AxisEnable: BOOL; (* enables Axes *)
  Error: BOOL; (* Error seen *)
  MasterStop: BOOL; (* stop Master axis at cycle end *)
  MasterQStop: BOOL; (* stop Master axis emediatelly *)
  SlaveStop: BOOL; (* stop Slave axis emediatelly *)
  Result: DINT; (* State or Error code *)
  ResultText: STRING[40]; (* Result or Error text *)
  MainsContactor: BOOL; (* Mains contactor activated *)
  END_VAR
  VAR
  EnableFlag: BOOL;
  State: DINT;
  TimeOut : TON;
  Flanke: R_TRIG;
  DiagCode: DINT;
  END_VAR ================================================== =================================================== ======= (* REVISIONS:
  30.09.2003 AMoe AxisEnable:= FALSE im State 100 bei der Abfrage ELSIF Error2 AND
  ErrorLevel > 20 eingbaut
  06.11.2003 AMoe MainsWatch is now also checked in State 30. If it becomes TRUE,
  the MainsContactor is set FALSE and an Error is generated.
  17.04.2007 FW Im State 40 bei einem Error2 anstatt nach State 100 zu springen nach
  State 50 um
;