FUNCTION_BLOCK E_CHRON
An instance of this Function Block type provides an elapsed time (chronometer) function:
  • An event at the START inputs sets the interval start time t0 to the value returned by the Java System.nanoTime() method, sets the Q output value to TRUE and the ET value to t#0s, then emits an event at the EO output.
  • If the value of QO is TRUE, an event at the STOP input sets QO := FALSE and ET := System.nanoTime() - t0 to the nearest microsecond, then issues an event at the EO output.
  • If the value of QO is TRUE, an event at the REQ input sets ET := System.nanoTime() - t0 to the nearest microsecond, then issues an event at the EO output.f
  • If the value of QO is FALSE, an event at the STOP or REQ input does nothing but issue an event at the EO output.

Test Procedure
  1. Open and run events/E_CHRON in the FBDK.
  2. Exercise the FB with the START, STOP and REQ events.
Last updated: 2016-04-18.
©2016 Holobloc Inc.
Reuse is permitted under the Academic Free License version 3.0
with attribution to http://www.holobloc.com/doc/navigator.htm