From 020f4ce96022bbb4ebabf6009a2c1c267a7b2763 Mon Sep 17 00:00:00 2001 From: yeu-bertus Date: Mon, 4 May 2026 12:39:14 +0200 Subject: [PATCH 1/7] clear strings using a FOR loop (#123) - this prevents clearing the max length information (S7-1500) --- .../examples/functions/MceWarnings/definition.yaml | 9 ++++++++- source/examples/functions/MceWarnings/source.iecst | 14 ++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/source/examples/functions/MceWarnings/definition.yaml b/source/examples/functions/MceWarnings/definition.yaml index 7c5755f..20bccaf 100644 --- a/source/examples/functions/MceWarnings/definition.yaml +++ b/source/examples/functions/MceWarnings/definition.yaml @@ -1,6 +1,11 @@ author: deGroot comment: Reading warnings changelog: + - version: 0.4.0 + date: unreleased + author: deGroot + changed: + - 'clear strings using FOR loop for platform compatibility' - version: 0.3.1 date: 2025-02-24 author: Rioual @@ -48,4 +53,6 @@ var: - name: aWarningBuffer type: ARRAY [0..GVL.WARNINGS_UBOUND] OF STRING[162] - comment: buffer of received robot warnings \ No newline at end of file + comment: buffer of received robot warnings + + - name: i diff --git a/source/examples/functions/MceWarnings/source.iecst b/source/examples/functions/MceWarnings/source.iecst index e94469b..8c15c6f 100644 --- a/source/examples/functions/MceWarnings/source.iecst +++ b/source/examples/functions/MceWarnings/source.iecst @@ -36,19 +36,17 @@ CASE io.nSmReadWarnings OF IF MLX.Signals.MLXGatewayConnected THEN // init nIndex := 0; - MEMUtils.MemSet( - pbyBuffer := ADR(aWarningBuffer), - byValue := 0, - dwSize := SIZEOF(aWarningBuffer)); + FOR i := 0 TO GVL.WARNINGS_UBOUND DO: + aWarningBuffer[i] := ''; + END_FOR; io.nSmReadWarnings := 10; ELSE // clear old data io.nWarnings := 0; - MEMUtils.MemSet( - pbyBuffer := ADR(io.aWarnings), - byValue := 0, - dwSize := SIZEOF(io.aWarnings)); + FOR i := 0 TO GVL.WARNINGS_UBOUND DO: + io.aWarnings[i] := ''; + END_FOR; END_IF; // ------------------------------------- From 3b8d10e9f1f1218b94728348d19197bfe580ead8 Mon Sep 17 00:00:00 2001 From: yeu-bertus Date: Mon, 4 May 2026 12:50:10 +0200 Subject: [PATCH 2/7] add `bEnable` input (#85) - this allows easy deactivation of `MceWarnings` --- source/examples/functions/MceWarnings/definition.yaml | 2 ++ source/examples/functions/MceWarnings/source.iecst | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/examples/functions/MceWarnings/definition.yaml b/source/examples/functions/MceWarnings/definition.yaml index 20bccaf..8378d27 100644 --- a/source/examples/functions/MceWarnings/definition.yaml +++ b/source/examples/functions/MceWarnings/definition.yaml @@ -4,6 +4,8 @@ changelog: - version: 0.4.0 date: unreleased author: deGroot + added: + - '`bEnable` input for activating the polling sequence' changed: - 'clear strings using FOR loop for platform compatibility' - version: 0.3.1 diff --git a/source/examples/functions/MceWarnings/source.iecst b/source/examples/functions/MceWarnings/source.iecst index 8c15c6f..441afab 100644 --- a/source/examples/functions/MceWarnings/source.iecst +++ b/source/examples/functions/MceWarnings/source.iecst @@ -33,7 +33,7 @@ CASE io.nSmReadWarnings OF // idle // ------------------------------------- 0: - IF MLX.Signals.MLXGatewayConnected THEN + IF MLX.Signals.MLXGatewayConnected AND io.bEnable THEN // init nIndex := 0; FOR i := 0 TO GVL.WARNINGS_UBOUND DO: From 55e7090f209d24778e33db00fe5477c1499f65f2 Mon Sep 17 00:00:00 2001 From: yeu-bertus Date: Mon, 4 May 2026 12:52:54 +0200 Subject: [PATCH 3/7] set version date --- source/examples/functions/MceWarnings/definition.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/examples/functions/MceWarnings/definition.yaml b/source/examples/functions/MceWarnings/definition.yaml index 8378d27..02f315b 100644 --- a/source/examples/functions/MceWarnings/definition.yaml +++ b/source/examples/functions/MceWarnings/definition.yaml @@ -2,7 +2,7 @@ author: deGroot comment: Reading warnings changelog: - version: 0.4.0 - date: unreleased + date: 2026-05-04 author: deGroot added: - '`bEnable` input for activating the polling sequence' From b726144090f65f4a548fd9cabf7c9b319b35cc95 Mon Sep 17 00:00:00 2001 From: yeu-bertus Date: Mon, 4 May 2026 13:04:51 +0200 Subject: [PATCH 4/7] add `bEnable` input (#85) --- .../examples/types/MceWarningsIO/definition.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/examples/types/MceWarningsIO/definition.yaml b/source/examples/types/MceWarningsIO/definition.yaml index 58a498a..85085f4 100644 --- a/source/examples/types/MceWarningsIO/definition.yaml +++ b/source/examples/types/MceWarningsIO/definition.yaml @@ -2,6 +2,11 @@ company: Yaskawa Europe GmbH author: deGroot comment: IO data for the MceWarnings function changelog: + - version: 0.2.0 + date: 2026-05-04 + author: deGroot + added: + - '`bEnable` input for activating the reading of robot warnings' - version: 0.1.1 date: 2022-02-24 author: deGroot @@ -19,6 +24,16 @@ changelog: # security: var: + - name: bEnable + description: | + *Used as input* + + This activates the polling cycle for reading robot warnings. + + type: BOOL + default_value: "FALSE" + comment: "input: activate reading robot warnings" + - name: bPollingCompleted description: | *Used as output* From 26f1a25650de8137221ddac262dae5735c15298f Mon Sep 17 00:00:00 2001 From: yeu-bertus Date: Mon, 4 May 2026 13:46:35 +0200 Subject: [PATCH 5/7] typo --- source/examples/functions/MceWarnings/source.iecst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/examples/functions/MceWarnings/source.iecst b/source/examples/functions/MceWarnings/source.iecst index 441afab..fc16905 100644 --- a/source/examples/functions/MceWarnings/source.iecst +++ b/source/examples/functions/MceWarnings/source.iecst @@ -36,7 +36,7 @@ CASE io.nSmReadWarnings OF IF MLX.Signals.MLXGatewayConnected AND io.bEnable THEN // init nIndex := 0; - FOR i := 0 TO GVL.WARNINGS_UBOUND DO: + FOR i := 0 TO GVL.WARNINGS_UBOUND DO aWarningBuffer[i] := ''; END_FOR; @@ -44,7 +44,7 @@ CASE io.nSmReadWarnings OF ELSE // clear old data io.nWarnings := 0; - FOR i := 0 TO GVL.WARNINGS_UBOUND DO: + FOR i := 0 TO GVL.WARNINGS_UBOUND DO io.aWarnings[i] := ''; END_FOR; END_IF; From b6ff2a484b8c5e8300587c3ee43d86ce5fd0ddbc Mon Sep 17 00:00:00 2001 From: yeu-bertus Date: Mon, 4 May 2026 15:23:51 +0200 Subject: [PATCH 6/7] abort sequence when `bEnable=FALSE` --- source/examples/functions/MceWarnings/source.iecst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/examples/functions/MceWarnings/source.iecst b/source/examples/functions/MceWarnings/source.iecst index fc16905..3a82de7 100644 --- a/source/examples/functions/MceWarnings/source.iecst +++ b/source/examples/functions/MceWarnings/source.iecst @@ -72,10 +72,14 @@ CASE io.nSmReadWarnings OF // the errorNumber returns the "warning slot number" (0..9) so let's // use it to detect when the polling sequence is complete - IF (fbGetMessageDetail.MessageDetail.errorNumber < 9 ) THEN - io.nSmReadWarnings := 20; + IF io.bEnable THEN + IF (fbGetMessageDetail.MessageDetail.errorNumber < 9 ) THEN + io.nSmReadWarnings := 20; + ELSE; + io.nSmReadWarnings := 30; + END_IF; ELSE; - io.nSmReadWarnings := 30; + io.nSmReadWarnings := 0; END_IF; END_IF; END_IF; From e1008999c1ef5e5f557f0e43fb92a3e67e2f1791 Mon Sep 17 00:00:00 2001 From: yeu-bertus Date: Mon, 4 May 2026 15:30:09 +0200 Subject: [PATCH 7/7] add note about required `MceWarningsIO` version --- source/examples/functions/MceWarnings/definition.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/source/examples/functions/MceWarnings/definition.yaml b/source/examples/functions/MceWarnings/definition.yaml index 02f315b..904d2f6 100644 --- a/source/examples/functions/MceWarnings/definition.yaml +++ b/source/examples/functions/MceWarnings/definition.yaml @@ -8,6 +8,7 @@ changelog: - '`bEnable` input for activating the polling sequence' changed: - 'clear strings using FOR loop for platform compatibility' + - requires `MceWarningsIO` data type version `0.2.0` - version: 0.3.1 date: 2025-02-24 author: Rioual