Skip to content

Commit

Permalink
Merge branch 'release/1.12.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhioromano committed Aug 7, 2022
2 parents 3f6971a + 771b6e9 commit 79b7884
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 27 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/st.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
50 changes: 26 additions & 24 deletions test.iecst
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 79b7884

Please sign in to comment.