diff --git a/source/examples/functions/MceWarnings/definition.yaml b/source/examples/functions/MceWarnings/definition.yaml index 7c5755f..904d2f6 100644 --- a/source/examples/functions/MceWarnings/definition.yaml +++ b/source/examples/functions/MceWarnings/definition.yaml @@ -1,6 +1,14 @@ author: deGroot comment: Reading warnings changelog: + - version: 0.4.0 + date: 2026-05-04 + author: deGroot + added: + - '`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 @@ -48,4 +56,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..3a82de7 100644 --- a/source/examples/functions/MceWarnings/source.iecst +++ b/source/examples/functions/MceWarnings/source.iecst @@ -33,22 +33,20 @@ CASE io.nSmReadWarnings OF // idle // ------------------------------------- 0: - IF MLX.Signals.MLXGatewayConnected THEN + IF MLX.Signals.MLXGatewayConnected AND io.bEnable 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; // ------------------------------------- @@ -74,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; 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*