ST_массив_констант |
Здравствуйте, гость ( Вход | Регистрация )
ST_массив_констант |
13.10.2005 - 10:55
Сообщение
#1
|
|
Читатель Группа: Пользователи Сообщений: 5 Регистрация: 31.08.2005 Пользователь №: 186 |
есть программа расчёта контрольной суммы на паскале,
требуется релизовать её на ST в среде GX-IEC dewveloper для плк FX1N-24MT В исходном коде применяется массив констант const massiv:array[0..255] of byte =($00, $C1 итд); при попытке объявления массива констант выдаёт ошибку, что массив констант не поддерживается. как обявить массив констант на ST в GX ? где можно взять документацию по ST для mitsubishi? |
|
|
13.10.2005 - 13:26
Сообщение
#2
|
|
Маньяк Группа: Пользователи Сообщений: 838 Регистрация: 27.07.2004 Из: Россия Пользователь №: 48 |
ST это серия железяк удаленного ввода или вывода работающая через PROFIBUS или что то еще
-------------------- Наши цели ясны, задачи определены. За работу, товарищи!
|
|
|
13.10.2005 - 14:16
Сообщение
#3
|
|
Читатель Группа: Пользователи Сообщений: 5 Регистрация: 31.08.2005 Пользователь №: 186 |
на языке Structured text(st)
|
|
|
13.10.2005 - 17:22
Сообщение
#4
|
|
Читатель Группа: Пользователи Сообщений: 5 Регистрация: 31.08.2005 Пользователь №: 186 |
кто сталкивался с необходимость реализовать алгоритм CRC-16 на плк митсубиси
подскажите как это можно сделать? может есть типовой блок? есть исходный код на паскале как его можно реализовать на ST с учётом того что массив констант не поддерживается |
|
|
14.10.2005 - 08:32
Сообщение
#5
|
|
Читатель Группа: Пользователи Сообщений: 13 Регистрация: 4.07.2005 Пользователь №: 166 |
Declaration
You decide to declare two arrays: 1) A one-dimensional array of INT values called ArrSingle containing three elements 2) A two-dimensional array of INT values called ArrDouble, first dimension three elements wide, second dimension five elements wide 1. Open the header of a POU. 2. Add two new table lines with the following entries: Class Identifier Type Initial VAR ArrSingle ARRAY [0..2] OF INT 3(0 VAR_EXTERNAL ArrDouble ARRAY [0..2,0..4] OF INT 15(0) What the entries mean: VAR Defines the array as a local variable VAR_EXTERNAL Defines the array as a global variable ArrSingle Variable name of the one-dimensional array ArrDouble Variable name of the two-dimensional array ARRAY [0..2] OF INT The one-dimensional array contains three integer (INT) elements (0..2) ARRAY [0..2,0..4] OF INT This array is two-dimensional. The declaration of the second dimension is separated by a comma. In this example the first dimension is three elements wide (0..2) and the second dimension is five elements wide (0..4). 3(0) Number of elements (3) initialised with the value 0 (0) 15(0) Number of elements (3 x 5 =15) initialised with the value 0 (0) Using arrays in the editors EXAMPLE 1 You have declared a one-dimensional array (ArrSingle) with three elements. The example program assigns the value of data register D0 to the first element and the value of data register D1 to the third element. EXAMPLE 2 The two-dimensional array (ArrDouble) is three elements wide in the first dimension and five elements wide in the second dimension. The example program assigns the values of data registers D0 and D1 as follows: D0: To the element identified by index 1 of the first dimension and index 2 of the second dimension D1: To the element identified by index 2 of the first dimension and index 3 of the second dimension AWL EXAMPLE 1 LD D0 ST ArrSingle[1] LD D1 ST ArrSingle[3] EXAMPLE 2 LD D0 ST ArrDouble[1,2] LD D1 ST ArrDouble[2,3] Ladder Diagram and Function Block Diagram Language PS. Вопрос какая величина перед вами - философский, и зависит только от ваших взглядов на эту бренную и удивительную жизнь. -------------------- Игорь Моисеев
|
|
|
Текстовая версия | Сейчас: 9.06.2024 - 06:10 |