REAL to String (RTOS)
The RTOS instruction produces the ASCII representation of a REAL value.
The RTOS instruction converts the Source to a string of ASCII characters and places the result in the Destination.
Available Languages
Ladder Diagram
FactoryTalk Design Studio
DSL - Ladder DiagramRTOS(Source,Dest);
Operands
Ladder Diagram
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:
|
Affects Math Status Flags
No
Major/Minor Faults
Type | Code | Cause | Recovery Method |
---|---|---|---|
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 Index through arrays 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 |
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
Provide Feedback