Compare and Measure Strings in Advanced Ladder

See also: String in Advanced Ladder

See also: Project Toolbox for Advanced Ladder

 

Topic Menu

Compare Strings

When power is applied to this element, it compares the programmed number of characters from IN1 with any characters appearing at IN2. If the comparison is TRUE (the two strings are equal), then power flow through the elements is TRUE.

  • IN1 may be either a Register Type and Offset reference, or a string constant.

  • IN2 must be a Register Type and Offset Reference.

  • N is the number of characters to compare and must be a decimal constant. If IN1 is a string constant, then the Number of Characters entry box is disabled, and contains the count of the number of characters typed in.

    Note: A hexadecimal sequence ('$0A') appearing in a string constant is counted as a single character.

Configuration with source and destination as a Register Reference:

 

Note: Double click on the function block to open the String Configuration dialog.

 

Configuration with source as a String Constant:

 

Return to the Top: Compare and Measure Strings in Advanced Ladder

Measure String Length

When power is applied to this element, it counts the number of characters starting from SRC and going until it encounters a NULLClosed Null Termination - To place a NULL character (character code 0) at the end of ASCII data. Some functions require NULL Termination to be able to determine the end point of the ASCII data since that data may vary in length from one time to the next.. The resulting number of characters is placed in LEN.

Note: This function MUST encounter a NULL (character code 0) in order for it to return a value.

 

  • SRC needs to be a Register Type and Offset Reference.

  • LEN must be a Register Type and Offset Reference.

 

Note: Double click on the function block to open the String Configuration dialog.

 

Return to the Top: Compare and Measure Strings in Advanced Ladder