09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>Basic</strong> <strong>Characteristics</strong> <strong>RAPID</strong> Data<br />

Figure 4 Example: The following data can be called from routine e:<br />

Module1: Data c, d.<br />

Module2: Data a, f, g, e1.<br />

The following data can be called from routine h:<br />

Module1: Data d.<br />

Module2: Data a, f, g, h1, c.<br />

Routine data may not have the same name as other data or a label in the same routine.<br />

5.2 Variable declaration<br />

Module1 Module2<br />

Local Data a<br />

Local Data b<br />

Data c<br />

Data d<br />

Data e<br />

A variable is introduced by a variable declaration.<br />

Example: VAR num x;<br />

Variables of any type can be given an array (of degree 1, 2 or 3) format by adding<br />

dimensional information to the declaration. A dimension is an integer value greater<br />

than 0.<br />

Example: VAR pos pallet{14, 18};<br />

Variables with value types may be initialised (given an initial value). The expression<br />

used to initialise a program variable must be constant. Note that the value of an uninitialized<br />

variable may be used, but it is undefined, i.e. set to zero.<br />

Example: VAR string author_name := "John Smith";<br />

VAR pos start := [100, 100, 50];<br />

VAR num maxno{10} := [1, 2, 3, 9, 8, 7, 6, 5, 4, 3];<br />

The initialisation value is set when:<br />

Local Data a<br />

Local Data f<br />

Data g<br />

Local Routine e<br />

Data e1<br />

Routine h<br />

Data h1<br />

Data c<br />

- the program is opened,<br />

- the program is executed from the beginning of the program.<br />

<strong>RAPID</strong> Reference Manual 5-21

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

Saved successfully!

Ooh no, something went wrong!