Lower Case-LOWER

This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers.
The LOWER instruction converts the alphabetical characters in a string to lower case characters.
Available Languages
Ladder Diagram
LOWER_LD_avail_v31
Function Block
This instruction is not available in function block.
Structured Text
LOWER(Source,Dest);
Operands
Ladder Diagram and Structured Text
Operand
Type
Format
Description
Source
String
Tag
The tag that contains the characters you want to convert to lower case
Destination
String
Tag
The tag to store the characters in lower case
See
Structured Text
for more information on the syntax of expressions within structured text.
Description
The LOWER instruction converts all the letters in the Source to lower case, and places the result in the Destination.
  • ASCII characters are case-sensitive. Upper case A ($41) is not equal to lower case a ($61).
  • If operators directly enter ASCII characters, convert the characters to all upper case or lower case before you compare them.
Any characters in the Source string that are not letters remain unchanged.
Affects Math Status Flags
No
Major/Minor Faults
Type
Code
Cause
Recovery Method
4
51
The LEN value of the string tag is greater than the DATA size of the string tag.
Check that no instruction is writing to the LEN member of the string type tag.
In the LEN value, enter the number of characters that the string contains.
4
52
The output string is larger than the destination
Create a new string type that is large enough for the output string. Use the new string type as the data type for the destination.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
N/A
Rung-condition-in is false
N/A
Rung-condition-in is true
The instruction executes.
Postscan
N/A
Structured Text
Condition
Action
Prescan
See Prescan in the preceding Ladder Diagram table
Normal execution
See rung-condition-in is true in the preceding Ladder Diagram table.
Postscan
See Postscan in the preceding Ladder Diagram table
Examples
To find information about a specific item, an operator enters the item number into an ASCII terminal. After the controller reads the input from a terminal (terminal_read is set), the LOWER instruction converts the characters in item_number to all upper case characters and stores the result in item_number_lower_case. A subsequent rung then searches an array for characters that match those in item_number_lower_case.
Ladder Diagram
LOWER_LD_avail_v31
Structured Text
IF terminal_read THEN
LOWER(item_number,item_number_lower_case);
terminal_read := 0;
END_IF;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.