OK: Check validity (S7-1200, S7-1500) - STEP 7

FBD (S7-1200, S7-1500)

ft:publication_title
FBD (S7-1200, S7-1500)
Product
STEP 7
Version
V20
Publication date
11/2024
Language
en-US
OK: Check validity

Description

You can use the "Check validity" instruction to check if the value of an operand (<Operand>) is a valid floating-point number. The check is performed in every program cycle. If the operand value at the time of the query is a valid floating-point number, the output box will return the signal state"1". In all other cases, the signal state at the output of the "Check validity" instruction is "0".

You can use the "Check validity" instruction together with the EN mechanism. If you connect the instruction box to an EN enable input, the enable input is set only when the result of the validity query of the value is positive. You can use this function to ensure that an instruction is enabled only when the value of the specified operand is a valid floating-point number.

Parameters

The following example shows how the "Check validity" instruction works:

Parameters

Declaration

Data type

Memory area

Description

<Operand>

Input

Floating-point numbers

I, Q, M, D, L

Value to be checked.

For additional information on valid data types, refer to "See also":

Example

The following example shows how the instruction works:

When the values of the operands "Tag_Value1" and "Tag_Value2" show valid floating-point numbers, the "Multiply" instruction is executed. The value of operand "Tag_Value1" is multiplied with the value of operand "Tag_Value2". The product of the multiplication is then written in the operand "Tag_Result". If the instruction is executed without errors, the TagOut operand at the "ENO" enable output is set to signal state "1".