Skip to main content

CheckValueIsANumber

Short summary

This function checks if the given LREAL is a valid number to calculate with.

Return: TRUE if the value is processable, FALSE if NaN or +/-Inf

  • Return type: BOOL

Parameters

NameTypeCommentKind
valueLREALthe folating point that should be checkedinput

Code

Declaration

FUNCTION INTERNAL CheckValueIsANumber : BOOL
VAR_INPUT
(* the folating point that should be checked *)
value :LREAL;
END_VAR

Implementation

CheckValueIsANumber := (NOT Tc2_Utilities.LrealIsNaN(value)) AND_THEN Tc2_Utilities.LrealIsFinite(value);