Chapter 19
ASCII Conversion Instructions (STOD, STOR, DTOS, RTOS, UPPER, LOWER)
Condition
Prescan
Rung-condition-in is false
Rung-condition-in is true
EnableIn is set
Instruction execution
Postscan
temp_high
628
Execution:
Relay Ladder Action
The rung-condition-out is set to false.
The rung-condition-out is set to false.
The instruction executes.
The rung-condition-out is set to true.
N/A
The instruction converts the source.
The rung-condition-out is set to false.
Example:
When temp_high is set, the DTOS instruction converts the value in msg_num to
a string of ASCII characters and places the result in msg_num_ascii. Subsequent
rungs insert or concatenate msg_num_ascii with other strings to produce a
complete message for a display terminal.
Relay Ladder
Structured Text
IF temp_high THEN
DTOS(msg_num,msg_num_ascii);
temp_high := 0;
END_IF;
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Structured Text Action
No action taken.
N/A
N/A
EnableIn is always set.
The instruction executes.
No action taken.
DTOS
DINT to String
Source
msg_num
Dest msg_num_ascii
23
'23'