Chapter 5 Advanced Topics; Writing More Maintainable Programs; Copying Information Between Projects - Omron CX-PROGRAMMER V9 Operation Manual

Table of Contents

Advertisement

OMRON
CHAPTER 5
Advanced Topics
This chapter discusses features and topics associated with CX-Programmer for use by advanced programmers.

Writing More Maintainable Programs

CX-Programmer contains features that allow better-documented, more maintainable programs to be developed.
The following paragraphs discuss the topics associated with those features.
Symbols
Symbols give readability to a program by adding a meaningful name and/or comment to an address or value.
Symbols should be defined locally to a program and rarely at PLC global scope, unless it is necessary to share
an address between a PLC's programs. Keeping symbols local means that the symbol set for the program is as
small and maintainable as possible, and stops modifications of one program from affecting others. Other
benefits include the ability to easily cut/paste a program between PLCs or projects, keeping the correct symbol
set.
It is possible to override the definition of a global symbol at local level, by redefining the symbol at the local
level. CX-Programmer gives a warning when performing a program check, but the practice is allowed.
It may improve readability and maintainability by defining 'work' type addresses automatically. Any address
that is automatically assigned is indicated as such each time it is used. The allocation of addresses is controlled
at the PLC level – CX-Programmer ensures that all addresses are unique within the assigned address range.
Data Types
A symbol's data type allows CX-Programmer to check correct usage of the address – for example, a symbol can
indicate that an address is for Binary Coded Decimal encoded values. CX-Programmer checks that the address is
not used incorrectly in binary instructions.
Although the CHANNEL data type is available for symbols, it does not give protection against incorrect
encoding usage. The CHANNEL data type is for use when the data within an address is of an indeterminate
format. It can also be used to mark the start of an array.
The NUMBER data-type makes it possible to create a symbol for a constant value, further helping readability.

Copying Information between Projects

CX-Programmer can only open a single project at a time. However, it is possible to copy parts of the project
information to another project. To do this, it is necessary to have two CX-Programmer applications running at
the same time.
Data that can be copied includes the following:
♦ PLCs;
♦ Programs;
♦ Symbol tables;
♦ Symbols;
♦ Parts of a Ladder program.
It is thus possible to integrate programs and information from several projects. This is useful, for example,
where each person on a team is responsible for writing a single program. The person responsible for integration
can then copy each program produced, from its own project into a single PLC on the master project.
Both cut/paste and drag/drop techniques can be used to copy data. For cut/paste, copy the data to the clipboard
in one application, and paste into the other application.
Note:
When a program is pasted from one PLC type to another, it does not undergo program
conversion. To correctly assemble programs from different PLC types, it is necessary to first
change the PLC types of the source programs to the target type before copying.
PART 1: CX-Programmer
CHAPTER 5 – Advanced Topics
CX-Programmer _Page 109

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents