Structured Text; Relay Ladder - Allen-Bradley Logix5000 Reference Manual

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Example 2:
alarm
Move
Source alarm_msg.LEN
Dest
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
ASCII Serial Port Instructions (ABL, ACB, ACL, AHL, ARD, ARL, AWA, AWT)

Structured Text

IF temp_high THEN
temp_high_write.LEN := 5;
AWA(0,string[1],temp_high_write);
temp_high := 0;
END_IF;
When alarm is set, the AWA instruction sends the specified number of characters
in alarm_msg and appends a termination character (s). Because the number of
characters in alarm_msg varies, the rung first moves the length of the string
(alarm_msg.LEN) to the Serial Port Control Length of the AWA instruction
(alarm_write.LEN). In alarm_msg, the $14 counts as one character. It is the hex
code for the Ctrl-T character.

Relay Ladder

MOV
5
alarm_write.LEN
5
Structured Text
osri_1.InputBit := alarm;
OSRI(osri_1);
IF (osri_1.OutputBit) THEN
alarm_write.LEN := alarm_msg.LEN;
AWA(0,alarm_msg,alarm_write);
END_IF;
AWA
ASCII Write Append
Channel
Source
SerialPort Control
SerialPort Control Length
Characters Sent
Chapter 17
EN
0
alarm_msg
DN
'$1425\1'
alarm_write
ER
5
6
601

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents