15.07.2013 Views

Automatic control function programming manual ladder language

Automatic control function programming manual ladder language

Automatic control function programming manual ladder language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.2 Structure of an Application<br />

Structure of an Application<br />

An application includes a set of modules created under the PLCTOOL <strong>programming</strong> tool and loaded onto the NC to<br />

<strong>control</strong> the system.<br />

Detail of Modules<br />

Ladder Task Modules<br />

Ladder task modules are associated with:<br />

- task %INI,<br />

- tasks %TS0 to %TS4,<br />

- tasks %TF0 to %TF15,<br />

- tasks %TH0 to %TH15.<br />

These modules are called by the system task manager. They cannot be called explicitly. The user manages these<br />

task modules by means of the task management <strong>function</strong>s (see Chapter 7).<br />

Ladder task modules are files of the *.XLA type.<br />

Ladder subroutine modules<br />

Ladder subroutine modules are associated with tasks %SP0 to %SP255 . These modules can be called from a task<br />

module or another subroutine module using <strong>function</strong> sp(..) or spy(..).<br />

A PLC subroutine written in Ladder <strong>language</strong> and called by the SP <strong>function</strong> from a C module must not include ANY<br />

<strong>function</strong> calls (except <strong>function</strong>s goto 0 and call 0).<br />

Ladder subroutine modules are files of the *.XLA type.<br />

Executable Modules<br />

Executable modules are produced by a C compiler (MCC68K). These modules can be called from a <strong>ladder</strong> task module<br />

or a <strong>ladder</strong> subroutine module using <strong>function</strong> exec(..).<br />

All tasks can be written in C. If the same task is written in C and in <strong>ladder</strong> <strong>language</strong>, it is the C code that is executed<br />

by the automatic <strong>control</strong> <strong>function</strong>.<br />

Executable modules are files of the *.XCX type.<br />

Note on Initialising a C Module (.XCX)<br />

Implementation of global memory code in the local PLC memory.<br />

Execution of the following directives in the «main()»:<br />

- Import(),<br />

- Export(),<br />

- Possible initialisation of certain variable types: global C variables of the XCX module, uninitialised variables (saved)<br />

of Ladder <strong>language</strong>.<br />

Resolution of imports/exports (imported variables cannot be used in the «main()»)<br />

Initialisation of initialised Ladder variables<br />

Execution of %INI module<br />

Normal PLC cycle start.<br />

REMARK On a PLC Stop/Start (without INIT), only the last three steps are executed.<br />

The saved variables are %M, %C, %CQ; the initialised variables are %I, %Q, %R, %T,<br />

%TQ, %V. The so-called «pulse» variables %W are reset by the RESET or power<br />

off button.<br />

en-938846/8 2 - 13<br />

2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!