Linking Files; Uses Instruction - HEIDENHAIN TNC 415 Technical Manual

Hide thumbs Also See for TNC 415:
Table of Contents

Advertisement

3.19 Linking Files

The source code of the PLC program can be stored in several different files that are managed with
the USES, GLOBAL and EXTERN commands. These must be written at the beginning of the file, i.e.
before any PLC instruction.
The USES command links another file to the program.
The GLOBAL command supplies a jump label from its own file as an entry that can be used by all
other files.
The EXTERN command supplies a jump label defined in another file where it is declared as GLOBAL
for use in its own file.
Splitting the source code up into a number of files helps improve clarity and overview by swapping
out individual function groups.
The number of possible jump labels increases dramatically because the maximum of 1000 jump
labels can be used for each individual file. This means a theoretical number of 60,000 jump labels for
60 files.
In all, up to 64 files can be linked to form a program. Each file can generate up to 64 K of code. The
total potential length of the code is limited to 128 K (TNC 407: 64 K).
Where several files exist, the main program must have the status flag "M" in the directory. In the
RAM this is done by selecting the PLC program function "COMPILE" once, in the EPROM it is done
by specifying the /M option after the main program in the Linker file for binary output.

3.19.1 USES Instruction

The USES instruction links other files to the main program. Files linked with USES can also link other
files with the USES instruction. It is also acceptable for one file to be linked by several other files
with USES, and code for that file is only generated once.
The USES instruction requires a file name as its argument.
Linking files from the RAM is not allowed when executing from the EPROM (MP4010 = 0).
When executing from the RAM (MP4010 = 1) the file is searched first in the RAM and then in the
EPROM.
The USES instruction only links the file, the program code for the file is not executed, i.e. USES
cannot be compared to a CM instruction. The linked files must therefore contain individual modules
which can then be called with CM instructions.
01.98
TNC 407/TNC 415/TNC 425
3 Commands
7-131

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tnc 425eTnc 415fTnc 407Tnc 415bTnc 425

Table of Contents