From e417da1df5c1d28c871f7abf5e7a79cfd9f81ac6 Mon Sep 17 00:00:00 2001 From: serhioromano Date: Sun, 7 Aug 2022 16:23:03 +0600 Subject: [PATCH 1/3] Add INST --- syntaxes/st.tmLanguage.json | 2 +- test.iecst | 50 +++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/syntaxes/st.tmLanguage.json b/syntaxes/st.tmLanguage.json index f9e7d17..f773990 100644 --- a/syntaxes/st.tmLanguage.json +++ b/syntaxes/st.tmLanguage.json @@ -256,7 +256,7 @@ "patterns": [ { "comment": "Rule for OF in var declaration", - "begin": "\\b(?:VAR(?:_(?:INPUT|OUTPUT|IN_OUT|TEMP|GLOBAL|ACCESS|EXTERNAL))?|STRUCT|UNION)\\b", + "begin": "\\b(?:VAR(?:_(?:INPUT|OUTPUT|IN_OUT|TEMP|GLOBAL|ACCESS|EXTERNAL|INST|STAT))?|STRUCT|UNION)\\b", "beginCaptures": { "0": { "name": "entity.name.type.st" diff --git a/test.iecst b/test.iecst index 7961eb0..906abca 100644 --- a/test.iecst +++ b/test.iecst @@ -10,32 +10,34 @@ Counter := Counter + BOOL_TO_INT( CONST LIMIT := 7; -END_CONS +END_CONST ORGANIZATION_BLOCK CYCLE -(*********************************************************** -CYCLE - название OB1, он вызывается циклически системой S7. -Часть 1 : Вызов функционального блока и передача входных величин -Часть 2 : Чтение выходных величин и вывод с переключением выходов -***********************************************************) -VAR_TEMP -systemdata : ARRAY[0..20] OF BYTE; // Область для OB1 -END_VAR -BEGIN -(* Part 1 : ***************************************************) -ACQUIRE.ACQUIRE_DATA( -measval_in:= WORD_TO_INT(input), -newval := "Input 0.0", //Входной ключ как идентификатор сигнала -resort := Sort_switch, -funct_sel:= Function_switch, -newsel := Coding_switch, -selection := Coding); -(* Part 2 : **************************************************) -IF Output_switch THEN //Изменение выхода -Output := ACQUIRE_DATA.result_out; //Квадратный корень или квадрат -ELSE -Output := ACQUIRE_DATA.measval_out; //Измеряемая величина -END_IF; + (*********************************************************** + CYCLE - название OB1, он вызывается циклически системой S7. + Часть 1 : Вызов функционального блока и передача входных величин + Часть 2 : Чтение выходных величин и вывод с переключением выходов + ***********************************************************) + VAR_TEMP + systemdata : ARRAY[0..20] OF BYTE; // Область для OB1 + END_VAR + BEGIN + (* Part 1 : ***************************************************) + ACQUIRE.ACQUIRE_DATA( + measval_in:= WORD_TO_INT(input), + newval := "Input 0.0", //Входной ключ как идентификатор сигнала + resort := %PQW10.23, + funct_sel:= Function_switch, + newsel := Coding_switch, + selection := Coding + ); + + (* Part 2 : **************************************************) + IF Output_switch THEN //Изменение выхода + Output := ACQUIRE_DATA.result_out; //Квадратный корень или квадрат + ELSE + Output := ACQUIRE_DATA.measval_out; //Измеряемая величина + END_IF; END_ORGANIZATION_BLOCK TYPE Direction ( From f6307e5f2e8665b89fd00bec12bf6f8c66de16e4 Mon Sep 17 00:00:00 2001 From: serhioromano Date: Sun, 7 Aug 2022 16:24:17 +0600 Subject: [PATCH 2/3] change --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da5ff74..7cf602b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,9 @@ All notable changes to the "st" extension will be documented in this file. -## [1.12.0] - 2022-08-07 +## [1.12.4] - 2022-08-07 +- add - `VAR_INST` and `VAR_STAT` support - enhance - highlight Siemens SCL - add - `(END_?)CONST`, `(END_?)ORGANIZATION_BLOCK`, `(END_?)DATA_BLOCK`, `(END_?)LABEL`, `BEGIN`, `COUNTER`, `VOID`, `NIL` and `GOTO` keywords - add - support for `PQ` and `PI` in constants like `%PQW10.0`. From 771b6e9cec20e1a512b8b7753fb9d2bf30e6d379 Mon Sep 17 00:00:00 2001 From: serhioromano Date: Sun, 7 Aug 2022 16:24:25 +0600 Subject: [PATCH 3/3] Version bump to 1.12.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c9d8d8e..c9706a6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-st", "displayName": "Structured Text language Support", "description": "Supports for syntax highlights, snippets for IEC 61131-3 Structured Text", - "version": "1.12.2", + "version": "1.12.4", "publisher": "Serhioromano", "scripts": { "vscode:prepublish": "npm run esbuild-base -- --minify",