Skip to main content

LongTimeAssertions

Short summary​

This class implements the interface I64BitTimeAssertions. It provides the assert statements for the data type LTIME

==

AccessAbstractFinalExtendsImplements
INTERNALNoNoAbstractAssertionI64BitTimeAssertions

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 (LTIME): timestamp start
  • Return type: LTIME

This method returns the passed time since the timestamp was created…

timeHasExpired​

  • Parameters:
    • timestamp (LTIME): start time you get it with LTIME()
    • expiringTime (LTIME): timeout like lt#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 (LTIME): start time you get it with LTIME()
    • expiringTime (LTIME): timeout like lt#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 (LTIME): current value to check
    • expectedValue (LTIME): 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 (LTIME): current value to check
    • lessValue (LTIME): 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 (LTIME): lower limit for the current value
    • currentValue (LTIME): current value to check
    • upperLimit (LTIME): 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 (LTIME): current value to check
    • greaterValue (LTIME): 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 (LTIME): current value to check
    • maximumValue (LTIME): 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 (LTIME): current value to check
    • minimumValue (LTIME): 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 (LTIME): current value to check
    • unexpectedValue (LTIME): 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 LongTimeAssertions EXTENDS AbstractAssertion IMPLEMENTS I64BitTimeAssertions
VAR CONSTANT
(* maximum value for the data type ``LTIME`` *)
MAX_TIME :LTIME := TO_LTIME(16#FFFF_FFFF_FFFF_FFFF);
END_VAR