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:
MV_update
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
ASCII Serial Port Instructions (ABL, ACB, ACL, AHL, ARD, ARL, AWA, AWT)

Structured Text

osri_1.InputBit := temp_low;
OSRI(osri_1);
IF (osri_1.OutputBit) THEN
temp_low_write.LEN := 9;
AWT(0,string[2],temp_low_write);
END_IF;
When MV_update is set, the AWT instruction sends the characters in MV_msg.
Because the number of characters in MV_msg varies, the rung first moves the
length of the string (MV_msg.LEN) to the Serial Port Control Length of the
AWT instruction (MV_write.LEN). In MV_msg, the $16 counts as one
character. It is the hex code for the Ctrl-V character.

Relay Ladder

MOV
Move
Source MV_msg.LEN
10
Dest
MV_write.LEN
10
Structured Text
osri_1.InputBit := MV_update;
OSRI(osri_1);
IF (osri_1.OutputBit) THEN
MV_write.LEN := Mv_msg.LEN;
AWT(0,MV_msg,MV_write);
END_IF;
AWT
ASCII Write
Channel
Source
'$161365\8\1$r'
SerialPort Control
SerialPort Control Length
Characters Sent
Chapter 17
EN
0
MV_msg
DN
MV_write
ER
10
10
605

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents