Rockwell Automation Publication 2080-UM001B-EN-E - November 2011 37
Appendix
B
Running Programs with Micro800
This section provides a brief overview of running or executing programs with a
Micro800 controller.
Overview of Program
Execution
A Micro800 cycle or scan consists of reading inputs, executing programs in
sequential order, updating outputs and performing communications
housekeeping.
Program names must begin with a letter or underscore, followed by up to 127
letters, digits or single underscores. Use programming languages such as ladder
logic, function block diagrams and structured text.
Up to 256 programs may be included in a project, depending on available
controller memory. By default, the programs are cyclic (executed once per cycle or
scan). As each new program is added to a project, it is assigned the next
consecutive order number. When you start up the Project Organizer in
Connected Components Workbench (CCW), it displays the program icons
based on this order. You can view and modify an order number for a program
from the program's properties. However, the Project Organizer does not show the
new order until the next time the project is opened.
The Micro800 supports jumps within a program. Call a subroutine of code
within a program by encapsulating that code as a User Defined Function Block
(UDFB). Although a UDFB can be executed within another UDFB, a maximum
nesting depth of five is supported. A compilation error occurs if this is exceeded.
Alternatively, you can assign a program to an available interrupt and have it
executed only when the interrupt is triggered. The User Fault Routine is the only
interrupt available in Micro810 controllers. A program assigned to the User Fault
Routine runs once just prior to the controller going into Fault mode.
The Global System Variables associated with cycles/scans are:
• __SYSVA_CYCLECNT - Cycle counter
• __SYSVA_TCYCURRENT - Current cycle time
• __SYSVA_TCYMAXIMUM - Maximum cycle time since last start.