Sei sulla pagina 1di 106

Training Manual for Cscape

and Touchscreen OCS

17 April 2015 MAN0827-07


PREFACE

This manual provides introductory level training for Cscape Software users using touchscreen OCS. It has been
written with the newer Cscape 9.4 and up Hardware Configuration setup. All instructions and screen captures
regarding Hardware Configuration will reflect this newer setup.

Copyright (C) 2015 Horner APG, LLC., 59 South State Street, Indianapolis, Indiana 46201. All rights reserved. No
part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated
into any language or computer language, in any form by any means, electronic, mechanical, magnetic, optical,
chemical, manual or otherwise, without the prior agreement and written permission of Horner APG, Inc.

All software described in this document or media is also copyrighted material subject to the terms and
conditions of the Horner Software License Agreement.

Information in this document is subject to change without notice and does not represent a commitment on the
part of Horner APG.

Cscape, OCS, SmartStack, SmartStix, SmartBlock, SmartRail, and CsCAN


are trademarks of Horner APG.
DeviceNet is a trademark of the Open DeviceNet Vendor Association (OVDA), Inc.
SDS is a trademark of Honeywell.
Ethernet is a trademark of Xerox Corporation.
CompactFlash is a registered trademark of SanDisk Corporation.
MicroSD is a registered trademark of SD-3C, LLC

For user manual updates, contact Technical Support:

North America:
(317) 916-4274
www.heapg.com
email: techsppt@heapg.com

Europe:
(+) 353-21-4321-266
www.horner-apg.com
email: techsupport@hornerirl.ie
Horner APG,LLC. ("HE-APG") warrants to the original purchaser that the Cscape Software manufactured by HE-APG is free from
defects in material and workmanship under normal use and service. The obligation of HE-APG under this warranty shall be
limited to the repair or exchange of any part or parts which may prove defective under normal use and service within two (2)
years from the date of manufacture or eighteen (18) months from the date of installation by the original purchaser whichever
occurs first, such defect to be disclosed to the satisfaction of HE-APG after examination by HE-APG of the allegedly defective
part or parts. THIS WARRANTY IS EXPRESSLY IN LIEU OF ALL OTHER WARRANTIES EXPRESSED OR IMPLIED INCLUDING THE
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR USE AND OF ALL OTHER OBLIGATIONS OR LIABILITIES AND HE-APG
NEITHER ASSUMES, NOR AUTHORIZES ANY OTHER PERSON TO ASSUME FOR HE-APG, ANY OTHER LIABILITY IN CONNECTION
WITH THE SALE OF THIS Cscape Software. THIS WARRANTY SHALL NOT APPLY TO THIS Cscape Software OR ANY PART THEREOF
WHICH HAS BEEN SUBJECT TO ACCIDENT, NEGLIGENCE, ALTERATION, ABUSE, OR MISUSE. HE-APG MAKES NO WARRANTY
WHATSOEVER IN RESPECT TO ACCESSORIES OR PARTS NOT SUPPLIED BY HE-APG. THE TERM "ORIGINAL PURCHASER", AS USED
IN THIS WARRANTY, SHALL BE DEEMED TO MEAN THAT PERSON FOR WHOM THE Cscape Software IS ORIGINALLY INSTALLED.
THIS WARRANTY SHALL APPLY ONLY WITHIN THE BOUNDARIES OF THE CONTINENTAL UNITED STATES.

In no event, whether as a result of breach of contract, warranty, tort (including negligence) or otherwise, shall HE-APG or its
suppliers be liable of any special, consequential, incidental or penal damages including, but not limited to, loss of profit or
revenues, loss of use of the products or any associated equipment, damage to associated equipment, cost of capital, cost of
substitute products, facilities, services or replacement power, down time costs, or claims of original purchaser's customers for
such damages.

To obtain warranty service, return the product to your distributor with a description of the problem, proof of purchase, post
paid, insured and in a suitable package.

ABOUT PROGRAMMING EXAMPLES


Any example programs and program segments in this manual or provided on accompanying drives are included solely for
illustrative purposes. Due to the many variables and requirements associated with any particular installation, Horner APG
cannot assume responsibility or liability for actual use based on the examples and diagrams. It is the sole responsibility of the
system designer utilizing Cscape Software to appropriately design the end system, to appropriately integrate the Cscape and to
make safety provisions for the end equipment as is usual and customary in industrial applications as defined in any codes or
standards which apply.

Note: The programming examples shown in this manual are for illustrative
purposes only. Proper machine operation is the sole responsibility of the system integrator.
TABLE OF CONTENTS
INTRODUCTION TO CSCAPE ................................................................................................................. 7
Quick-Start Guide .................................................................................................................................. 7
Objective .............................................................................................................................................. 9
Options for connecting Cscape to OCS ................................................................................................ 9
Connecting Cscape to OCS ................................................................................................................ 10
Cscape Setup ...................................................................................................................................... 11
Recommended Toolbars ..................................................................................................................... 12
Status Bar ........................................................................................................................................... 12
Cscape Help File ................................................................................................................................ 13
Getting Started ................................................................................................................................... 14
Controller Configuration .................................................................................................................... 15
I/O Configuration ............................................................................................................................... 15
The Scan ............................................................................................................................................. 16
Ladder Logic Basic Rules of Operation ............................................................................................. 16
Contacts and Coils .............................................................................................................................. 17
Starting a Program .............................................................................................................................. 18
Error Checking ................................................................................................................................... 18
Data Watch and Debug ...................................................................................................................... 19
Notes: ................................................................................................................................................. 20
CHAPTER 1 ............................................................................................................................................... 21
Basic OCS Configuration and Programming .................................................................................... 21
Objective ............................................................................................................................................ 23
Basic Configuration and Programming Overview ............................................................................. 23
Basic Programming Lab ..................................................................................................................... 23
Notes: ................................................................................................................................................. 35
CHAPTER 2 ............................................................................................................................................... 37
Screen Manipulation ............................................................................................................................ 37
Objective ............................................................................................................................................ 39
Screen Overview ................................................................................................................................ 39
Part 1 – Switching and Forcing .......................................................................................................... 39
Switching and Forcing Lab ................................................................................................................ 40
Part 2 – Changing the System Registers ............................................................................................ 41
Part 3 – Screen Jumps ........................................................................................................................ 41
Screen Jumps Lab............................................................................................................................... 41
Notes: ................................................................................................................................................. 45
CHAPTER 3 ............................................................................................................................................... 47
Timers and Counters ............................................................................................................................ 47
Objective ............................................................................................................................................ 49
General Function Operation ............................................................................................................... 49
Timers ................................................................................................................................................ 49
Counters ............................................................................................................................................. 50
Programming Lab ............................................................................................................................... 51
Notes: ................................................................................................................................................. 55
CHAPTER 4 ............................................................................................................................................... 57
More Programming Functions ............................................................................................................ 57
Objective ............................................................................................................................................ 59
Move Operations ................................................................................................................................ 59
Conversion Operations ....................................................................................................................... 59
Math Operations ................................................................................................................................. 59
Time and Date Operations.................................................................................................................. 60
Programming Lab ............................................................................................................................... 61
Notes: ................................................................................................................................................. 65
CHAPTER 5 ............................................................................................................................................... 67
Basic CsCAN Networking .................................................................................................................... 67
Objective: ........................................................................................................................................... 69
Overview: ........................................................................................................................................... 69
Part 1 - Analog Data Over CsCAN .................................................................................................... 69
Part 2 – Digital Data Over CsCAN .................................................................................................... 72
Part 3 – SmartStix .............................................................................................................................. 73
Notes: ................................................................................................................................................. 75
CHAPTER 6 ............................................................................................................................................... 77
Graphics Editor .................................................................................................................................... 77
Objective: ........................................................................................................................................... 79
Overview: ........................................................................................................................................... 79
Graphics Objects: ............................................................................................................................... 80
Graphics Editor Lab ........................................................................................................................... 83
Notes: ................................................................................................................................................. 86
CHAPTER 7 ............................................................................................................................................... 87
Graphic Alarms .................................................................................................................................... 87
Objective: ........................................................................................................................................... 89
Graphic Alarms Lab: .......................................................................................................................... 89
Notes: ................................................................................................................................................. 92
CHAPTER 8 ............................................................................................................................................... 93
Removable Media Functions ............................................................................................................... 93
Objective: ........................................................................................................................................... 95
Ladder Logic Lab ............................................................................................................................... 95
Automatic Data Logging Lab ............................................................................................................. 98
Removable Media File Naming ......................................................................................................... 98
Symbol Description Example............................................................................................................. 99
Removable Media File Counters ........................................................................................................ 99
Removable Media Program Downloads........................................................................................... 100
Removable Media Screen Capture Lab ............................................................................................ 101
Notes: ............................................................................................................................................... 102
CHEAT SHEET ....................................................................................................................................... 104
CONTACT SHEET .................................................................................................................................. 106
INTRODUCTION TO CSCAPE
Quick-Start Guide

MAN0827-07 17 April 2015 PAGE 7


Quick-Start Guide

PAGE 8 17 April 2015 MAN0827-07


Quick-Start Guide

Objective
The objective of this Quick-Start Guide is to generally familiarize a new user with the Cscape programming software
and how the OCS controllers process the Ladder Logic coding.

Options for connecting Cscape to OCS


MJ1 Serial
Every modern Horner OCS has a port labeled “MJ1”. It looks like an Ethernet jack, but it is really a compact serial port.
It serves as the long-standing way of connecting Cscape to an OCS through a PC’s COM port. Most of the time now,
PCs require a USB-to-Serial adapter in order to attain a COM port.
MJ2/MJ3 Serial
There are several “COM Options” available for XL-Series OCS that consume the MJ1 port for their functionality. Or,
there may be a need to use MJ1 for its communications functionality other than for Cscape. In these cases, a change
can be made on the controller, via the System Menu, to use MJ2 or MJ3 (depending on the controller) as a
programming port instead of MJ1
USB Direct
Many newer OCS controllers have a MiniUSB programming connection that can link the OCS directly to the PC’s USB
port. The OCS installs on the PC as a COM port device.
Ethernet
An increasingly common way to program OCS is over Ethernet if the controller is so equipped. Until an OCS has ever
had Ethernet configuration loaded to it, it has a default IP address of 192.168.254.128. This requires the PC to be
configured on the same subnet but at a different address than the OCS, i.e. 192.168.254.1. If connecting directly from
PC to OCS and not through an Ethernet switch, a reversing Ethernet cable may be required.
CsCAN
If OCS controllers are networked together via CsCAN, any of them may be programmed by connecting Cscape to any
other of them on the CsCAN network, using one of the methods mentioned above, and pointing Cscape to the correct
Target.
Cell Modem
Though it is not a very fast way of programming, the GSM modem option for XL-Series controllers allows the OCS to
be programmed remotely via the cell network. This does require a properly commissioned SIM card for the GSM
modem.
There are also external cellular modems on the market from other manufacturers that provide a fast cell connection
and can be connect to the OCS with an Ethernet connection. These work very well and are very fast, but can lack the
ability to send SMS messages like the Horner GSM modem can.
Phone Line Modem
Still an option.
Morse Code
Not an option.

MAN0827-07 17 April 2015 PAGE 9


Quick-Start Guide

Connecting Cscape to OCS


Install Devices and Drivers
If a serial programming connection is to be used and the PC has a real, 9-pin serial COM port, which is increasingly
rare, there is nothing to install assuming the port already works. All that is needed is a programming cable to go from
the COM port to the OCS programming port.
If a serial programming connection is to be used and the PC does not have a COM port, a USB-to-Serial adapter may
be used. Horner does sell the HE500USB600 USB-to-RS232 Serial Adapter, a brand labeled device that won out over
15-20 others in our testing to see which worked with Horner OCS the best. It does come as part of the HE-XCK and
HE-CPK programming kits. Drivers for it are normally found automatically by the Windows operating system as long
as an internet connection is established. Otherwise, the drivers may be loaded from the Horner FTP site at
ftp://ftp.heapg.com/USB Driver/.
If a direct USB connection is to be used, connect the MiniUSB port on the OCS (only on select models) to an open USB
port on the PC. (A cable for doing this is included in the HE-XCK and HE-CPK programming kits.) The OCS will install as
a device once plugged in. Drivers for it are normally found automatically by the Windows operating system as long as
an internet connection is established. Otherwise, the drivers may be loaded from the Horner FTP site at
ftp://ftp.heapg.com/USB Driver/. Windows 8 users may have to additionally change the PC settings to allow unsigned
drivers in order for this method to work.
Tell Cscape How to Connect
New installations of Cscape display the Connection Wizard every time you open Cscape. This can be disabled by un-
checking the “Show connection wizard…” option. The Connection Wizard may also be initiated via the Controller >
Connection Wizard menu option.

Select the method of connection and click “Next >>”. Depending on the method selected, relevant options will
display. See Lab 1 for further details.

NOTE: If using USB and your device does not


show up in the pull-down list, Windows doesn’t
see it! See the above section, “Install Devices and
Drivers”.

PAGE 10 17 April 2015 MAN0827-07


Quick-Start Guide

Cscape Setup
Since version 9.0 came out in late 2009, Cscape has had the option of an updated way of using toolbars. This manual
will exclusively reference this updated way of using Cscape. The settings for this are shown below.

This setup enables the Project Navigator and Project Toolbox, as well as enabling multiple Main Loop logic modules
and Subroutines. Toolbar button names may be displayed, but the buttons will take up much more space.

Code may be separated


into different sections

Often-used elements

Project Toolbox

MAN0827-07 17 April 2015 PAGE 11


Quick-Start Guide

Recommended Toolbars
The following toolbars are recommended. They may be selected from the View > Toolbars menu and are shown here
already docked under the menu row:

Status Bar
It is recommended that ALL users of Cscape make sure the Status Bar is turned on. It may be selected from the View >
Toolbars menu and is displayed at the bottom of Cscape.

1. Connection – How Cscape is connected to an OCS. An Ethernet connection is shown here.


2. User –Indicates which user is currently logged into the program via use of the Security features. If security is not
configured or if no one is currently logged in, this will indicate NONE.
3. Model – Lets the programmer know which unit the program is configured for and whether the configured model
is equal to the model that the PC is connected to. “XL6e – CsCAN Model Not Equal” seen here means Cscape is
configured for an XL6e, but what is actually connected is a different model of OCS.
4. Program Equality –Lets the user know if the logic in the OCS and the logic in Cscape are equal. If the status
indicates “Unknown”, the user might need to perform a “Verify” between the controller and the software. If it
indicates “Not Equal” as it does here, a download must be performed in order to make the OCS match what is
shown in Cscape.
5. Local and Target
 The Local ID indicates the CsCAN node ID of the OCS Cscape is directly connected to.
 The Target ID indicates the CsCAN node ID of the OCS that Cscape is trying to talk to.
 The Target ID does not need to match the Local ID. If programming is to be performed across the CsCAN
Bus, then the Target ID will be the node that will receive the download.
 The (R) indicates that the controller is in RUN mode. An (I) would indicate that the controller is in IDLE,
aka STOP mode. A (D) would indicate that the controller is in DO/IO mode. And, if a (B) is shown, it means
the OCS is Busy because Cscape or Envision software is trying to talk to it at that moment from
somewhere else. Only one copy of these softwares may talk to an OCS at once.
See Lab 1 for more information on the Local and Target area of the status bar
6. MOD – This area may be blank or show “MOD”. It indicates whether a change has been made to the program
since the program was last saved. Saving the program clears the MOD display.

PAGE 12 17 April 2015 MAN0827-07


Quick-Start Guide

Cscape Help File


The help file is the Cscape manual. Often, it is context sensitive. For example, if configuring a Timer function and
questions arise as to how it works, the F1 key on the PC may be pressed to bring up the help file directly to the Timer
section.
Double-Click the function to
configure…

Once in configuration, press


F1 for Help

MAN0827-07 17 April 2015 PAGE 13


Quick-Start Guide

Otherwise, the Help File is located under the Help > Contents menu in Cscape. The first screen has a lot of useful
information that is listed below.

In the main screen on the right:


 Cscape Reference Manual – This section allows the user to navigate to all of the information in the help file.
 What’s New in Version X.XX – This section will include all of the additions that were added to that particular
release of Cscape.
 Shortcuts to Control, Input/Output, Graphics, and Networking sections of the Help File

In the “Contents” tab on the left:


 Cscape Reference Manual – This section allows the user to navigate to all of the information in the help file.
 Creating and Editing Control Logic – This section does a multitude of things from the different ladder elements
to clearing out an old program.
 Creating and Editing Screens – This discusses how to create and manipulate the HMI portion of an OCS
program.
 Hardware and CPU Configuration – This section covers how to configure a controller and a quick reference to
a few of the I/O cards like the High Speed Counter, Stepper Module, and more.
 Networking and Communications – This section discusses the different aspects of the CsCan network and
serial communications.
 Manuals and Tech Support – Links and contact information for different Horner APG divisions around the
world.
 The User Interface – This describes some of the user features of Cscape and how to navigate through the
software.

Searches can be done by clicking on the Search tab above the left-hand table of contents.

Getting Started
There are 2 ways to create a new program. A new program will have a name of “Untitled” until the program is saved
as its file name.
1. Create a program under the File selection on the main menu
2. Create a new program by pressing the New File from the Tool Bar at the top of the screen.

PAGE 14 17 April 2015 MAN0827-07


Quick-Start Guide

There are 2 ways to save a program. All programs will be saved as the “filename”.csp
1. Save a program under the File selection on the main menu
2. Save a program from the shortcut on the Tool Bar at the top of the screen.

There are several ways to open a program.


1. Open the program under the File selection on the main menu.
2. Open a program from the shortcut on the Tool Bar at the top of the screen.
3. The program will automatically open if the program is double clicked on in the location where it is stored on
your PC.
4. Select a recently used program in the File menu
5. Drag and Drop a .csp file into an open Cscape program

Controller Configuration
Configuring a controller should ALWAYS be the first thing that is done for any new program. This determines what
features are available in Cscape and determines which screen editor to display. This can be done by accessing the
Controller > Hardware Configuration menu. If no controller is attached to the PC, the controller will default to the
XE102. If there is a controller attached to the PC and the target ID matches the local ID; the controller will match what
the PC is attached to. There are 2 ways to configure the controller.
1. Manually configure the controller by selecting the Series, then Device Type, and then the Model #. The Model
# will only display those models related to the “CAN1” Network Port selection below, so change the Network
Type if needed. The default is CsCAN unless specifically ordered differently.

2. Configure the controller from the Auto-Configure option. Keep in mind on existing programs that Auto-
Configure will erase I/O configurations that deviate from the default parameters. An example of this would be
in any application with an Ethernet configuration or one with a High Speed Counter that has been set up.
I/O Configuration
Configuring the I/O is done from the same place as configuring a controller. Other than the built-in I/O specifically
associated with XL-Series products and their part numbers, I/O is never automatically configured without the user
configuring it. Even with XL-Series products, the I/O must still be configured to suit the application if the application
calls for a setup different from what the default I/O settings are.

MAN0827-07 17 April 2015 PAGE 15


Quick-Start Guide

1. If the Auto-Config option is used, built in I/O and installed SmartStack I/O will be recognized. On OCS units with
I/O directly mounted to the main controller, the I/O will appear in the “Local I/O” tab with the controller. On OCS
units utilizing the FOX I/O system, the I/O will appear in the “FOX I/O” tab on the base where the I/O is connected.
2. If SmartStack I/O is manually configured, go to the position that the module is to be configured and click on the
Config button or double click on the position. Select
the appropriate module for the slot. The SmartStack
I/O is divided into groups based on what kind of I/O
it is.
3. If Network I/O is being used (SmartStix, SmartBlock,
SmartRail), it will not recognized by the Auto Config
function. It must be configured manually.
a. Configure CsCAN I/O (SmartStix, SmartBlock,
and CsCAN SmartRail) in the “CsCAN I/O”
tab. There may be two of these tabs
depending on the OCS because some OCS
controllers have 2 CAN ports.
b. Configure Ethernet I/O (Ethernet SmartRail)
in the “LAN I/O” tab. There may be two of
these tabs depending on the OCS because
some OCS controllers have 2 LAN ports.
Note: Ethernet I/O configuration requires a valid Ethernet configuration for the OCS to be in place,
complete with IP address on the same subnet.

After configuring I/O, be sure to click “OK” on the way out. Clicking “Cancel” will discard changes that have been
made.

The Scan
When the OCS is in RUN mode, it must be able to get through its entire scan in a fraction of a second to avoid a
“watchdog trip”, which will reset the controller. The controller will go through this process as fast as it can. Depending
on program size and processor speed, a single scan may take anywhere from a couple of milliseconds to nearly half of
a second. One Scan consists of the following:
1. Update all inputs; Physical I/O to %I and %AI registers, F-Keys pressed or released, touchscreen buttons
pressed or released, Protocol Configuration scan list “Read” items that have changed, etc.
2. Run through the entire program logic; Like reading a book from left to right, top to bottom. During this time,
none of the inputs updated above will change!
3. Update all outputs; %Q and %AQ registers to physical I/O, screen changes, new “Write” items for Protocol
Configuration
4. Repeat steps 1-3 until no longer in RUN mode or until power is lost.

Ladder Logic Basic Rules of Operation


Ladder Logic (or Relay Ladder Logic) is a graphical programming language based off of electrical relay drawings. It was
meant to make sense to the average electrician. While it has gotten much more complicated with customized
functions over the years, it still follows the same basic rules.
It may help to think of the far left side, with the rung and line numbers, as the Power Rail, and the far right side (which
is not shown in Cscape) as the Neutral or Ground connection.
As each rung of logic is evaluated in order, from left to right, each element determines whether power will pass
through it to the next element. If the element receives power from the left, and if a test of the element proves TRUE,
the element executes its function and passes power to the right.

PAGE 16 17 April 2015 MAN0827-07


Quick-Start Guide

For output coils, if power doesn’t make it all the way to the coil, it will actively turn off. For many other function
blocks, it just means they won’t be processed.
Keeping in mind the order of “The Scan”, an output may be turned on at the top of the program, then turned off at
the bottom of the program… while any contacts addressed to that output between those two parts of the program
will be true, the physical output would never turn on because that output coil was not on when the outputs were
processed at the end of the scan.
For this reason, the situation known as “Duplicate Coils” is generally not a good practice. Since coils are actively
turned off if they are not powered on, having more than one coil addressed to the same output can cause problems.
Due to the order of “The Scan”, the last one in the program will win. As noted below, the only time output coils
should be addressed the same as another coil is with Set and Reset coils.
Contacts and Coils
The simplest Ladder Logic elements, contacts and coils represent digital inputs and outputs. Contacts ALWAYS must
start a rung in Cscape. Coils don’t always have to be present, but they MUST be the last thing on the rung if they are
present. The different types of Contacts and Coils available in Cscape are as follows:
Normally Open (NO) Contact: Normally DOES NOT pass power in its OFF state. In this case, if a button
connected to the first digital input were pressed, this contact would close and pass power to the right.
Normally Closed (NC) Contact: Normally DOES pass power in its OFF state. In this case, if a button
connected to the first digital input were pressed, this contact would open and stop passing power to the
right.
Normally Open Coil: If this coil receives power from the left, it will turn on. In this case, a lamp on the first
digital output would power on and any Normally Open contact addressed to %Q1 in the program would
start passing power. Turns off as soon as it loses power from the left.
Normally Closed Coil: If this coil receives power from the left, it will turn OFF. In this case, a lamp on the
first digital output would turn off and any Normally Open contact addressed to %Q1 in the program would
STOP passing power. Turns on as soon as it loses power from the left.
Positive Transition Coil: A.K.A. a One-Shot. If this coil receives power from the left, it will turn on for exactly
one scan of the OCS, starting now. It will turn off exactly one scan from now when this coil is again scanned.

Negative Transition Coil: Another One-Shot, but this one will turn on for exactly one scan of the OCS when
it LOSES power from the left. It will turn off exactly one scan from now when this coil is again scanned.

Set Coil: When this coil gets power from the left, it will turn on and stay on, even if power from the left is
lost. It will stay on until a Reset Coil at the same address is fired.

Reset Coil: Used to reset the Set Coil above. In this case, %Q1 will turn off when powered from the left. Set
and Reset coils are really the only time when it is OK to assign multiple different coils to the same address.

MAN0827-07 17 April 2015 PAGE 17


Quick-Start Guide

Starting a Program
Starting a New Rung of logic is as simple as placing a contact on the screen. The user needs to place the contact in
column A for the rung to be properly terminated at the left-hand rail! Proper termination is indicated by a screw
terminal displayed next to the line number as well as a red rung number being present.

Properly Terminated; Screw terminal visible

Improperly Terminated; No screw terminal, will


cause error at download

To fix the improperly terminated rung shown above, right-click in the white area
next to the line number and select “New Rung”.

NOTE: If placing a parallel contact in column A, a branch must be placed first.


Otherwise, a new rung will start.

Branch Tool selected

Branch placed next to left rail


Branch Tool toggles a branch on or
off where clicked.

Error Checking
Cscape automatically runs an error check on downloads. The error check may also be run by clicking the Error Check
button in the toolbar.
There may be “Warnings”, which allow the user to continue anyway, or “Errors”, which do not allow the user to
continue. These will show up in a window at the bottom of Cscape.
Double-clicking on any entry should show where in the program the problem is. Fix errors from the top of the list first
as several errors may show for a single issue.
There is a separate error check for the Graphics Editor. It will show much more detail about screen or graphics errors
if there are any. If any errors on download show something to do with the screens, open the screen editor and run
the Graphics Editor error check from the toolbar there.

PAGE 18 17 April 2015 MAN0827-07


Quick-Start Guide

Data Watch and Debug


Data Watch enables the user to monitor and/or change values in a table format. Data Watch is selected from the
magnifying glass on the Toolbar or through selecting it from the Controller>Data Watch… menu. New fields are added
to Data Watch by clicking Add and then keying in the register and the type. Ranges of addresses can be added at one
time by using the notation ‘r15-25’, which would add 11 registers from %R15 through %R25. Up to 50 registers at a
time may be added this way.

Debug enables the user to monitor the program as it is operating in the OCS unit by showing the states of different
elements in red.

MAN0827-07 17 April 2015 PAGE 19


Quick-Start Guide

Notes:

PAGE 20 17 April 2015 MAN0827-07


CHAPTER 1
Basic OCS Configuration and Programming

MAN0827-07 17 April 2015 PAGE 21


Chapter 1: Basic OCS Configuration and Programming

PAGE 22 17 April 2015 MAN0827-07


Chapter 1: Basic OCS Configuration and Programming

Objective
The objective of this lab is to provide the knowledge to use Cscape to create a basic program including hardware
configuration, logic design, and screen development. This foundation will then be used to expand skills through the
rest of the training manual.

Basic Configuration and Programming Overview


When starting a new Cscape program, the first thing that should always be done is to configure the correct controller
and I/O. This determines where the inputs and outputs will be mapped for use in the program and will tell Cscape
which screen size to edit when screens are created.
INCORRECT I/O CONFIGURATION CAN CAUSE ALL OF THE I/O TO STOP WORKING!
After configuring the controller, programming can commence with I/O point naming, ladder logic editing and screen
creation.

Basic Programming Lab


Connect the OCS to a PC. This can be done several ways, two of which are listed here:
 Connect a PC USB port directly to a Mini-USB programming port if the OCS is equipped.
 Connect a PC Serial COM port to the MJ1 programming port using a programming cable. A USB-to-RS232
adapter may be needed since many modern PCs do not come with a COM port.
Note: The HE-XCK Programming Cable Kit comes with all cables mentioned above: USB, Serial, and USB-to-serial
adapter.
Power up the OCS and start Cscape on the PC. Connect the power supply to the OCS. Open the Cscape program on
the PC. A new, blank program called “untitled1” is automatically opened and the “Connection Wizard” displays.

Select the method of connection, click “Next>>”,


then select the proper connection.
Click “Finish” to initialize the connection.

MAN0827-07 17 April 2015 PAGE 23


Chapter 1: Basic OCS Configuration and Programming

Confirm Cscape is connected to the controller. In the status bar at the bottom-right hand side of Cscape, the status
bar shows the connection status. As a general rule, “?” question marks are not good.

 = WE’RE TALKING!!!
Cscape is physically connected “Local” to CsCAN ID 253 (all controllers come from the factory set to ID 253). Cscape is
also communicating with “Target” ID 253, which is the same as the physically connected controller.

 = We’re talking, but…


Cscape is pointed at the wrong controller! Cscape is physically connected “Local” to CsCAN ID 253, but is trying to
communicate with “Target” ID 1. For this lab, Cscape needs to be pointed at the same ID as the “Local”. Go to the
‘Controller>Set Target Network ID…’ menu option, then type in the number that matches the “Local” ID and click ‘OK’

 = NO COMMS!!! There is a connection problem or an adapter problem.

 = NO COMMS!!! There is a connection problem or an adapter problem.

Save the ‘untitled1’ program with a new name.


The first four Chapters of this manual will build on this same program. Go to the File>Save menu option and save the
file, i.e. Training1.csp. Make sure you can find the file later!

Configure the I/O


If using an OCS connected directly to an I/O simulator, the switches and lights on the simulator are plugged directly
into the I/O board on the back of the OCS.
If using switches and lights that are connected to a SmartStix or other remote I/O block, it will need to be configured
in order to work properly.
IMPORTANT!!! The Hardware Configuration MUST match the controller. Built-in and SmartStack I/O MUST match
what is actually there in order for ANY of the I/O to work. Network I/O (SmartStix, SmartBlock, SmartRail) will not
function if not configured.
IMPORTANT #2!!! The Hardware Configuration stays with the program, not with Cscape in general. Proper Hardware
Configuration MUST be done for EVERY NEW PROGRAM!

PAGE 24 17 April 2015 MAN0827-07


Chapter 1: Basic OCS Configuration and Programming

Open the Hardware Configuration in one of the 3 following ways:


Toolbar Menu Option Double-Click in
Button
Project Navigator

OR OR

If Cscape is already connected with the OCS when first opening the Hardware Configuration, the controller will
already be configured. If the controller doesn’t match, use the ‘Auto Config System’ button. Clicking it will
automatically configure the controller and any attached I/O as long as Cscape is connected to the OCS properly. If this
is the case, skip to Step 6 after Auto Config is done.
If using I/O connected to a SmartStix or other remote I/O device, click the corresponding I/O tab and add the device.
Most of the time, CsCAN I/O devices used for this training session are set to ID 3, but check the rotary switches on the
device to be sure.
Pro Tip: Starting remote I/O addressing at %I401 and %Q401 is handy because it is on a Word Boundary, which is
required, it’s a nice, round number, and it is well out of the way of any built-in I/O.

MAN0827-07 17 April 2015 PAGE 25


Chapter 1: Basic OCS Configuration and Programming

Hardware Configuration can be done manually:


(Skip these steps if Auto Config has been done)
1. For Controller Series, select XL Series.
See Hardware Configuration screen
2. For Device Type, select XL6e.
on previous page
3. For Model #, select HEXL1E2.

View I/O Addresses.


4. Click the Local I/O tab to view the controller and its I/O

5. Click on the Config button next to the HEXExx2 I/O and note the addressing map of the physical I/O points. These
will be used in the program.

6. Click OK, then click OK again to exit the Hardware Configuration.

PAGE 26 17 April 2015 MAN0827-07


Chapter 1: Basic OCS Configuration and Programming

Save the program.


Either click the ‘Save’ button on the toolbar , or click on the File menu and select Save.

Name some I/O points.


Naming I/O points allows programming of elements using an easier-to-remember name instead of trying to
remember the correct address.

Click on the Program menu and select I/O Names. Note the existing default entries, like the F-keys and System Bits
and System Registers. These default entries can all be changed if desired.

Add I/O points by clicking the ‘Add’ button and filling in the information.
Edit an existing I/O point by finding it in the list and double-clicking it.

Add or edit the following I/O points:


Add %I01 E_STOP – Configure for 1-bit
Add %Q1 RUN – Configure for 1-bit
Edit %K1 START - %K1 is named ‘F1_KEY’ by default so it will need to be edited instead of added. Configure for
1-bit.
Edit %K2 STOP - %K2 is named ‘F2_KEY’ by default so it will need to be edited instead of added. Configure for
1-bit.

Once the I/O names are entered and edited, click the OK button to exit the I/O names.

MAN0827-07 17 April 2015 PAGE 27


Chapter 1: Basic OCS Configuration and Programming

Write the program.


This is a program that will turn on an output when the START button is pressed and will hold itself on with a “holding
contact”. The output is turned off if either the STOP button or the ESTOP switch interrupts power to the output.
Whether all program elements are placed first and addressed later, or placed and addressed one at a time, is up to
the programmer. The method shown here places all of the elements, then addresses them.
1. Select and drop the three normally
open contacts.
2. Select and drop the normally closed
contact.
3. Add the vertical connecting branches.
4. Select and drop a normally open coil.

Add the element names.


1. Double click on an element in the
rung.
2. Address the elements as shown in the
finished program below:
a. Select the I/O Name from the
drop-down list
b. Or, type the address, like “i1” or
“k2”.
3. Click OK. Repeat for all elements.

Note how the contacts that have been assigned to the function keys are now shaped like buttons.

Save the program.


Either click the ‘Save’ button on the toolbar , or click on the File menu and select Save.

PAGE 28 17 April 2015 MAN0827-07


Chapter 1: Basic OCS Configuration and Programming

Display data on the screen.


1. Open the Graphics Editor window.
Toolbar Menu Option Double-Click in
Button Project Navigator

OR OR

2. Uncheck the ‘Snap To Grid’ buttons on the Graphics Editor toolbar. This will make it much easier to move
things around the screen. Their function will be covered in a later chapter.

MAN0827-07 17 April 2015 PAGE 29


Chapter 1: Basic OCS Configuration and Programming

3. Show the state of the RUN circuit that was programmed on the screen using a Text Table data field.
This will be done with a Text Table. A Text Table is a data field that links less meaningful numeric data to more
meaningful text. The RUN output is just a number, 0 or 1, which doesn’t mean much to the machine operator.
Here, the Text Table will be used to display “STOPPED” or “RUNNING” instead of 0 or 1.

Find the Text Table button on the toolbar .


Click on it once to select it. Use the mouse to drag out
a square text table on the screen. Note that it comes
default with a border and a legend that says “Text
Table”.
4. Double-click on the Text Table object to configure it.
Select a Register Width of 1-bit to filter the Name box
by 1-bit names.
5. Link this Text Table to the RUN output. Select “RUN”
from the Name pull-down list. Or, type “Q1” into the
Address box.
Note: There are 200 text tables to use per program. A
text table is not linked to only one register, the
registers are linked to a text table. It’s just a lookup
table for any register to reference. For example, a text
table containing “OFF” and “ON” for the values 0 and 1
can be linked to, multiple times, by different registers
on the same or different screens, all of which can be
displayed as “OFF” for a value of 0 or “ON” for a value
of 1.
6. Click the ‘Text Table’ button about halfway down the
configuration window to bring up the text table editor.
7. Note in the upper right that table 1 is being edited. Click
the ‘Add’ button and link the value of 0 to the text
“STOPPED”. Click ‘OK’ and note the entry in the text table.
8. Click the ‘Add’ button again and link the value of 1 to the
text “RUNNING”. Click ‘OK’ and note the entry in the table.
9. Click ‘OK’ again to exit the text table editor. Note that
whichever text table is visible when ‘OK’ is clicked in the
text table editor is the one that will be linked to this Text
Table data field.
10. Back in the Text Table Data Properties window, in the
Digits area, make sure there are at least 7 “digits” specified (‘RUNNING’ and ‘STOPPED’ both have 7 letters) or the
text will get cut off.
11. In the Data Format section, change the Font to a larger size. This is the size of the data itself. The legend is
separate.
12. Click the ‘Legend’ button at the bottom. Change the legend text to say “MACHINE”. Change the font size of the
legend to something larger. Match the size of the data if desired. Click ‘OK’ when finished.

PAGE 30 17 April 2015 MAN0827-07


Chapter 1: Basic OCS Configuration and Programming

13. Click ‘OK’ again to exit the configuration window. Resize and move the text table data field if needed to show all
of the data.

Below is what the screen may look like.


What the screen looks like exactly is completely up to the designer. Make it huge, make it tiny, make it bright orange
if desired.
Note: The “TTTTTTT” shown for the Text Table is just a place holder for where the data will actually go.

14. Once satisfied with the look of the screen, close the Graphics Editor window by clicking on the X at the top right of
the window. Changes are automatically saved.

Save the program.


Hopefully it is known how to do this by now.

MAN0827-07 17 April 2015 PAGE 31


Chapter 1: Basic OCS Configuration and Programming

Download the program to the OCS.

Choose a way of downloading.


Toolbar Menu Option Right-Click the program in Project
Button Navigator

OR OR

If there are no errors with the program, the download window will display.

Note: It is not required to take the OCS out of RUN mode before downloading
a program. The download will place the controller in STOP mode, download
the program, and then return the OCS to the mode it was in before the
download.

If there ARE errors, view them by double-clicking entries in the error list. Fix
the first ones in the list first, they may be related to items further down the
list.

1. Use the SmartLoad function when the Download dialog box appears. SmartLoad only loads parts of the program
that have changed since the last time the program was downloaded.
2. Click ‘OK’ and wait for the download windows to finish. The OCS will also display progress.
3. Once downloaded, make sure the OCS is in Run mode (the green traffic light on the toolbar is pressed in).

PAGE 32 17 April 2015 MAN0827-07


Chapter 1: Basic OCS Configuration and Programming

Debug the program.


Place Cscape in Debug mode.
Toolbar Menu Option Right-Click the program in Project
Button Navigator

OR OR

This allows the state of the different program elements to be displayed in Cscape in real-time. Contacts and coils will
show power flow. Numeric data will display if available.

Close switch 1 on the I/O Simulator.


Switch 1 is connected to the first digital input, which is addressed to %I1 if directly connected, %I401 if connected
through a SmartStix or other remote I/O.
 In Cscape, using Debug, E_STOP & STOP should now be red.
 On the OCS, the screen should display MACHINE STOPPED.
Push the F1 key on the OCS.
 While pushing F1 on the OCS, watch it in Cscape Debug… START should turn red until the F1 key is released.
 The RUN coil and contact should both turn red.
 On the OCS, the screen should display MACHINE RUNNING.
 Output 1 should turn ON. This is represented by the first LED on the I/O Simulator.
Push F2, the ‘STOP’ button, on the OCS.
 The output should turn OFF
 The screen should show MACHINE STOPPED.

MAN0827-07 17 April 2015 PAGE 33


Chapter 1: Basic OCS Configuration and Programming

Experiment with the different aspects of the program.


 Press F1 to start the circuit again.
 Use the E_STOP switch to stop it instead of F2.
 Try starting the circuit without first closing the E_STOP switch… does it work?

Note: Debug mode must be exited before changing any programming. Many options will be “greyed out” during
Debug.

CONGRATULATIONS!
Chapter 1 is finished. Now move on to Chapter 2 and learn additional skills.

PAGE 34 17 April 2015 MAN0827-07


Chapter 1: Basic OCS Configuration and Programming

Notes:

MAN0827-07 17 April 2015 PAGE 35


Chapter 1: Basic OCS Configuration and Programming

PAGE 36 17 April 2015 MAN0827-07


CHAPTER 2
Screen Manipulation

MAN0827-07 17 April 2015 PAGE 37


Chapter 2: Screen Manipulation

PAGE 38 17 April 2015 MAN0827-07


Chapter 2: Screen Manipulation

Objective
Demonstrate several different methods used to manipulate screens through ladder logic and/or through the “Screen
Jump” object in the Graphics Editor. This is how the programmer will determine when any given screen will be
displayed.

Screen Overview
When using Horner graphics-based controllers, there are 1023 screens to use in the program. These screens are all
there already, just blank and waiting for the programmer to put things on them. There is not a built-in way of scrolling
through these screens in graphics-based controllers once the program is downloaded, so screen manipulation must
be done either through ladder logic or through objects in the Graphics Editor… or through a combination of both.
When writing a program, planning is needed to determine what screens need to be seen and when they need to be
seen. Many times, a dedicated alarm screen is used so that, when the alarm occurs, the alarm screen can be forced
on. Or perhaps there is a main menu screen that has links to configuration and data monitoring screens.
Horner OCS uses dedicated %D bit-length registers that are numbered the same as the screen they represent. %D1 is
for screen 1, %D312 is for screen 312, and so on up to %D1023 for screen 1023. They can be addressed to an output
coil to switch to or force a screen. They can also be addressed to input contacts to indicate when a particular screen is
currently being displayed.
There are also three system registers that reflect exactly what the display is currently doing. These registers are the
%SR1 User Screen register, the %SR2 Alarm Screen register, and the %SR3 System Screen register. The numbers in
these registers reflect the number of the screen currently displaying. %SR2 takes priority over %SR1 and %SR3 takes
priority over %SR2. %SR1 should always have a number between 1 and 1023 and never be zero. %SR2 and %SR3
normally show zeroes unless a screen is being forced or a system screen is being displayed, in which case they show a
non-zero number.

Part 1 – Switching and Forcing


%D registers can be used as output coils to control screens. To do this, simply place a normally open coil in the ladder
logic and then configure it for a %D register. This can be done by typing a %D reference directly into the address box
or by clicking the ‘Screen >’ button to choose a screen from thumbnail pictures of configured screens.
When configuring a coil for a %D register, the configuration box changes to account for some additional options.
From this configuration box, there is the added ability to click the ‘Edit Screen…’ button and go directly to the
Graphics Editor for the screen specified. There is also an option of using this coil to Force the screen or Switch the
screen.
When forcing a screen, the screen will be forced to display for as long as the coil has power. The screen number of the
screen being forced will also be reflected in %SR2… note the reference to %SR2 next to the Force Screen option. If a
screen is forced, the value in %SR1 is not affected and stays the same as it was. When the screen is no longer forced,
the controller will return to the screen reflected in %SR1. For example, if screen 51 is being displayed and an alarm
occurs that forces screen 20, %SR1 will have a value of 51, %SR2 will have a value of 20 and screen 20 will be
displayed. When screen 20 is released from its force, %SR1 will still have a value of 51, %SR2 will have a value of 0 and
screen 51 will be displayed.
When switching a screen, the screen specified by the %D register will be switched to and will continue to display even
after power to the coil has been lost. This change is reflected in %SR1… note the reference to %SR1 next to the Switch
Screen option. For example, if screen 51 is being displayed and the screen is switched to screen 30, the value in %SR1
will change from 51 to 30 and screen 30 will be displayed.

MAN0827-07 17 April 2015 PAGE 39


Chapter 2: Screen Manipulation

Switching and Forcing Lab

1. Add to the program from Chapter 1. Open the Graphics Editor (click on the toolbar… or from the Screens menu,
select View/Edit Screens…).

2. Screen 1 already has a text table on it to show Machine status. Navigate to Screen 2 and place a Static Text label
that says “Screen 2”.
Note: In the Graphics Editor, the screen currently displayed in the editor is indicated in the status bar at the bottom
right of the screen…

The asterisk indicates that this is the Initial Screen, the one that shows up when the OCS is first turned on or put into
RUN mode.
To navigate to different screens in the editor, use the arrow keys or the thumbnail selector in the
toolbar…
3. Navigate to Screen 3 and place a Static Text label that says “ESTOP ERROR”. Make it attention-grabbing colors if
desired.
4. Once finished creating the screens, exit the Graphics Editor and save the program.
5. Add ladder logic so that the F3 key will SWITCH to Screen 1 and the F4 key will SWITCH to Screen 2. Note that when
configuring the coil, clicking the ‘Screen>’ button will bring up a screen thumbnail selector. A screen to associate the
coil with may be chosen from the thumbnails shown. The %D address will automatically fill in this way.
6. Add ladder logic so that an ESTOP button trip from Chapter 1 will FORCE screen 3. The program should look similar to
what is shown below. Note how the coil symbols have changed into a thumbnail version of what is on that particular
screen specified for that particular coil.

Note that the ESTOP contact is normally closed. Since it needs to be turned ON to be “good” and to work for Chapter
1, it is going to be “bad” when it is turned off. It will force Screen 3 to display as an alarm to this condition.
7. Save and download the program to the controller. Observe the program in action.
Screen 1 should display after the program is downloaded. Press the F3 key and note how the switch screen works.
Press F4 to switch back to screen 1. Trip the ESTOP switch and watch how screen 3 is forced for as long as the switch
is tripped. When the ESTOP button is turned back on, the screen previously viewed will come back up. Try tripping the
ESTOP switch from either screen 1 or screen 2 to see how it reverts to the previously viewed screen.

PAGE 40 17 April 2015 MAN0827-07


Chapter 2: Screen Manipulation

Open a Data Watch window in Cscape by clicking on the magnifying glass next to the debug button. Add %SR1
and %SR2 as INT values to watch the system registers and what they do when the buttons are pressed.
Note: More than one value may be added at a time to the Data Watch window by clicking the ‘Add’ button and typing
in ‘SR1-2’ or ‘R51-75’, for instance.

Part 2 – Changing the System Registers


Though there is no lab portion on this method, another way of displaying a screen is to directly move a value into one
of the screen system registers. Using a Move function (Move functions are gone over in an upcoming lab), a value
representing the screen number can be moved to %SR1 to switch the screen.
Cscape programming does not allow the user to write a value to %SR2 to change the screen. To turn on Alarm
Screens (%SR2), either the %D coil for that screen will need to be specified as ‘Force Screen’ or the logic Alarm
handler can be used.

Part 3 – Screen Jumps


One way of letting a user change screens from the screen itself without involving any ladder logic is to use Screen
Jumps. This is an object that is placed on the screen just like any other object or data field on the screen. A screen
number is specified as the screen to jump to.
When configuring a Jump Screen, there is an option to “Allow ESC to Return”. With this option checked, using the
jump keeps the last page on an internal memory stack so that it can be recalled. Pressing the ESC key will recall the
page from which the current page was jumped to. On touch-screen controllers that don’t have an ESC key built in, a
screen jump can be configured with the option to “Simulate ESC”. Up to 16 “layers” can be recalled in order to back
up through a menu system.
Note: When mixing Screen Jumps and Ladder Logic control of screens, the “Allow ESC to Return” memory stack may
not always survive when the ladder logic switches or forces a screen. Be careful!

Screen Jumps Lab


PROGRAMMING SPE CIFICATION
Create a button on screens 1, 2, and 4 that takes the user around these three
screens in a circular fashion. This will allow our user to scroll through these
three screens quickly as needed.

Create a “Settings” page on screen 6. It should be accessible from screens 1,


2, or 4. An “Exit” button should return the user to the same screen from which
they pressed the “Settings” button.

1. Open the Graphics Editor. On screen 1, add a Screen Jump to go to screen 2. Do NOT check the “Allow ESC to
Return” option. Change the Legend to reflect what the button does.
2. Taking both items of the spec into consideration at the same time, add another Screen Jump that will take the
user to the “Settings” screen on screen 6, even though there aren’t really any settings at the moment. Make sure
that the “Allow ESC to Return” box IS checked. This will allow a return to this screen if the settings screen is
accessed from this screen.

MAN0827-07 17 April 2015 PAGE 41


Chapter 2: Screen Manipulation

Screen 1 may end up looking something like this:

Note: the Screen Jump objects shown here have the Display Style
set to “3D Button Style”. They also have different icons than
default selected under “Attributes”.
These options do require firmware 14.06 or higher!

3. Use the Group Selector tool and copy the two Screen Jump objects.
Pro Tip: In Cscape 9.60 and newer, it is possible to click on one object, then hold down the Ctrl button and click on
others to select multiple objects.
4. Navigate to screen 2 and paste the copied buttons. Change the target and legend of the one to reflect a jump to
screen 4 instead of screen 2.
5. Add a Static Text label to denote that this is Screen 2.
6. Copy this entire screen (Ctrl-A is the Microsoft shortcut for “Select All”; Ctrl-C is for “Copy”. Both work in Cscape.)
7. Navigate to Screen 4 and paste everything there. (Ctrl-V is the Microsoft shortcut for “Paste”.) Change the Static
Text to denote that this is Screen 4. Change the target and legend of the one Screen Jump to reflect a jump back
to screen 1 instead of screen 4.
8. Navigate to Screen 6 and add a Static Text label reading “Screen 6” as done with the other screens.
Note: Screen 5 is skipped simply to illustrate that it is not required to use consecutive screens. Screen 5 is still
there, it is blank, it isn’t being used.
9. On Screen 6, add a Screen Jump. This will be the “Exit” button. It will not have a specific target but will instead be
checked to “Simulate ESC”. Change the legend to indicate “Exit”.
The screens may end up looking something like this:

PAGE 42 17 April 2015 MAN0827-07


Chapter 2: Screen Manipulation

Screen 6, the “Settings” screen, may resemble this:

10. Exit the Graphics Editor and save the program.


11. Download the program to the controller and test it out.
From Screen 1, press the Screen Jump to go to screen 2, then to screen 4 and back to screen 1. On any of those
screens, press the Screen Jump to go to screen 6. When screen 6 is displayed, pressing the “EXIT” button should
return to the screen where the “Settings” button was pressed. The controller remembers where it was since the
“Allow ESC to return” option was checked on the “Settings” button.
If any of this does not work, double-check all of the settings in each Screen Jump that was configured.

Extra Credit #1 – Lock the System Menu


Note: This requires the use of Move and Comparison functions that have not yet been covered in the lecture. The
solution is on the next page.
On non-touch-screen controllers, pressing the up and down arrows simultaneously gets into the system menu. Touch-
screen controllers have a System key on the keypad.
Add ladder logic to the program to lock out the System key on the controller. %SR3 contains a number reflecting the
system screen currently displayed. If none is shown, %SR3 contains a 0. But a value can also be moved into %SR3 to
either force a system screen or exit the system menu.
Monitor %SR3 for a non-zero value and, if it is non-zero, move a zero back into it. Use a compare function to compare
the value to zero. Compare functions will pass power to the rest of the rung if they are true.
One possible solution is on the next page.

Extra Credit #2 – Password-Protect the System menu


Add some code so that the correct password must be entered into a data field on the screen before the system menu
can be displayed.
Either make the System button function properly once the password is entered, or automatically display the main
System Menu once the password is entered correctly.
One possible solution is on the next page.

MAN0827-07 17 April 2015 PAGE 43


Chapter 2: Screen Manipulation

Extra Credit #1 Solution:

Extra Credit #2 Solution:


This is ONE way to accomplish Extra Credit #2. Additionally, place a DINT data field or a Password field on the screen
where the password can be entered. Use Datawatch to change the saved password in %R3. Note the use of DINT data
for the password-related functions.

PAGE 44 17 April 2015 MAN0827-07


Chapter 2: Screen Manipulation

Notes:

MAN0827-07 17 April 2015 PAGE 45


Chapter 2: Screen Manipulation

PAGE 46 17 April 2015 MAN0827-07


CHAPTER 3
Timers and Counters

MAN0827-07 17 April 2015 PAGE 47


Chapter 3: Timers and Counters

PAGE 48 17 April 2015 MAN0827-07


Chapter 3: Timers and Counters
Objective
Learn about how Cscape programming functions operate in general, and use the Timer and Counter functions.

General Function Operation


Continue to think of a Ladder Logic program as an electrical diagram. Think of programming functions as an electrical
device; if you apply power to the electrical device, it executes its function. Programming functions have a power
input, which is the connection to the logic rung on the left. They also have one or more input parameters, also shown
on the left, which is data the function will act upon. The function has a power outlet that will pass the power on to the
next function, but only if this function is successful, or “True”. Additionally, some functions will have results outputs
and/or status outputs, shown on the right side of the function.
A sample rung shows several different functions and how they act differently depending on their function:

COMPARE FUNCTION MATH FUNCTION TIMER FUNCTION


Does %R1 = %R2? Does %R3 + %R4 fit Wait 5 seconds after
If YES, power output into an INT data type? receiving power, then
If NO, no power output If YES, power output turn on power output
and put result in %R5
If NO, no power output MOVE FUNCTION
Move the data as specified,
then fill the output register
- Functions will execute if power reaches them from other functions. and turn on power output
- Most functions will do nothing if power doesn’t reach them.
- One important exception: An output coil will turn off if power does not reach it!

Timers
The default, 16-bit Horner timer consumes 2 consecutive word-length registers, normally %R registers (don’t use %T!).
This means assigning a timer to %R1 will use both %R1 and %R2. The first of the two registers contains the
accumulated time of the timer. The second register, which contains “housekeeping” information so that the timer can
keep track of where it is, should not be tampered with. However, the last 2 bits of the second register are status bits
for the timer. The 15th bit of the second word is an “Enabled” status for On-Delay timers. The 16th bit of the second
word is a “Done” status and matches the power output of the timer. If desired, they may be addressed individually.
For example: %R2.15 or %R2.16.
A 32-bit timer is also available and takes 3 consecutive word-length registers. The first two registers together contain
a double-integer (DINT) accumulator for the timer. The 3rd register is the same “housekeeping” register noted above.
Timers have one of four resolutions; 1-millisecond, 10-millisecond, 100-millisecond, or 1-second. The resolution
determines what units the Preset Time (PT) is in. For example, a timer with 1-second resolution and a PT of 30 is a 30-
second timer and the accumulator will count from 0-30 seconds. The same timer, but set to 10-millisecond resolution,
would be a 300-millisecond timer and each count of the accumulator would represent 10 milliseconds. In other
words, Timer Resolution x PT = Timer Length.
There are On-Delay timers (TON), Retentive On-Delay timers (TON_R), and Off-Delay timers (TOF).
 When a TON timer receives input power, the accumulator starts. If power to the input is lost at any time, the
accumulator is reset to zero. If input power remains until the accumulator reaches the Preset Time, the timer
output is turned on and the accumulator stops at the Preset Time.

MAN0827-07 17 April 2015 PAGE 49


Chapter 3: Timers and Counters
 The TON_R timer additionally requires a Reset input to be configured, which can be any bit-length register.
When a TON_R timer receives input power, the accumulator starts. If power to the input is lost at any time,
the accumulator remains where it was when power was lost. If input power remains until the accumulator
reaches the Preset Time, the timer output is turned on and the accumulator stops at the Preset Time. The
Reset must be turned on in some way to reset the accumulator to zero.
 The TOF timer output is turned on immediately upon receiving input power. When input power is lost, the
output power remains on and the accumulator starts. If input power is reapplied at any time, the accumulator
resets to zero. If input power is lost until the accumulator reaches the Preset Time, the timer output is turned
off.

Counters
Just like timers, the default, 16-bit Horner counter consumes 2 consecutive word-length registers, normally %R
registers. The first of the two registers contains the accumulated count of the counter. The second register, which
contains “housekeeping” information so that the counter can keep track of where it is, should not be tampered with.
However, the 16th bit of the second word is a “Done” status and matches the power output of the counter.
A 32-bit counter is also available and takes 3 consecutive word-length registers. The first two registers together
contain a double-integer (DINT) accumulator for the counter. The 3rd register is the same “housekeeping” register
noted above.
Counters have a Preset Value (PV) that must be configured which determines when the counter will turn on its output
power. Counters must also have a bit-length reset configured, which is used to reinitialize the counter. Counters are
“positive transition” functions, denoted by the triangular symbol on the input power from the rung. This means a
counter will count only one time when input power is applied. Input power must be turned off, and then turned back
on for the counter to count again.
There are Count-Up counters (CTU) and Count-Down counters (CTD).
 When a CTU receives input power, the accumulator is incremented by one. If the accumulated value reaches
the PV, output power is latched on, regardless of input power. Additional input power pulses will continue to
increment the accumulator. When the reset input is triggered, the accumulator is reset to zero and the output
power is turned off.
 When a CTD receives input power, the accumulator is decremented by one. If the accumulated value reaches
zero, output power is latched on, regardless of input power. Additional input power pulses will continue to
decrement the accumulator. When the reset input is triggered, the accumulator is reset to the PV and the
output is turned off.

PAGE 50 17 April 2015 MAN0827-07


Chapter 3: Timers and Counters
Programming Lab
Continue to add to the program from Chapter 1 and Chapter 2, but put this Chapter 3 code in a separate Main Loop.
Name the loop whatever you want to name it… for instance, “Chapter3”.

PROGRAMMING SPECIFICATION for CHAPTER 3 :


1. Count and display the total number of times the machine has been started.
Digital Input 4 should reset this displayed count.
2. Require the START button to be pressed and held for 3.0 seconds in order to
start the machine. Display the time held in tenths of a second.

3. Disable START button if machine has been started 3 t imes to disallow further
starts until re-enabled .

4. Require user to hold down a momentary touchscreen reset button for 5 seconds
when machine is not in run in order to re-enable Machine START functionality.

5. Display the number of Machine Starts remaining before START is disabled.


6. Display the time the reset button has been held down.
7. Add a Machine Run Timer so that we are able to keep track of how long our
motor has been in service. Display RUN hours and minutes on the screen.
8. Please comment all code so that our field service personnel can troubleshoot.

From the programming spec, Item 1 can be accomplished using a Count-Up counter. It can be triggered from the RUN
output of our machine’s start-stop circuit. Digital input 4, one of the switches on the input simulator, needs to zero
the count. Address the counter to %R1. Why %R1? Because %R1 and %R2 are currently unused word-length registers,
which is what a counter requires. %R842 could just as easily be used, but let’s keep it simple and use %R1. Name the
%R1 point within the counter configuration, call it “StartsCounter”. Name the reset input “Input4” in the same way.

Note: If the Extra Credit from Chapter 2 was done, make sure
registers from that code do not interfere with registers here!
Specifically, if %R1 was used as a password field in password-
protecting the System Menu, different, unused registers will
need to be used for this timer!

MAN0827-07 17 April 2015 PAGE 51


Chapter 3: Timers and Counters

Item 2 may be handled with a timer. There is more than one way to accomplish this. To keep “code scatter” down, the
timer may be placed directly in the same rung as the original start-stop circuit as another condition to be met in order
to start the machine. Since the spec calls for resolution down to the tenths of a second, use a timer with 100ms
resolution. Address the counter to %R3. Why %R3? %R1 and %R2 are being used by the previous counter, so those
can’t be overlapped. %R3 and %R4 are not being used by anything else, so use %R3.

Note: Again, if the Extra Credit from


Chapter 2 was done, make sure
registers from that code do not
interfere with registers here!
Specifically, if %R3 was used as a
password field in password-protecting
the System Menu, different, unused
registers will need to be used for this
timer!

Back in the new code loop, items 3-6 will be taken care of with a Count-Down counter and a timer, along with some
contacts and coils. Use a %T for the reset input, which will get tied to a pushbutton on the screen and a timer in the
code. Put another %T coil after the counter, which will be used to disable the START button. Why %T registers?
Because they are internal bit-length registers that are meant for just this sort of thing.

To re-enable the START functionality after it has been disabled, the Count-Down counter must be reset. The spec calls
for a touchscreen button being held down for 5 seconds to reset, but only if the machine is not running. When the
button is eventually placed on the screen, it will be addressed to %T3. The timer will fire an output that corresponds
to the reset trigger for the above counter.

PAGE 52 17 April 2015 MAN0827-07


Chapter 3: Timers and Counters
Once again in the main code loop, the START button should be disabled with the result of the code that was just
written… not the whole circuit, just the START button. Place a normally closed contact so that it only affects the START
button’s operation. This allows the START button to operate until this contact opens up due to the counter passing
power to the %T2 coil.

In the spec, Item 8 calls for a Machine Run Timer. That’s pretty easy, but this machine will be in service for a long
time, it is hoped. A default, 16-bit timer set to its largest, 1-second resolution tops out at 32767 seconds.
32767 / 3600 seconds per hour = 9.1 hours. So, this needs to be a 32-bit timer, which will top out at 2,147,483,648
seconds. That’s 24,855 hours, or a little over 68 years. That should be enough.
Place a 32-bit timer triggered off of the RUN output. Make sure it is a Retentive timer so that it doesn’t lose its place
when the machine is not in RUN. Set the PT to some large number, because we’re not going to test this for 68 years.
The Reset input here is set to system bit %S8, “Always Off”, so that it will never get reset to zero.

Something that should always be done, not just because it is called for in this program spec, is code comments. Not
only does it make someone else’s life easier when troubleshooting code, it can help the original programmer 5 years,
or even 5 months from now. Comment each rung or groups of rungs.
One way to do this is to select the Comment tool from the buttons to the left of the program window, then
clicking on a rung. This will move the rung down and create a comment, which may then be double-clicked to change
the comment text.
Another way to insert a comment is to right-click in the white, left power rail where there is not a rung already
present and selecting “New Comment” from the menu that appears.

MAN0827-07 17 April 2015 PAGE 53


Chapter 3: Timers and Counters
Now that the logic part is done, add the requested information to the screen for display. On screen 1:

Use the Timer Data Field to display the


Run Hours. Match its configuration with
the Run Hours Timer… 32-bit data
addressed to %R9, 1-second resolution.
The field here is set to display only Hours
and Minutes.

Use a Numeric Data Field to display the


Machine Starts, Starts Remaining, and the
Reset Hold time.
Pro Tip: Using a Numeric Data Field to
display the Reset Hold time in this case,
instead of a Timer Data Field, allows
display of just 2 digits, which is all that is
needed here. A decimal place can be faked
so that the timer accumulator, which goes from 0 to 30 tenths of a second, will display as 0.0 to 3.0 seconds. It also
allows for the Engineering Units to be used to display the “s” after the time. (Continued on next page…)

Use a Switch as the RESET button. Address it to %T3. Make sure the switch Action is Momentary. The Switch Type
shown here is selected as “3D Button Style”, the Legend text has been deleted, and the Indicator Properties have
been changed to show RESET as the indicator text and color indicator selections other than the default grey.
Download the program, then test it out and make sure it meets the required programming specification

Extra Credit
When the program was tested out, it should have been noted that the Reset button had to be held down to reset the
START button before the machine was started the very first time. This is because a Count-Down counter does not
automatically know to reset itself the very first time it is used.
Find a way to use the system bit %S1, which is the First Scan bit, to initialize the Count-Down counter. %S1 is a one-
shot pulse that comes on for only one scan when the OCS first comes into Run Mode, like after it is first powered up
or after a program download.
Hint: Alter the reset trigger code so that the First Scan bit also triggers a reset, or use a Move function to initialize the
accumulator of the counter to the PV value used on First Scan.

PAGE 54 17 April 2015 MAN0827-07


Chapter 3: Timers and Counters
Notes:

MAN0827-07 17 April 2015 PAGE 55


Chapter 3: Timers and Counters

PAGE 56 17 April 2015 MAN0827-07


CHAPTER 4
More Programming Functions

MAN0827-07 17 April 2015 PAGE 57


Chapter 4: More Programming Functions

PAGE 58 17 April 2015 MAN0827-07


Chapter 4: More Programming Functions
Objective
Learn about and use some of the other programming functions found in Cscape.

Move Operations
Move functions can be used to initialize registers to a setpoint value, zero registers when the OCS is first powered up,
copy data from a buffer where information was received to a buffer where it can be processed, load recipe
parameters, help with ultra-fast datalogging… all sorts of things.
In practice, move functions act more like a copy/paste operation. A Source input and a Destination output are
configured. Depending on the exact function, a length parameter and several other parameters may be required.
When the move function receives input power from the rung, it executes the defined move, in its entirety, and
immediately turns its output power on.

Conversion Operations
Conversion operations are very important when trying to mix different data types. In the Cheat Sheet at the back of
this manual, take note of the different data types… specifically INT, DINT, REAL, and ASCII. Analog inputs, like 4-20mA
signals, come in as a raw INT value. High Speed Counter accumulators are in DINT format. A barcode scanner would
likely report information in ASCII format. And the ability to do calculations or to display a reading on the screen with
numbers that have anything after the decimal place, like “122.573 PSI”, requires the use of the REAL format, aka
Floating Point format.
When writing a program, these different types of data may have to be mixed together in order to get the desired
result. Many Cscape programming functions require a type of data to be specified so that the function will operate
correctly. This means that the input parameters to the function must all be in the specified format, and all output
parameters of the function will be provided in that same format.
The Conversion operations allow translation from one type to another. For example, a raw analog INT input, with a
range of 0 to 32000 raw counts, can be converted into REAL format and, with some scaling and/or math, displayed or
datalogged or otherwise used as a reading with a fractional portion, such as 0.000 to 150.000 PSI.
Note that a Conversion operation may or may not power its rung output. This is based on whether or not the
converted value can fit within the given output data type. For example, a value of 100,000 does not fit into an INT
format, so a DINT-to-INT or a REAL-to-INT conversion would fail if the source were a number like that. And 6.02 x 1023
does not fit into either a DINT or an INT data type, so a REAL-to-DINT or REAL-to-INT conversion would fail in that
case. However, for numbers like 122.573, a REAL-to-DINT or REAL-to-INT conversion would succeed and the decimal
places are simply chopped off (not rounded).

Math Operations
These are pretty standard operations to help with whatever calculations need to be done. Without going through all
of them in detail here, there are two of them that prove to be particularly useful.
The “Expression”, found under Math Operations, has the ability to solve an equation exactly as it is typed in. This
completely negates the need to stack multiple other math functions on top of each other. The expression is typed in
directly using the format [result] = [equation]. For example, the equation:
%R15
%R22 = (%R15 x %R16) + ( )
%R16
This equation is typed into the Math Expression like this: %R22 = (%R15 * %R16) + (%R15 / %R16)

MAN0827-07 17 April 2015 PAGE 59


Chapter 4: More Programming Functions

All standard mathematical rules and order of operations are followed when solving the equation, but parentheses
don’t hurt. Additionally, if I/O names are assigned to registers, the I/O names may be used instead of the register
designations in the equation half of the expression. The result half must always be a full register reference, i.e. %R22.
Math expressions will power their rung output as long as the equation doesn’t overflow the specified data type or
result in something like a Divide-by-Zero situation.
Pro Tip: For the Expression function, keep in mind that no intermediate calculation within the equation should exceed
the specified data type! The following examples would have a problem if %R15 * %R16 resulted in something larger
than 32,767, since that is the largest value the INT data type can handle, even if the overall result would be less than
32,767.
These are two examples of the same equation. In the second example, %R15 and %R16 have been assigned the I/O
names ‘x’ and ‘ConversionFactor’ prior to programming this function into the logic.

Another very useful function is the “Scale”, found under Advanced Math. Known points are assigned as the Minimum
and Maximum for each the Input and Output parameters. The Input is then scaled according to these Minimums and
Maximums to provide a linearly scaled output.
Two examples of crowd favorites are as follows:
Many of Horner’s analog inputs for 4-20mA or 0-10V signals come into their assigned %AI
register as a raw value somewhere between 0 and 32000. Say a pressure transducer is used
that is rated to provide 4mA at 0psi and 20mA at 150psi. A scaling function may be set up to
directly translate the raw value into a psi reading. In the example shown here, the INT format is
specified, so output readings would be in whole numbers only… 25psi, 26psi, etc.
Since the world (ok, mostly the U.S.) cannot agree on which standard of measurement should
be used, there is commonly a need or desire to show temperatures in either degrees Celsius or
degrees Fahrenheit. All that is needed are two points on both scales that are known to
correspond between them… such as the freezing and boiling temperatures of water. Using
these points, a scaling function can convert from one to the other easily. Having to look up or
remember the formulas for converting one to the other is not needed.
Note: The Minimum and Maximum values in the Scale configuration do not limit the calculation to be within those
ranges. For example, the scale would still convert values below 0°C or above 100°C to their appropriate °F reading.

Time and Date Operations


These functions are meant to make
scheduling easy to do. They may be
stacked one after another and operate by
powering their rung output if the
configured parameters are true.

PAGE 60 17 April 2015 MAN0827-07


Chapter 4: More Programming Functions
Programming Lab
Add to the program from Chapters 1-3. Use Screen 2 and/or Screen 4 to display data for this Chapter.
Programming Specification for Chapter 4
1. Display the Up -Time of the controller. This should start at zero as soon as
the controller is powered up or put into Run mode and time for as long as the
controller is in Run mode.
2. Use a 4 -20mA or 0-10V analog input signal to simulate a pressure transducer.
If a signal is not available, use a slider on the screen w ith a range of 0 to
32000 to simulate this input. In the logic, s cale the input to display 0 to
150psi with 3 decimal points of precision.

3. Calculate the percentage of full psi that the reading is currently


displaying.

4. Turn on the 2 nd output for a lighting contactor during business hours, M -F


7AM to 6PM.

If possible, program according to the spec without looking at the answers below. Create and use a new Main Loop
section of code if so desired.
For Item 1, a timer may be used similar to the previous lab. However, the spec requires it to start at zero on startup.
Use the System Bit %S1, “First Scan”, and a Move to initialize the timer’s accumulator to zero when the OCS first
comes online.

For Item 2, the logic part will be the same regardless of an actual input or a screen slider simulated input. The spec
calls for precision to 3 decimal places, which means REAL/Floating Point format will need to be used. And that means
the INT analog input/slider will have to be converted to start with. It can be assumed that the scaling should be done
at all times, so the System Bit %S7, “Always On”, may be used as the rung-starting contact.
IMPORTANT Note/Reminder: The REAL data format is a 32-bit format. Horner does not specifically have 32-bit sized
registers. Instead, two consecutive 16-bit registers are used together. The first register is specified, the second one is
implied by the data type selected.
The input is first converted into REAL format,
which consumes %R52 and %R53. The scale
function then puts the result in %R54-%R55.
The example shown here is for a simulated
analog input slider on the screen. Change it
as necessary if an actual analog input is being
used.
MAN0827-07 17 April 2015 PAGE 61
Chapter 4: More Programming Functions

For Item 3, one way to calculate the percentage required is to use the Math Expression. If high school was a little too
long ago, the percentage of full scale can be calculated with this equation:
𝐴𝑐𝑡𝑢𝑎𝑙 𝑅𝑒𝑎𝑑𝑖𝑛𝑔
%= 𝑥 100
𝐹𝑢𝑙𝑙 𝑆𝑐𝑎𝑙𝑒 𝑅𝑒𝑎𝑑𝑖𝑛𝑔

For Item 4, use the handy Time and Date Operations to fire output #2 on the I/O simulator.
Note: Any function that references time uses 24-Hour format. For any time from 1PM to 11PM, add 12. Midnight, or
12AM, is referred to as 0.

Now that the logic is written and the I/O points given names to make it easier to reference them, the screens may be
modified. (For the record, one can program logic and screens in any order desired. Use whatever comes easier.)
Open the screen editor and find screen 2. The Static Text label proclaiming “SCREEN 2” may be deleted if desired.
Add a Timer Data field to show the up-time of the controller. Match all of the parameters to the timer used (32-bit,
addressed to %R61, 1-second resolution).

If an actual analog input is not being used, add a Slider object to the screen and stretch it out so that it takes up
the entire screen in at least one dimension. In the other dimension, make it big enough so that any Joe User with
huge sausage fingers can use it easily. Configure it to operate from 0 to 32000.

Add a Numeric Data field to show the scaled PSI reading from the pressure transducer. Add another one to show
the percent-full-scale.
Navigate to screen 4 and place an Indicator to reflect the status of the lighting output. Address it to %Q2. This
indicator and the actual output light on the I/O simulator will show exactly the same thing.

The next page shows how these screens may look and details the configuration of the objects.

PAGE 62 17 April 2015 MAN0827-07


Chapter 4: More Programming Functions
Screen 2 shows the scaled analog input and the controller Up-Time.

MAN0827-07 17 April 2015 PAGE 63


Chapter 4: More Programming Functions

On screen 4, the indicator only requires an address of %Q2 and a change to the legend. Nothing fancy is required, but
feel free to make it look however is desired.

Download the program and test out the functionality of everything.


 Does the input scale properly?
 Does the percentage show correctly?
 Does the Up-Time start at zero if the controller is either powered down and back up, or if it is taken out of
Run mode and put back in?
 For the lighting output, use the Controller > View/Set Clock menu option in Cscape to change the time and
date in order to test the lighting output.
o Set the Time/Date to something 5 or 10 seconds before a scheduled change and watch it switch over.
o Set the Time/Date to a weekend day and make sure the output does not come on

PAGE 64 17 April 2015 MAN0827-07


Chapter 4: More Programming Functions
Notes:

MAN0827-07 17 April 2015 PAGE 65


Chapter 4: More Programming Functions

PAGE 66 17 April 2015 MAN0827-07


CHAPTER 5
Basic CsCAN Networking

MAN0827-07 17 April 2015 PAGE 67


Chapter 5: Basic CsCAN Networking

PAGE 68 17 April 2015 MAN0827-07


Chapter 5: Basic CsCAN Networking

Objective:
Learn global data transfer from OCS-to-OCS and from OCS-to-Network I/O over CsCAN.
Overview:
Horner’s CsCAN (Cscape Control Area Network) is a peer-to-peer CAN-based network. Though the physical wiring is
nothing new to anyone who has ever used a CAN-based network before (Allen-Bradley’s DeviceNet, SAE J1939,
Honeywell’s SDS, to name a few), Horner APG developed their own protocol in order to offer features not available
with other such protocols.
With CsCAN, there is no master or slave. Each network device is assigned a node ID on the network, from 1 to 253,
corresponding to the Local and Target IDs used in Cscape. Each OCS broadcasts (or puts) data onto the network to
share, with any other OCS that wants it, using NetPut functions:
 I am ID #1, broadcasting Analog Data at this offset. Here is the data for this many Words.
An OCS that needs data from another OCS on the network receives (or gets) data by specifying the other OCS’s ID
and what broadcasted data from that OCS is needed using NetGet functions:
 I want data from ID #1, Analog Data at this offset. Store it at this location, get this many Words.
It is also possible for an OCS to broadcast a heartbeat for other OCSs to monitor.
An exception to the peer-to-peer design is when network I/O is used (SmartStix, SmartBlock, SmartRail). Despite
their name, these devices have no intelligence and must be told what to do. Only one OCS “Master” should be set
up to control a network I/O device. However, the inputs of network I/O are broadcast to the network for any
controller to easily retrieve using NetGet functions. It is also possible for an OCS to take over another OCS’s duties as
an I/O “Master”.
A benefit of CsCAN is the ability to connect a programming cable to one OCS and program any other OCS on the
network. Also, if an OCS goes down for any reason, there is no worry that it may have been the “Master” and that
none of the network can function. Other OCSs can be programmed to deal with it and even take over its duties,
including network I/O, if necessary.
One controller cannot broadcast unlimited data. Each node on the CsCAN
network is limited to the following broadcast:
 32 Analog Words total of NetPut Broadcast data.
These are referenced as %AQG1 - %AQG32.
 64 Digital Bits (4 Words) total of NetPut Broadcast data.
These are referenced as %QG1 - %QG64.
However, this limitation can be overcome with the option to assign a
controller more than one consecutive ID on the network. That controller
may then broadcast 32 Words/64 Bits from EACH of the IDs it occupies on
the network.
There is NO limitation to how much data one controller can receive from
the network.
The functions used for CsCAN communications between
OCS controllers are found in the Comm Operations toolbar.
Part 1 - Analog Data Over CsCAN
Work with another student or take turns sharing equipment. Lab Partner
#1 will be creating and sending a constantly changing number to the CsCAN network, displaying this number on their
OCS screen. Lab Partner #2 will retrieve this number from the network and also display it on their OCS screen.
MAN0827-07 17 April 2015 PAGE 69
Chapter 5: Basic CsCAN Networking

Lab Partner #1 Lab Partner #2


1. Create a new program. 1. Create a new program.
2. Title the program ‘Lab 5 Node 1.csp’. 2. Title the program ‘Lab 5 Node 2.csp’.
3. Set the target to node id 1. Verify through the 3. Set the target to node id 2. Verify through the
system menu of the 1st OCS that the node address system menu of the 2nd OCS that the node
is set to 1 and that the baud rate is 125K. address is set to 2 and that the baud rate is
125K.
4. Configure the controller. (Reference Chapter 1 if
needed) 4. Configure the controller. (Reference Chapter
1 if needed)
5. Write a program to increment a counter every 1
second. Assign the counter to %R1. Set the PV to 5. Write code to retrieve the network data from
200 and the Reset to %R2.16. Node 1 into %R1.
HINT: %S5 is a system register that pulses every This will be achieved by using the NET_GET
second… Address a Normally Open contact to %S5 to instruction block.
fire the counter once every second.
6. Write code to broadcast the accumulated value of
the counter to the network, allowing other nodes
on the network to read the information.
This will be achieved by using the NET_PUT
instruction block.

NOTE:
Analog Offset 0 = %AQG1
Analog Offset 1 = %AQG2

Analog Offset 31 = %AQG32

Lab Partner #1 (cont.)

Lab Partner #2 (cont.)


6. Configure Screen 1 to display this “Incoming
Data”, which will be data coming from Node
1. Consult the previous labs for help creating

PAGE 70 17 April 2015 MAN0827-07


Chapter 5: Basic CsCAN Networking

this screen if necessary.


7. Save the program and then download it to
the controller.

NOTE:
Analog Offset 0 = %AQG1
Analog Offset 1 = %AQG2

Analog Offset 31 = %AQG32

7. Configure a screen to display the accumulated


value of the counter. Consult the previous labs for
help creating this screen if necessary.
8. Save the program and then download it to the
controller.

 Verify the program’s functionality.


Both controllers should display the same value when the value on Node 1 changes.
Part 1 Solutions
Node 1 Ladder Logic Node 2 Ladder Logic

Note how the ID and the Network Reference


(Analog Offset 0 = %AQG1) match on both sides!

MAN0827-07 17 April 2015 PAGE 71


Chapter 5: Basic CsCAN Networking

Part 2 – Digital Data Over CsCAN


For this lab, Lab Partner #2 will be broadcasting the state of the OCS’s function keys. Lab Partner #1 will retrieve this
information and use it to fire outputs.

Lab Partner #1 Lab Partner #2

Modify the Program for Node 1 Modify the Program for Node 2
1. Configure Node 1 to read the function keys from 1. Broadcast the function keys onto the CsCAN
Node 2 and store them in registers starting at network. This will require a NET_PUT instruction
%M1. Write a line of code that uses a NET_GET block. The instruction block will be configured
instruction, configured for digital, from Node 2 for node id 2, digital, and the source will be K1
with the destination of %M1. with the number of words equal to 1.

NOTE: NOTE:
Digital Offset 0 = %QG1 Digital Offset 0 = %QG1
Digital Offset 1 = %QG17 Digital Offset 1 = %QG17
Digital Offset 2 = %QG33 Digital Offset 2 = %QG33
Digital Offset 3 = %QG49 Digital Offset 3 = %QG49

2. Write additional rungs of logic that will turn on 2. Save the program and then download the
outputs (%Q) when the %M registers from program to the controller.
above come on (M1 will turn on Q1, M2 will turn
on Q2, etc.). This can either be done using
contacts and coils or via a move command.

Note: The F-keys are 1-bit each (FALSE or TRUE, 0 or 1). There are 16 bits to 1 Word (NetPut and NetGet functions
require a Num Words to either broadcast or retrieve). Therefore, 1 Word of data can contain 16 F-keys worth of
information, more than any OCS controller has.

 Verify functionality.
When the F1 key on Node 2 is pressed, the 1st output on Node 1 should turn on.

PAGE 72 17 April 2015 MAN0827-07


Chapter 5: Basic CsCAN Networking

Part 2 Solutions
Node 1 Program Addition Node 2 Program Addition

Note how the ID and the Network Reference


(Digital Offset 0 = %QG1) match on both sides!

Part 3 – SmartStix
For this lab, Lab Partner #1 will add a SmartStix network I/O device to their program.
 Modify the Program for Node 1
1. Configure Node 1 for SmartStix I/O. This is done via the CsCAN I/O tab located in the I/O configuration. At the Add
CsCAN I/O window, select SmartStix.
2. Highlight HE559DIQ811/816 and Click OK.
3. Configure the SmartStix as illustrated here, making sure no built-in I/O is overwritten:

MAN0827-07 17 April 2015 PAGE 73


Chapter 5: Basic CsCAN Networking

Note: Make sure the Network ID matches the rotary switches on the SmartStix. Also, the rotary switches are in
Hexadecimal.
4. Press OK, then OK again.
5. Modify the Node 1 program to turn on outputs starting at %Q33 when the function keys of Node 2 are pressed. This
will require either changing the address of the coils already in the program or simply adding coils so that each F-key
press fires 2 outputs.
6. Save program and download changes to Node 1.

 Verify functionality.
Press the F1 key on Node 2 and the first output LED on the SmartStix should turn on, F2 should turn on the second,
etc.

Extra Credit
Modify the program for underworked Lab Partner #2 to retrieve the input status of the SmartStix device that is
being controlled by the other controller. Display them on the screen or fire outputs based on those inputs.
Remember (from the overview a few pages ago), network I/O devices broadcast their input status to the network.
Use a NetGet function to retrieve the inputs directly from the SmartStix. This does require the SmartStix to be
operational due to it already being configured in Part 3!

CONGRATULATIONS ON COMPLETING THE NETWORKING LABS!

PAGE 74 17 April 2015 MAN0827-07


Chapter 5: Basic CsCAN Networking

Notes:

MAN0827-07 17 April 2015 PAGE 75


Chapter 5: Basic CsCAN Networking

PAGE 76 17 April 2015 MAN0827-07


CHAPTER 6
Graphics Editor

MAN0827-07 17 April 2015 PAGE 77


Chapter 6: Graphics Editor

PAGE 78 17 April 2015 MAN0827-07


Chapter 6: Graphics Editor

Objective:
Understand more about how to create screens using the Graphics Editor.

Overview:
In previous labs, a few things have been learned about screen creation. In this lab, there is more detail on the
different objects that can be placed on a screen to either show data in different formats or simply “pretty-up” the
display, making it easier to read.
In order to keep from having problems, the recommended way of placing graphics objects on the screen is to click on
the desired object on the toolbar and then release the mouse button, just like in the ladder logic part of Cscape.
Objects are not dragged from the toolbar onto the screen. Once selected, bring the mouse down into the screen area.
Click AND HOLD the left mouse button at the top left corner of where the object is wanted, then drag it out to size.
Simply clicking and immediately releasing may make an “invisible” object or may bury the object halfway off the
screen where it needs to be deleted and replaced.
Click and release to select an object:
Note the screen images below are for an XLE product but the object placement is the same for all of the products.

Click and hold at top left of desired position:

Drag out the object on the screen. Release the mouse button once the object is sized to liking… it can always be
moved and resized later:

MAN0827-07 17 April 2015 PAGE 79


Chapter 6: Graphics Editor

Graphics Objects:
Static Text

Static Text has been used in previous labs. Static Text is used as a label and is not attached to any register data.
Numeric Data

Numeric Data has been used in previous labs. Numeric Data is a way to display data in Integer, Double Integer,
Floating Point, Hexidecimal, and several other formats. This field is linked to register memory and can be selected as
Editable, which means the user will be able to edit the data in this field from the controller, or can be used only as a
display that the user cannot change.
Time Data

Time Data is an automatically formatted data field that shows either the Time or Date. This field is linked to 3
consecutive registers that contain either the time or date in the same order as in the RTC system registers %SR44 -
%SR50.
For time: Seconds in the first register, Minutes in the second, Hours in the third.
For date: Day in the first register, Month in the second, Year in the third.
Timer Data

Timer Data is an automatically formatted data field that shows the elapsed time of a Timer function. Assigned to the
timer’s address, the resolution of the timer is selected and the format display desired, then data will be displayed
formatted with colons and periods as in a digital clock display.
Password Data

Password Data is a data field linked to register memory that must be 32-bits in length… 2 %R registers, for instance.
On the screen, asterisks will display instead of the actual data.
Text Table

Text Tables have been used in previous labs. Text Table objects are lookup tables linked to register memory and a
single text table. Instead of displaying the actual numeric value in the register, those values will cross-reference to the
entries in the text table. Depending on the value in the register, the corresponding text will display. Many different
Text Table objects on many different screens linked to many different registers can all access the same text table if it
contains the text needed for them all. There are 200 text tables to use, each with twenty 20-character entries, each
entry linked to a value.

PAGE 80 17 April 2015 MAN0827-07


Chapter 6: Graphics Editor

Menu

The Menu Object has been used in a previous lab. The Menu object makes the creation of a menu system easy. Each
entry in the menu can be specified as a screen jump, a link to a sub-menu or a register value to edit.
Indicator

The indicator is used as an OFF/ON indicator for discrete data. It is linked to a 1-bit register. There are several display
options to choose from for the desired look.
Switch / Button

The Switch, a.k.a. Button, is used to indicate and control discrete data. It is linked to a 1-bit register in and can be
specified to operate as a momentary or toggle switch, as well as “always turn ON” and “always turn OFF”. On
controllers with softkeys, the switch will be connected to the nearest softkey by default. On touch-screen controllers,
the switch is activated by pressing it directly on the screen. There are several display options to choose from for the
desired look.
Selector

The Selector is a method of choosing one of up to 4 items by pressing the selection desired. It is linked to a word-
length register that will contain a value depending on the selected item… ‘0’ for Item 1, ‘1’ for item 2, ‘2’ for item 3
and ‘3’ for item 4. The number of items selectable and their names are configurable.
Screen Jump

Screen Jumps have been used in several of the previous labs. This is one of the methods of navigating through the
screens on the controller.
Bar Graph / Meter / 360° Gauge

These are different ways of displaying the data in a word-length register. The Bar Graph can be configured in either a
horizontal or vertical fashion based on its dimensions.
The Meter displays a needle and a sweep from the left to the right.
The 360° Gauge is simply a floating needle that can sweep from any angle to any angle in a 360-degree range… its
scale marks or gauge face design must be done separately as a bitmap background or using other methods.
The Bar Graph and Meter objects can be configured to show any number of equally spaced hash marks along their
scales. All three objects will automatically scale their sweep to the Min and Max values they are configured for.

MAN0827-07 17 April 2015 PAGE 81


Chapter 6: Graphics Editor

Static Bitmap / Animation

These are methods of displaying custom graphics or symbols from the optional Symbols Library software that can be
purchased. The Static Bitmap is just one picture that can be loaded from a bitmap file on the hard drive or be
specified from the Symbols Library.
The Animation is a group of bitmaps… up to 50, one for each frame of the animation. The Animation is linked to a
register and, depending on the value from 0 to 49 in the register, shows that frame number. It is up to the ladder logic
to then provide the means of changing that number as desired.
Data Trend / X-Y Graph

These objects are methods of showing a graph of data on the screen.


The Trend object can have up to four pens configured, each linked to a different word-length register. It displays a
graph of data as samples over a period of time. The graph fills over a period of time depending on the frequency of
the samples. The sample period is configurable, as are many other attributes of this object. The Trend can be
configured to either stop filling the graph when it is full or continue to scroll it across the screen as samples are taken.
The X-Y Graph can also have up to four pens configured, each linked to a set of word-length registers. It displays all of
its data at once, filling the entire graph, immediately when triggered, using data in consecutive registers following the
first one specified for a given pen and as many as are specified in the configuration.
Alarm Object

The Alarm object (gone over in detail later in this lab) is the user interface portion of the Graphic Alarms. It can be
displayed as a button or as a list of alarms and can be configured to show either a current summary or a history of
alarms.
Removable Media Manager

This object allows access to the directory of the Removable Media card. A directory of files will be shown. Depending
on the configuration of this object, the user may or may not be able to delete files, format the card, change the
directory, etc. This is a way to give a user limited access to the Removable Media card.
Rectangle / Ellipse / Rounded Rectangle / Line

These simple drawing objects are used solely for the purpose of beautifying the screen. They are not linked to any
register. The border and line widths can be altered. On the Rectangle, Ellipse and Rounded Rectangle, the fill color can
be specified as transparent or as any of the available colors.

PAGE 82 17 April 2015 MAN0827-07


Chapter 6: Graphics Editor

Graphics Editor Lab


Connect to the XL6 with Cscape and practice building screens for it.
Create an application screen similar to the following:

 Start Pushbutton: Assign to %M1


 Stop Pushbutton: Assign to %M2
 Run Indicator: Assign to %Q1
 Off-Manual-Auto Selector: Assign to %R10
 Speed Feedback (Hz) Indicator: Assign to %R5
 Speed (%) Slider: Map to %R7 (scale 0 to 100)
 Speed (%) Data Box: Assign to %R7
- Note that the push buttons, slider bar, and the lamp indicators are placed on top of rounded rectangles. The
rounded rectangles have a solid fill color defined to give the effect shown.
Create a simple “Start/Stop” circuit in Ladder with %Q1 (Run) as the Coil. (Remember Lab 1?)
Create a simple rung in Ladder using an Integer Scale Function (look under the “Advanced Math” blocks). The scale
function is always on, and should scale input %R7 (0 to 100) to output %R5 (0 to 60).
Run the Ladder Logic, making sure that the logic runs as desired.
Now change the ladder so that the “Run” circuit will not be enabled unless the controller is in “Automatic” mode.
Hint: Automatic Mode is selected when R10 = 2.

MAN0827-07 17 April 2015 PAGE 83


Chapter 6: Graphics Editor

Create a new screen, similar to the following:

 Trend Type: 50mS Continuous Scope


 Trend Trigger: Assign to %T1
 Trend Pens: Pen 1 - %R7 scale 0-100. Pen 2 - %R5 scale 0-60.
Don’t forget to Enable Pen 2.
 Pushbutton (“Trigger”): Assign to %T1 – Configure the Pushbutton for Toggle Mode.
 Scale: Assign to %R7 scaled 0-100.
Add logic to your ladder that uses F1 to call up the control panel screen, and F2 to display the trend screen. This should
work regardless of which screen is currently being displayed.
Download and test the program.

PAGE 84 17 April 2015 MAN0827-07


Chapter 6: Graphics Editor

Extra Credit #1
Change your trend screen, similar to the following:

This screen adds “Start” and “Stop” capabilities to this screen. The “Start” and “Stop” Static Text legends on the
above screen are only that – legends for the function keys next to them. The user must press F4 to activate the Start
Functionality, and F5 to activate the Stop functionality. Use the same Start (%M1) and Stop (%M2) bits previously
assigned.

Extra Credit #2
1. Make the “Start” legend visible only when the run circuit is off.
2. Make the “Stop” legend visible only when the run circuit is on.
Use the dynamic display properties, accessed through the “Attributes” button when configuring the Static Text
legends. Check the ‘Visible’ box under the Dynamic heading and specify an Override Register. When the first bit of
the override register is turned on, this legend will be visible.

MAN0827-07 17 April 2015 PAGE 85


Chapter 6: Graphics Editor

Notes:

PAGE 86 17 April 2015 MAN0827-07


CHAPTER 7
Graphic Alarms

MAN0827-07 17 April 2015 PAGE 87


Chapter 7: Graphic Alarms

PAGE 88 17 April 2015 MAN0827-07


Chapter 7: Graphic Alarms

Objective:
Understand the powerful Alarm capabilities of the graphics controllers.

Graphic Alarms Lab:


Build off of your program from the previous lab. Remember that the SmartStix needs to be configured for the I/O
used in this lab.
From the Graphics Editor, click on the Config menu and select Alarm. Configure Alarms as follows:
 Alarm Trigger: %M1601
 Max Number of Alarms: 4
Name the first 4 alarms as follows by double-clicking them in the list and editing:
 Alarm 1, Group 1 Low-speed Warning
 Alarm 2, Group 1 High-speed Warning
 Alarm 3, Group 1 Motor Overload Trip
 Alarm 4, Group 1 E-stop Trip
Exit the Alarm configuration and the graphics editor.
 Add to your logic to trigger Alarm 1 (%M1601) whenever %R7 is less than 15 (and the machine is running)
 Add to your logic to trigger Alarm 2 (%M1602) whenever %R7 is greater than 90.
 Add to your logic to trigger Alarm 3 (%M1603) whenever %I1 is on. Add a normally-closed %I1 to your run
circuit so that the circuit will not run if %I1 is on.
 Add to your logic to trigger Alarm 4 (%M1604) whenever %I2 is on. Add a normally closed %I2 to your run
circuit so that the circuit will not run if %I2 is on.
 Back in the graphics editor, add an Alarm Indicator Button to the Control Panel Screen, as well as to the
Trend Screen. An example is shown in Figure 1 on the following pages. The Alarm Indicators should
display an Alarm Summary when pressed, for all Alarm groups.
 Create a new screen that is called whenever F3 is pressed. This screen should contain an Alarm Summary
Object, and an Alarm History Object. An example is also shown in Figure 2 on the following pages. For
help in changing to a different screen, consult the screen manipulation lab.
Download and execute the application. Practice triggering alarms, acknowledging them and clearing them. Note the
differences between what is displayed in the “Summary” log, and what is displayed in the “History” log.
Use the “Alarm Indicator” button on the first two screens as a means of viewing the Alarm Summary. Note the
conditions that will cause the Alarm Indicator buttons to change color.

MAN0827-07 17 April 2015 PAGE 89


Chapter 7: Graphic Alarms

Figure 1

Figure 2

PAGE 90 17 April 2015 MAN0827-07


Chapter 7: Graphic Alarms

Extra Credit #1
Create a screen showing a simple graphical diagram of a house. Place an alarm indicator button on the Basement
(Group 1), First Floor (Group 2), Second Floor (Group 3) and Garage (Group 4). Add new alarms to the Alarm
Configuration, a couple each for groups 2, 3, and 4. Trigger those new alarms with unused switches on the I/O
Simulator (%I3-%I8). Note how groups are a great way to segment alarms into manageable groups that can be
monitored in separate alarm summary and history logs, as well as larger groups.

Extra Credit #2
Make the button or buttons with the corresponding active or unacknowledged alarm blink. Use the Attributes for
each of the buttons and turn on the “Blink” attribute in ladder logic if any alarm in the corresponding group is active
or unacknowledged (your choice).
Hint: %SR181 and %SR182 show unacknowledged and active alarms per group ID. For example, an unacknowledged
alarm in group 3 would turn %SR181.3 on; an active alarm in group 10 would turn %SR182.10 on.

Extra Credit #3
Make an animation on the house graphic so that a switch corresponding to a fire alarm makes flames shoot out of the
roof. No examples on this one… get creative! You may have to web surf to find flame graphics.

MAN0827-07 17 April 2015 PAGE 91


Chapter 7: Graphic Alarms

Notes:

PAGE 92 17 April 2015 MAN0827-07


CHAPTER 8
Removable Media Functions

MAN0827-07 17 April 2015 PAGE 93


Chapter 8: Removable Media Functions

PAGE 94 17 April 2015 MAN0827-07


Chapter 8: Removable Media Functions

Objective:
Understand the functionality of the Removable Media functions on controllers that support it.
Overview:
All OCS controllers except for some of the earliest models support Removable Media. Most use MicroSD, some use
CompactFlash, many support USB thumb drives. There are several different ways to use Removable Media (RM):
 Read/Write/Rename/Delete files in CSV format in Ladder Logic
 Automatically log data using the Data Logging function
 Capture screen images as a picture file
 Load a program into a controller without connecting it to a PC
 Host a web page that shows controller data over the internet (XLe/XLt does not support this feature)
 Use FTP to read or write files to the RM card over the internet (XLe/XLt does not support FTP, but Horner
offers EnvisionFX, a software package that provides similar functionality)

Ladder Logic Lab


Information can be stored to and read from a RM card using functions in Cscape Ladder Logic. This method can be
used to datalog information or to read recipes into the controller or to do any number of other tasks. It is a good way
to write large amounts of data to RM but can be tricky to use if a highly formatted end result with column headers
and Time/Date stamps, etc., is desired.
When writing information to the RM card, the information is stored in a Comma Separated Value (CSV) format. The
RM card can be removed from the unit and then read into a spreadsheet on a PC. Conversely, a CSV file could be
created from a PC, stored to the RM card in CSV format and then read into the OCS.
The Read (R), Write (W), Rename (N), Delete (D), and Copy (C) RM ladder functions are found in the Removable Media
toolbar.

1. Open Cscape and create a ladder program that will write 6 registers of information, starting at %R1, when
triggered by the F1 key. Use the Write RM function configured for Overwrite to perform this action and call the
file Data.csv. Configure the Columns Per Row to be 2 and check the “End of Row Now” box.
2. Create a line of code that will read one value from the Data.csv file and store the information in %R11 when the
F2 key is pressed. The offset should be configured for %R201. If a constant is used as the offset, the program will
always be reading the value from the same place in the file.

MAN0827-07 17 April 2015 PAGE 95


Chapter 8: Removable Media Functions

3. Create a line of code that uses the Delete RM block and use the filename of Data.csv. Trigger this Delete function
with the F3 key.

4. Configure a screen to have the following:


 Register fields for %R1 - %R6 that are all editable.
 Instructions (static text) to “Press F1 to Write”.
 A screen jump to Screen 2… specify “Allow ESC to Return”.
 Register field for %R201, the offset, that is editable. The valid offset values for this lab as written would be
anywhere between 0 and 5. However, make sure this data field is set to a 32-bit Decimal format!!!
 Register field for %R11 that is read only
 Instructions to “Press F2 to Read, F3 to delete”

 Place a RM manager on the screen


The screen may look similar to this:

PAGE 96 17 April 2015 MAN0827-07


Chapter 8: Removable Media Functions

4. Download the program to the controller.


5. Change the values in %R1-%R6 on Screen 1 to values that will be written to the RM card.
6. Press the F1 key. The information in %R1-%R6 is now stored to the RM card.
7. Go to Screen 2 and make the %R201 offset ‘0’. Press the F2 key. The first piece of data (what was written from
%R1) should now appear in the %R11 data field on the screen.
8. Change %R201 to other offsets from 0-5 and press the F2 key. Depending on the offset, you will read one of the 6
values that was written to the RM card on Screen 1. The offset determines which of those 6 values is read.
9. Use the RM manager to view the contents of the RM card.
10. Press F3 to delete the file. Confirm it is no longer there by viewing the contents of the card using the RM
manager.
Solution:

MAN0827-07 17 April 2015 PAGE 97


Chapter 8: Removable Media Functions

Automatic Data Logging Lab


Another way to datalog is with the Automatic Datalog function.It provides the ability to automatically record data to a
file at triggered or timed intervals. Each entry is time and date stamped and can record differing formats if needed.
Up to ten different logs can be configured with 100 data points split between them (30 points maximum per log file).
Additionally, columns are labeled with the I/O name of the register where the data is coming from.
Automatic Data Logging is configured via the Program>Datalog Configuration… menu.
Add to the existing program or create a new program to do the following.
1. Set up the 0-10V analog input dial on the I/O Simulator in the Hardware Configuration.
2. Show the voltage reading from the dial on the screen… or scale it to a PSI or tank level or some other reading.
3. Set up the Automatic Datalog to capture the analog reading once every 5 seconds.
4. Additionally, capture the state of the four digital Input switches on the I/O simulator.
Download and run the program. Allow it to run for several minutes while adjusting the Analog Input dial and flipping
the digital Input switches around.
After some time, remove the MicroSD chip and read it with Excel to see how it turns out. Take a look at the “data.csv”
file from the last lab for comparison.

Removable Media File Naming


RM filenames are currently still confined to the DOS/Windows FAT16 file system. All names must be limited to the
“eight dot three” (8.3) format where the filename or each subdirectory contains a maximum of eight characters, a
period, and an extension with a maximum of three characters. The entire filename including any path must be less
than or equal to 147 characters in length.
When creating filenames and directories, it is sometimes desirable to include parts of the current date or time. There
are six special symbols that can be entered into a filename that are replaced by the OCS with current time and date
information.
PAGE 98 17 April 2015 MAN0827-07
Chapter 8: Removable Media Functions

Symbol Description Example


$Y Substitutes the current 2 digit year 2004 = 04
$M Substitutes the current month with a 2 digit code March = 03
$D Substitutes the current day 22nd = 22
$h Substitutes the current hour in 24 hour format 4 PM = 16
$m Substitutes the current minute
$s Substitutes the current second
$p Substitutes the currently displayed 4-digit screen number 53 = 0053
(1-1023, Intended mainly for screen capture)

Note that all the symbols start with the dollar sign ($) character. Date symbols are in upper case; time symbols are in
lower case.

The following are examples of the substituted time/date filenames:


If the current date and time = March 1, 2004 3:45:34 PM
Data$M$D.csv = Data0301.csv
Year$Y\Month$M\aa$D_$h.csv = Year04\Month03\aa01_15.csv
Month_$M\Day_$D\$h_$m_$s.csv = Month_03\Day_01\15_45_34.csv

Removable Media File Counters


Another tool available for use in naming Removable Media files is the Filename Counter. There are four available
Filename Counters that can be separately configured. Configuration is done through the Graphics Editor by clicking
Config and selecting Filename Counters.
Each Filename Counter requires a 32-bit register regardless of the maximum values that the counter will see. A
maximum value is specified for each counter. Options are available to auto-increment and wrap the counter value.
The auto-increment function causes the counter to be automatically incremented by a value of 1 each time the
Filename Counter is accessed.
The wrap counter function causes the counter to start over at 0 when the maximum value is exceeded. If the wrap
counter function is not activated and the counter reaches the maximum value, the counter will no longer
automatically increment and the value will remain at the maximum setting.

MAN0827-07 17 April 2015 PAGE 99


Chapter 8: Removable Media Functions

Accessing the counters is done similarly to the date and time symbols. The format to access any of them is as follows:
$[counter number]u[# of digits, 1-8]
For example, using counter 1 for a screen capture, if the counter has a Max value of 59, the current value is 35 and
the Auto Increment is checked:
$1u4 = 0035
The next time the screen is captured, the value will be 0036, then 0037, etc. This can be implemented into the
filename as follows:
Given:
Current date and time = March 1, 2004 3:45:34 PM
Counter 3 Auto Incrementing, Max of 59, currently at 58, Wrap turned ON
Captures\Chan3\$M-$D-$Y\$h$m-$3u2.bmp
= Captures\Chan3\03-01-04\1545-58.bmp
Next screen capture (assuming same time and date)
= Captures\Chan3\03-01-04\1545-59.bmp
Next screen capture (assuming same time and date)
= Captures\Chan3\03-01-04\1545-00.bmp

Note: A filename extension MUST be specified in all cases if there is to be one. It is never automatically added.

Removable Media Program Downloads


Another feature of the Removable Media functionality is the ability
to load a controller that has RM capabilities with a program from a
RM card instead of through Cscape.
The programmer saves the Cscape program as a special file type
with a .pgm extension by clicking the File menu and selecting
Export to Removable Media. It can be exported directly to a
Removable Media writer connected to the computer or to
anywhere else on the computer to be transferred to Removable
Media later. The user will then insert the RM card into the OCS
and, through the OCS System Menu, select Removable Media to
find the correct file to load. If there is access to a card
reader/writer, try it!

PAGE 100 17 April 2015 MAN0827-07


Chapter 8: Removable Media Functions

Removable Media Screen Capture Lab


Controllers with Removable Media capabilities have the ability to capture a displayed screen to Removable Media as a
JPEG or Bitmap file. These images can then be recalled on the unit through the CF manager or viewed on a computer
with a graphics viewer.
Configuring the Screen Capture function is done through the Graphics Editor by clicking the Config menu and selecting
Screen Capture. A 1-bit register must be configured as a trigger and a filename for the captured graphic file must be
specified. The filename date functions and filename counters can be used for this. The OCS provides feedback that the
screen capture is done by resetting the 1-bit register to an OFF state.
Note: Since the OCS provides feedback by turning off the trigger bit:
 Do NOT use a 1-shot to trigger a screen capture… setting or toggling on a %T is recommended. When it turns
off, the capture is done writing to RM.
 Be careful of using F-keys… Again, the OCS will try to reset it when the capture is done. Using a %T as noted
above is recommended instead.
1. Make F10 perform a screen capture. Set %T3 in ladder logic when F10 is pressed.
2. In the Graphics Editor, configure the Screen Capture to trigger off of %T3 and specify a filename.
3. Download to the OCS

4. Press the F10 key.


5. Go to the screen with the RM Manager on it from before, open the RM manager and find the captured graphic.
6. Use the arrow keys to scroll to the file and press Enter to view it.
CONGRATULATIONS ON FINISHING THE REMOVEABLE MEDIA LAB!

MAN0827-07 17 April 2015 PAGE 101


Chapter 8: Removable Media Functions

Notes:

PAGE 102 17 April 2015 MAN0827-07


Chapter 8: Removable Media Functions

MAN0827-07 17 April 2015 PAGE 103


CHEAT SHEET
OCS Memory Types
Type Description and example of use Size Retentive # Available
%I Digital Inputs from the field; prox sensors, panel buttons, etc 1-BIT or BOOLEAN YES 2048
%Q Digital Outputs to the field; relays, indicator lamps, etc. 1-BIT or BOOLEAN NO 2048
%AI Analog Inputs from the field; Thermocouples, 4-20mA inputs 16-BIT or WORD-LENGTH YES 512
%AQ Analog Outputs to the field; 0-10VDC or 4-20mA outputs 16-BIT or WORD-LENGTH NO 512

%T Internal Temporary bits, use for contacts and coils 1-BIT or BOOLEAN NO 2048-16,384
%M Internal Momentary bits, use for contacts and coils 1-BIT or BOOLEAN YES 2048-16,384
%R Internal Registers, for Timers and Counters and other data. Use 2 16-BIT or WORD-LENGTH YES 9999-50,000
consecutively for DWORD, DINT, UDINT, REAL data
%K Keypad bits, reflect Function Key status 1-BIT or BOOLEAN NO 4-12
%D Display bits, control screens or indicate screen currently showing 1-BIT or BOOLEAN NO 1023
%S Internal System Bits (See next page) 1-BIT or BOOLEAN --- ---
%SR Internal System Registers (See next page) 16-BIT or WORD-LENGTH --- ---

Used as Network references only


%IG Global Digital Inputs from the CAN; in from another OCS 1-BIT --- 64 per node
%QG Global Digital Outputs to the CAN; out to other OCS 1-BIT --- 64 per node
%AIG Global Analog Inputs from the CAN; in from other OCS 16-BIT or WORD-LENGTH --- 32 per node
%AQG Global Analog Outputs to the CAN; out to other OCS 16-BIT or WORD-LENGTH --- 32 per node

Data Types and Sizes


1-BIT

BIT or BOOL - A single bit, can contain only the values '0' or '1', or Boolean ‘FALSE’ or ‘TRUE’.
The size of a single %I, %Q, %T, %M, %K, %D, %S register.

BYTE - A string of 8 consecutive bits. Byte format is used more where the value of the data is not as important as the bit patterns
(shifts and rotates).
8-BIT

ASCII – A data type where each byte consists of a code representing a character, such as the letter ‘A’.

WORD – A generic term for a group of 16 consecutive bits. Word format is used more where the value of the data is not as
important as the bit patterns (shifts and rotates).
INT – Integer; A 16-bit signed value. Integers are used where the value of the data is expected to be in the range of
16-BIT

-32,768 to +32,767. This format is what most Horner analog I/O is in its raw value, i.e. %AI and %AQ values.
UINT - Unsigned Integer; A 16-bit unsigned value. Unsigned Integers are used where the value of the data is expected to be in the
range of 0 (zero) to 65,535.
The size of a single %AI, %AQ, %R, %SR register.

DWORD - Double Word; A generic term for a string of 32 consecutive bits. DWORD format is used where the value of the data is
not as important as the bit patterns (shifts and rotates).
DINT - Double Integer; A 32-bit signed value. Double Integers are used where the value of the data is expected to be in the range
of -2,147,483,648 to +2,147,483,647. Good for showing encoder readings that may easily exceed 32767 counts and may get
reversed below zero counts, i.e. quadrature encoders.
32-BIT

UDINT - Unsigned Double Integer; A 32-bit unsigned value. Unsigned Double Integers are used where the value of the data is
expected to be in the range of 0 (zero) to 4,294,967,296. Good for showing totalizer counts that may easily exceed 65,535.
REAL – a.k.a. Floating Point; A 32-bit value. Values are stored and operated on in IEEE single precision format (to six places past
the decimal point). Values range from -3.40282E+38 to +3.40282E+38. Good for showing readings such as 2.683psi.
Note: This is not a good format to keep track of exact counts. See DINT and UDINT above.

PAGE 104 17 April 2015 MAN0827-07


Cheat Sheet
System Bits
Point Name Function Point Name Function
%S01 FST_SCN Indicates First Scan %S07 ALW_ON Always ON
%S02 NET_OK Network is OK %S08 ALW_OFF Always OFF
%S03 T_10MS 10mS pulse %S09 PAUSING_SCN Pause 'n Load soon
%S04 T_100MS 100mS pulse %S10 RESUMED_SCN Pause 'n load done
%S05 T_1SEC 1 second pulse %S11 FORCE I/O being forced
%S06 IO_OK I/O is OK %S12 FORCE_EN Forcing is enabled

System Registers
Some useful System Registers are listed below. See the Cscape Help File for a more complete list or for further help on
the ones listed here. (Help > Index > “System Registers”)
SR # Name Min Max SR # Name Min Max
1 User Screen Number 0 1023 149 Free-Running 10kHz Low
2 Alarm Screen Number 0 1023 150 Free-Running 10kHz High
3 System Screen Number 0 20ish 171 Last X-Coordinate Touched
4 Self Test Result 172 Last Y-Coordinate Touched
5 Controller Mode (RUN..) 0 2 175 CF Status
6 Scan Rate Avg 176 CF Free Low
7 Min Scan Rate Capture 177 CF Free High
8 Max Scan Rate Capture 178 CF Total Low
29 Network ID Low 1 253 179 CF Total High
30 Network Baud Rate 0 3 181 Alarms Unacknowledged
31 Network Required 0 1 182 Alarms Active
33 Key Toggle Mode 0 1 183 System Beep 0 1
35 Serial Number Low 184 User Beep 0 1
36 Serial Number High 185 Screen Saver 0 1
37 Model Number 186 Screen Saver Time 5 1200
38 Engine Version x.xx 187 Network Usage (Avg) 0 1000
39 BIOS Version x.xx 188 Network Usage (Min) 0 1000
40 FPGA Version xx.x 189 Network Usage (Max) 0 1000
44 RTC Seconds 0 59 190 Network TX Use (Avg) 0 1000
45 RTC Minutes 0 59 191 Network TX Use (Min) 0 1000
46 RTC Hours 0 23 192 Network TX Use (Max) 0 1000
47 RTC Day of Month 1 31 200 InitRD Version for Linux x.xx
48 RTC Month 1 12 201 Linux Kernal version, ASCII 1
49 RTC Year 1996 2095 202 Linux Kernal version, ASCII 2
50 RTC Day of Week 1 7 203 Linux Kernal version, ASCII 3 “2.6.35.30”
51 Network Error Count 204 Linux Kernal version, ASCII 4
56 Last Key 205 Linux Kernal version, ASCII 5
57 LCD Backlight
61 Number of IDs

Keyboard Shortcuts
F1 Context Sensitive Help SHIFT-SPACE Change Selected Coil to Normally Open -( )-
F2 Select Normally Open Contact -| |- SHIFT-/ Change Selected Coil to Normally Closed -(/)-
F3 Select Normally Closed Contact -|/|- SHIFT-P Change Selected Coil to Positive Transition -(P)-
F4 Select Branch Tool | SHIFT-N Change Selected Coil to Negative Transition -(N)-
F5 Select Comment Tool 💬 SHIFT-S Change Selected Coil to Set Coil -(S)-
F9 Select Normally Open Coil -( )- SHIFT-R Change Selected Coil to Reset Coil -(R)-

CTRL-A Select All CTRL-F Find a Register/Function


CTRL-X Cut Selected Items to Clipboard CTRL-H Replace a Register
CTRL-C Copy Selected Items to Clipboard CTRL-G Goto a rung or line
CTRL-V Paste Items from Clipboard CTRL-Z Undo the last change

MAN0827-07 17 April 2015 PAGE 105


CONTACT SHEET

317-916-4274 877-665-5666 www.heapg.com


Phil Horner, President

Customer Service
877-665-5666, Menu Option 1
APGCustomerService@heapg.com

Sales and Marketing


877-665-5666, Menu Option 2
Sales@heapg.com

David Bader
National Sales Manager and Sales – East
Cell: 317-260-9161
dave.bader@heapg.com

Chuck Ridgeway Bill Giebel Norm Williams


Sales – Midwest Sales – South and Southeast Sales – West
317-492-9081 317-492-9079 408-600-8077
Cell: 317-554-9047 Cell: 317-407-7937 norm.williams@heapg.com
chuck.ridgeway@heapg.com bill.giebel@heapg.com

Technical Support
877-665-5666, Menu Option 3
techsppt@heapg.com

Tim Brant Nate Beachey


Technical Support Manager Automation Specialist
317-492-9094 317-492-9118
tim.brant@heapg.com nathan.beachey@heapg.com

PAGE 106 17 April 2015 MAN0827-07

Potrebbero piacerti anche