Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
SYPT PRO User Guide / SYPT PRO User Guide.doc
Скачиваний:
244
Добавлен:
03.03.2016
Размер:
17.32 Mб
Скачать

Plc Registers

PLC registers are special parameters which are optimised for very quick access from a DPL user program. Each register stores a 32-bit signed integer. PLC registers can be accessed individually or as arrays. Each register can also be addressed as a normal parameter as shown in the following table.

The following table lists the available PLC registers. Within the table x has the range 0 to 99, e.g. _Px% means that _P0%, _P1%, ... _P99% exist.

The PLC registers can be used for any purpose. However some registers are reserved if specific features are used as shown in the following table.

In the above tables, some registers are described as non-volatile. This means that the register values can be saved in permanent storage so that they will be available the next time an option is powered on. With UD7X, SM-Applications and SM-Applications Lite, the option can be setup to automatically save PLC register values on a power down/ failure. Consult the target manuals for more details.

See Also

  • Variables, Parameters, Constants and Data Types

  • Parameters

  • Data Types

________________________________________________________________________________

Data Types

The SYPT Workbench supports three data types:

  • 32-bit Signed Integer

  • 64-bit Double-precision Floating-Point

  • 32-bit Single-precision Floating Point

These types have the following attributes.

Note:

Single-precision floating-point is only supported on the SM-Applications and SM-Applications Lite module. When developing a program for the SM-Applications or SM-Applications Lite, the programmer can choose whether to compile the program using single-precision or double-precision floating-point by entering a $FLT directive. It is not possible to use both types in a single program. All floating-point mathematics in the whole program will be performed using the same model.

Note:

Single-precision mathematics can provide a performance benefit over double-precision. However, single-precision mathematics is less accurate than double-precision because less bits are used to hold numeric information. Do not use single-precision unless you are sure that sufficient accuracy is possible over the range of numbers/ operations used in the program.

See Also

  • Variables, Parameters, Constants and Data Types

  • Directives

  • Variables

________________________________________________________________________________

Constants

Two kinds of constant can be created in DPL:-

  • Aliases

  • Constant Arrays

Constant arrays can be created using the CONST keyword. As its name suggests, the values within a constant array cannot be altered by a DPL program - they can only be read.

The CONST keyword is used outside of a DPL task, and must be defined at the top of the DPL file before any tasks, subroutines or user-defined function blocks. Only integer (signed 32-bit) constants are allowed. The first number within the array is accessed as element 0. Subsequent data is delimited by either a comma or a new-line.

To declare a constant array of integers, the DPL syntax is:

See Also

  • Variables, Parameters, Constants and Data Types

  • Arrays

  • Variables

  • Aliases

  • Program Structure

________________________________________________________________________________