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.

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

5.3 Persistent declaration<br />

Persistents can only be declared at module level, not inside a routine, and must be given<br />

an initial value. The initialisation value must be a single value (without data or operands),<br />

or a single aggregate with members which, in turn, are single values or single<br />

aggregates.<br />

Example: PERS pos refpnt := [100.23, 778.55, 1183.98];<br />

Persistents 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: PERS pos pallet{14, 18};<br />

Note that if the value of a persistent is updated, this automatically causes the initialisation<br />

value of the persistent declaration to be updated.<br />

Example: PERS num reg1 := 0;<br />

...<br />

reg1 := 5;<br />

After execution, the program looks like this:<br />

PERS num reg1 := 5;<br />

...<br />

reg1 := 5;<br />

5.4 Constant declaration<br />

A constant is introduced by a constant declaration. The value of a constant cannot be<br />

modified.<br />

Example: CONST num pi := 3.141592654;<br />

A constant 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 />

5.5 Initiating data<br />

Example: CONST pos seq{3} := [[614, 778, 1020],<br />

[914, 998, 1021],<br />

[814, 998, 1022]];<br />

In the table below, you can what is happening in various activities, e.g. warm and cold<br />

start.<br />

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

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

Saved successfully!

Ooh no, something went wrong!