Skip to main content

SimpleTimeAssertions

Short summary

This class implements the interface I32BitTimeAssertions. It contains the assert statements for the data type TIME

==

AccessAbstractFinalExtendsImplements
INTERNALNoNoAbstractAssertionI32BitTimeAssertions

UML Diagram

Parameters

none

Properties

className

Type: CNM_AbstractObject.ClassName

This abstract property returns the class name of the concrete object,

Methods

getTimePassed

  • Parameters:
    • startTime (TIME): timestamp start
  • Return type: TIME

This method returns the passed time since the timestamp was created

timeHasExpired

  • Parameters:
    • timestamp (TIME): start time you get it with TIME()
    • expiringTime (TIME): timeout like t#300ms
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks whether time has elapsed since the timestamp time

timeHasNotExpired

  • Parameters:
    • timestamp (TIME): start time you get it with TIME()
    • expiringTime (TIME): timeout like t#300ms
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks that the time since the timestamp time has not yet elapsed

valueIsEqualTo

  • Parameters:
    • currentValue (TIME): current value to check
    • expectedValue (TIME): expected value to compare
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current value is equal to the expected value

valueIsGreaterThan

  • Parameters:
    • currentValue (TIME): current value to check
    • lessValue (TIME): less than lower limit
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current value is greater than the less value

valueIsInRangeOf

  • Parameters:
    • lowerLimit (TIME): lower limit for the current value
    • currentValue (TIME): current value to check
    • upperLimit (TIME): upper limit for the current value
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current value is inside a limit

valueIsLessThan

  • Parameters:
    • currentValue (TIME): current value to check
    • greaterValue (TIME): greater than upper limit
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current value is less than the greater value

valueIsMax

  • Parameters:
    • currentValue (TIME): current value to check
    • maximumValue (TIME): upper limit for the current value
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current value is less than or equal to the maximum value

valueIsMin

  • Parameters:
    • currentValue (TIME): current value to check
    • minimumValue (TIME): lower limit for the current value
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current value is greater than or equal to the minimum value

valueIsNotEqualTo

  • Parameters:
    • currentValue (TIME): current value to check
    • unexpectedValue (TIME): unexpected value to compare
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current value is not equal to the unexpected value

Code

Declaration

{attribute 'reflection'}
FUNCTION_BLOCK INTERNAL SimpleTimeAssertions EXTENDS AbstractAssertion IMPLEMENTS I32BitTimeAssertions
VAR CONSTANT
(* maximum value for the data type ``TIME`` *)
MAX_TIME :TIME := TO_TIME(16#FF_FF_FF_FF);
END_VAR