Rockwell Automation Allen-Bradley Logix5000 Series Programming Manual

Programming Manual

Logix5000 Controllers ASCII Strings

Catalog Numbers 1789-L60, 1794-L34, PowerFlex 700S/SE
1756-L1, 1756-L55, 1756-L61, 1756-L62, 1756-L63, 1769-L31, 1769-L32C, 1769-L32E, 1769-L35CR, 1769-L35E,
Important User Information
IMPORTANT
Solid-state equipment has operational characteristics differing from those of electromechanical equipment. Safety Guidelines for the Application, Installation and Maintenance of Solid State Controls (publication SGI-1.1 your local Rockwell Automation sales office or online at http://www.rockwellautomation.com/literature/ important differences between solid-state equipment and hard-wired electromechanical devices. Because of this difference, and also because of the wide variety of uses for solid-state equipment, all persons responsible for applying this equipment must satisfy themselves that each intended application of this equipment is acceptable.
In no event will Rockwell Automation, Inc. be responsible or liable for indirect or consequential damages resulting from the use or application of this equipment.
The examples and diagrams in this manual are included solely for illustrative purposes. Because of the many variables and requirements associated with any particular installation, Rockwell Automation, Inc. cannot assume responsibility or liability for actual use based on the examples and diagrams.
No patent liability is assumed by Rockwell Automation, Inc. with respect to use of information, circuits, equipment, or software described in this manual.
Reproduction of the contents of this manual, in whole or in part, without written permission of Rockwell Automation, Inc., is prohibited.
Throughout this manual, when necessary, we use notes to make you aware of safety considerations.
WARNING: Identifies information about practices or circumstances that can cause an explosion in a hazardous environment, which may lead to personal injury or death, property damage, or economic loss.
) describes some
ATTENTION: Identifies information about practices or circumstances that can lead to personal injury or death, property damage, or economic loss. Attentions help you identify a hazard, avoid a hazard, and recognize the consequence
SHOCK HAZARD: Labels may be on or inside the equipment, for example, a drive or motor, to alert people that dangerous voltage may be present.
BURN HAZARD: Labels may be on or inside the equipment, for example, a drive or motor, to alert people that surfaces may reach dangerous temperatures.
Identifies information that is critical for successful application and understanding of the product.
Allen-Bradley, Rockwell Software, Rockwell Automation, and TechConnect are trademarks of Rockwell Automation, Inc.
Trademarks not belonging to Rockwell Automation are property of their respective companies.

Summary of Changes

IMPORTANT
This manual contains new and updated information.
RSLogix 5000 programming software is now known as Studio 5000™ Logix Designer application, a component of Studio 5000 Engineering and Design Environment.
The following controllers are no longer supported in the Logix Designer application, version 21.
Catalog Number Description
1756-L61 ControlLogix 5561 Controller
1756-L61S ControlLogix 5561S Controller
1756-L62 ControlLogix 5562 Controller
1756-L62S ControlLogix 5562S Controller
1756-L63 ControlLogix 5563 Controller
1756-L63S ControlLogix 5563S Controller
1756-L64 ControlLogix 5564 Controller
1756-L65 ControlLogix 5565 Controller
1768-L43 CompactLogix 5343 Controller
1768-L43S CompactLogix 5343S Controller
1768-L45 CompactLogix 5345 Controller
1768-L45S CompactLogix 5345S Controller
1769-L23E-QBF1 CompactLogix 5323E-QB1 Controller
1769-L23E-QBFC1 CompactLogix 5323E-QBFC1 Controller
1769-L23-QBFC1 CompactLogix 5323-QBFC1 Controller
1769-L31 CompactLogix 5331 Controller
1769-L32C CompactLogix 5332C Controller
1769-L32E CompactLogix 5332E Controller
1769-L35CR CompactLogix 5335CR Controller
1769-L35E CompactLogix 5335E Controller
Changes throughout this revision are marked by change bars, as shown in the margin of this page.
There are a number of minor changes throughout this publication that were made to clarify existing information. The major changes are listed below.
Change Page
Updated sample project folder location. page 22
Updated data type editor image. page 23
Rockwell Automation Publication 1756-PM013C-EN-P - November 2012 3
Summary of Changes
Notes:
4 Rockwell Automation Publication 1756-PM013C-EN-P - November 2012

Table of Contents

Preface
Communicating with an ASCII Device
Processing ASCII Characters
Studio 5000 Engineering and Design Environment and
Logix Designer Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
In This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Chapter 1
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Connect the ASCII Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Configure the Serial Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Configure the User Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Create String Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Read Characters from the Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Send Characters to the Device. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Enter ASCII Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 2
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Extract a Part of a Bar Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Look Up a Bar Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Create the PRODUCT_INFO Data Type . . . . . . . . . . . . . . . . . . . . . 23
Search for the Characters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Identify the Lane Number. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Reject Bad Characters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Enter the Product IDs and Lane Numbers . . . . . . . . . . . . . . . . . . . . . . 25
Check the Bar Code Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Convert a Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Decode an ASCII Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Build a String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
ASCII Character Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Rockwell Automation Publication 1756-PM013C-EN-P - November 2012 5
Table of Contents
6 Rockwell Automation Publication 1756-PM013C-EN-P - November 2012

Preface

Studio 5000 Engineering and Design Environment and Logix Designer Application

The Studio 5000™ Engineering and Design Environment combines engineering and design elements into a common environment. The first element in the Studio 5000 environment is the Logix Designer application. The Logix Designer application is the rebranding of RSLogix™ 5000 software and will continue to be the product to program Logix5000™ controllers for discrete, process, batch, motion, safety, and drive-based solutions.
The Studio 5000 environment is the foundation for the future of Rockwell Automation® engineering design tools and capabilities. It is the one place for design engineers to develop all the elements of their control system.

In This Manual

This manual shows how to manipulate ASCII strings in Logix5000 controllers. This manual is one of a set of related manuals that show common procedures for programming and operating Logix5000 controllers. For a complete list of common procedures manuals, see the Logix 5000 Controllers Common Procedures Programming Manual, publication 1756-PM001.
The term Logix5000 controller refers to any controller that is based on the Logix5000 operating system, such as:
· CompactLogix controllers
· ControlLogix controllers
· DriveLogix controllers
· FlexLogix controllers
· SoftLogix5800 controllers
Rockwell Automation Publication 1756-PM013C-EN-P - November 2012 7
Preface
Notes:
8 Rockwell Automation Publication 1756-PM013C-EN-P - November 2012
Communicating with an ASCII Device
Connection from the serial port of the controller to the ASCII device
42237
Chapter
1

Introduction

You can exchange ASCII data with a device through the serial port of the controller. For example, you can use the serial port to:
· read ASCII characters from a weigh scale module or bar code reader.
· send and receive messages from an ASCII triggered device, such as a
MessageView terminal.
In addition to the controller serial port, firmware revision 3.1 and greater of the 1756-EWEB EtherNet/IP Web Server module supports a socket interface that lets Logix5000 controllers exchange ASCII data using TCP or UDP socket services. See the EtherNet/IP Web Server User Manual, publication ENET- UM0527, revision C or later.
Rockwell Automation Publication 1756-PM013C-EN-P - November 2012 9
Loading...
+ 21 hidden pages