REAL to String (RTOS)

This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, CompactLogix 5380, ControlLogix 5580, GuardLogix 5580, and ControlLogix 5590 controllers.
The REAL to String (RTOS) instruction produces the ASCII representation of a REAL value.
Available Languages
Ladder Diagram
RTOS_LD_avail_v31
Function Block
This instruction is not available in function block.
Structured Text
RTOS(Source,Dest);
Operands
Ladder Diagram and Structured Text
Operand
Type
Format
Description
Notes
Source
REAL
Tag
The tag that contains the REAL value
Destination
String type
Tag
The tag to store the ASCII value
String types are:
  • Default STRING data type
  • Any new string type you create
See Structured Text Syntax for more information on the syntax of expressions.
Description
The RTOS instruction converts the Source to a string of ASCII characters and places the result in the Destination.
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.
  1. Check that no instruction is writing to the LEN member of the string type tag.
  2. 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.
See Common Attributes for operand-related faults.
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
When send_data is set, the RTOS instruction converts the value in data_1 to a string of ASCII characters and places the result in data_1_ascii. Subsequent rungs insert or concatenate data_1_ascii with other strings to produce a complete message for a display terminal.
Ladder Diagram
RTOS_LD_ex_v31
Structured Text
IF send_data THEN
RTOS(data_1,data_1_ascii);
send_data:= 0;
END_IF;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal