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

Predefined Variables

CTNet Diagnostic Variables

The following predefined variables are available on the MD29AN and UD75 targets. The variables give CTNet diagnostic information.

On all modules, CTNET diagnostic information can also be obtained using the CTNETDIAGNOSTICS function.

Numeric Limits

The following predefined variables are available on the SM-Applications and SM-Applications Lite targets. The variables give upper and lower numeric limits.

See Also

  • Variables, Parameters, Constants and Data Types

  • CTNETDIAGNOSTICS

  • Directives

________________________________________________________________________________

Arrays

The DPL language allows declaration of single dimension integer and floating point arrays. An array must be declared using the DIM keyword:

DIM MyIntegerArray%[26]

An integer array containing 26 elements.

DIM MyFloatingPointArray[18]

An array containing 18 floating point elements.

Elements in arrays are indexed from 0 upwards. For example the elements in MyIntegerArray% are:

MyIntegerArray%[0], MyIntegerArray%[1], ... MyIntegerArray%[25]

Each element in an array is automatically initialised to 0 (or 0.0 for floating-point arrays) when the user program starts.

See Also

  • Variables, Parameters, Constants and Data Types

  • Variables

  • Predefined Variables

  • Constants

  • Bit Access For Variables

  • Variable and Parameter Scope

  • Data Types

  • DPL (Drive Programming Language) Reference

________________________________________________________________________________

Parameters

Each Control Techniques drive and option has a number of parameters which can be used to alter or monitor the operation of the device. The target manuals should be consulted to find out the parameters available on each target. Each parameter will have a set of attributes, e.g. a numeric range, whether it is read-only and whether it has decimal places. Some parameters can also have their values saved in non-volatile memory within the drive or option. There are a number of formats for specifying parameter numbers in programs.

Format 1 - #MM.PP

This format gives a parameter number as:

  • MM = the menu number.

  • PP = the parameter number

For example, #01.21 refers to parameter 21 in menu 1.

If a parameter has decimal places, e.g. #01.21 on Unidrive SP has 1 decimal place then it will be treated as a floating-point value. If #01.21 has the value 2.3 then the DPL statement:

PresetRef1Value = #01.21

will assign the value 2.3 to the variable PresetRef1Value.

Format 2 - #INTMM.PP

MM and PP have the same meaning as for format 1 above.

Format 2 always accesses a parameter as an integer. Even if a parameter has decimal places its value will be read as an integer. For example, if #01.21 has the value 2.3 then the DPL statement:

MyValue% = #INT01.21

will assign the value 23 to MyValue%.

This format for accessing parameters is quicker than accessing the parameter using #MM.PP. The downside is that the parameter value is always read or written as an integer and the program will have to take care of scaling.

Format 3 - #VARNAME%

This format is known as a parameter pointer. The value of the variable is used to point to a parameter number to read or write, e.g.

A% = 121

#A% = 23

A% = 122

#A% = 24

will write the value 2.3 to parameter #01.21 followed by the value 2.4 to #01.22 (assuming that parameters #1.21 and #1.22 have one decimal place). The parameter values are always written or read as integers and the user program will need to take account of any scaling required for parameters which have decimal places.

See Also

  • Variables, Parameters, Constants and Data Types

  • PLC Registers

  • Variables

  • Variable and Parameter Scope

  • Data Types

  • DPL (Drive Programming Language) Reference

________________________________________________________________________________