Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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.
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.
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
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.
Select the method of connection and click “Next >>”. Depending on the method selected, relevant options will
display. See Lab 1 for further details.
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.
Often-used elements
Project Toolbox
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.
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.
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.
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.
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.
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.
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.
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.
To fix the improperly terminated rung shown above, right-click in the white area
next to the line number and select “New Rung”.
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.
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.
Notes:
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.
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.
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.
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.
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.
Once the I/O names are entered and edited, click the OK button to exit the I/O names.
Note how the contacts that have been assigned to the function keys are now shaped like buttons.
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.
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.
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.
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.
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).
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.
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.
Notes:
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.
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.
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.
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.
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:
Notes:
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.
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.
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.
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!
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.
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.
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.
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.
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)
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.
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.
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.
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
NOTE:
Analog Offset 0 = %AQG1
Analog Offset 1 = %AQG2
…
Analog Offset 31 = %AQG32
NOTE:
Analog Offset 0 = %AQG1
Analog Offset 1 = %AQG2
…
Analog Offset 31 = %AQG32
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.
Part 2 Solutions
Node 1 Program Addition Node 2 Program Addition
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:
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!
Notes:
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.
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:
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.
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.
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
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.
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.
Notes:
Objective:
Understand the powerful Alarm capabilities of the graphics controllers.
Figure 1
Figure 2
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.
Notes:
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)
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.
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.
Note that all the symbols start with the dollar sign ($) character. Date symbols are in upper case; time symbols are in
lower case.
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.
Notes:
%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 --- ---
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.
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)-
Customer Service
877-665-5666, Menu Option 1
APGCustomerService@heapg.com
David Bader
National Sales Manager and Sales – East
Cell: 317-260-9161
dave.bader@heapg.com
Technical Support
877-665-5666, Menu Option 3
techsppt@heapg.com