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 Types <strong>Basic</strong> <strong>Characteristics</strong> <strong>RAPID</strong><br />

4 Data Types<br />

There are two different kinds of data types:<br />

4.1 Non-value data types<br />

- An atomic type is atomic in the sense that it is not defined based on any other<br />

type and cannot be divided into parts or components, e.g. num.<br />

- A record data type is a composite type with named, ordered components, e.g.<br />

pos. A component may be of an atomic or record type.<br />

A record value can be expressed using an aggregate representation;<br />

e.g. [ 300, 500, depth ] pos record aggregate value.<br />

A specific component of a record data can be accessed by using the name of that<br />

component;<br />

e.g. pos1.x := 300; assignment of the x-component of pos1.<br />

Each available data type is either a value data type or a non-value data type. Simply<br />

speaking, a value data type represents some form of “value”. Non-value data cannot be<br />

used in value-oriented operations:<br />

- Initialisation<br />

- Assignment (:=)<br />

- Equal to (=) and not equal to () checks<br />

- TEST instructions<br />

- IN (access mode) parameters in routine calls<br />

- Function (return) data types<br />

The input data types (signalai, signaldi, signalgi) are of the data type semi value. These<br />

data can be used in value-oriented operations, except initialisation and assignment.<br />

In the description of a data type it is only specified when it is a semi value or a nonvalue<br />

data type.<br />

4.2 Equal (alias) data types<br />

An alias data type is defined as being equal to another type. Data with the same data<br />

types can be substituted for one another.<br />

Example: VAR dionum high:=1;<br />

VAR num level; This is OK since dionum is an alias<br />

level:= high; data type for num<br />

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

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

Saved successfully!

Ooh no, something went wrong!