From 9b26b7365e800687757dd9bd76ae3d2cb9984dbb Mon Sep 17 00:00:00 2001 From: "blazej.kuhajda" Date: Mon, 18 May 2026 15:48:59 +0200 Subject: [PATCH 1/4] wip --- .../ctrl/src/Axo_IV3/Axo_IV3.st | 130 +++++++++++++++--- 1 file changed, 108 insertions(+), 22 deletions(-) diff --git a/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st b/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st index 1df6aeb3e..0ae403a82 100644 --- a/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st +++ b/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st @@ -72,6 +72,10 @@ NAMESPACE AXOpen.Components.Keyence.Vision {#ix-attr:[ComponentDetails("Hardware diagnostics")]} {#ix-set:AttributeName = "<#Update diagnostics#>"} HardwareDiagnosticsTask : AXOpen.Io.AxoHardwareDiagnostics; + + LastProgressRoot : ARRAY[0..20] OF INT; + ProgressRoot : ARRAY[0..20] OF INT; + ActiveProgressRootIndex : INT; END_VAR VAR PRIVATE @@ -95,8 +99,44 @@ NAMESPACE AXOpen.Components.Keyence.Vision _resultUpdateComplete : BOOL; _resultNo : UINT; _programNumber : UINT; + _ProgChangeInterrupted : BOOL; END_VAR + METHOD AddProgressToRoot + VAR_INPUT + inProgress : INT; + END_VAR + + var + lastProgress : INT; + end_var; + + lastProgress := ProgressRoot[ActiveProgressRootIndex]; + + IF inProgress <> lastProgress THEN + ActiveProgressRootIndex := ActiveProgressRootIndex + 1; + IF ActiveProgressRootIndex > 20 THEN + ActiveProgressRootIndex := 0; + END_IF; + ProgressRoot[ActiveProgressRootIndex] := inProgress; + END_IF; + + END_METHOD + + + METHOD ClearProgressRoot + var + iterator : INT; + end_var; + + ActiveProgressRootIndex := 0; + FOR iterator := 0 TO 20 DO + LastProgressRoot[iterator] := ProgressRoot[iterator]; + ProgressRoot[iterator] := -1; + END_FOR; + END_METHOD + + /// /// Runs tasks and logic of this component. /// >[!IMPORTANT] This method must or one of its overloads be called cyclically. @@ -6210,6 +6250,9 @@ NAMESPACE AXOpen.Components.Keyence.Vision Messenger.ActivateOnCondition(ULINT#111,ChangeProgramTask.IsDone(), eAxoMessageCategory#Info); IF ChangeProgramTask.Execute(THIS) THEN IF _progress = 0 THEN + THIS.ClearProgressRoot(); + THIS.AddProgressToRoot(0); + Outputs.CommandControl.TriggerRequest := FALSE; Outputs.CommandControl.MasterRegistrationRequest := FALSE; Outputs.CommandControl.ProgramSwitchingRequest := FALSE; @@ -6222,10 +6265,14 @@ NAMESPACE AXOpen.Components.Keyence.Vision Status.Error.Id := UINT#0; TaskMessenger.Restore(); THIS.CallTimers(FALSE); + + _ProgChangeInterrupted := FALSE; _progress := 310; END_IF; // ChangeProgramTask running: checking the program number. IF _progress = 310 THEN + THIS.AddProgressToRoot(310); + IF _programNumber <= Config.MaxProgramNumber THEN THIS.CallTimers(FALSE); _progress := 311; @@ -6234,24 +6281,35 @@ NAMESPACE AXOpen.Components.Keyence.Vision Status.Error.Id := UINT#510; END_IF; END_IF; - // ChangeProgramTask running: if 'ProgramSwitchingResponse' signal is true finish previous change. + + // ChangeProgramTask running: if 'ProgramSwitchingResponse' signal is true, finish previous change. IF _progress = 311 THEN + THIS.AddProgressToRoot(311); + IF _infoTimer.output THEN TaskMessenger.Activate( UINT#511, eAxoMessageCategory#Potential); Status.Error.Id := UINT#511; END_IF; + // Do not cancel (1 → 0) [Program switching request] before [Program switching response] changes from + // 0 to 1. The program may not be able to switch correctly. + // When [Program switching request] was canceled (1 → 0) before [Program switching response] changes + // from 0 to 1, execute (0 → 1) [Program switching request] and cancel (1 → 0) it again. + IF Inputs.CommandStatusBits.ProgramSwitchingResponse THEN - THIS.CallTimers(FALSE); + THIS.CallTimers(FALSE); + _ProgChangeInterrupted := TRUE; _progress := 312; // ACK PREVIOUS CHANGE ELSE THIS.CallTimers(FALSE); _progress := 314; // Continue to change program END_IF; END_IF; + // evaluated before 312 => +1 plc cycle - // ChangeProgramTask running: wait for falling edge ProgramSwitchingResponse + // ChangeProgramTask running: check if is not Busy, due to interrupted by previous program switching IF _progress = 313 THEN + THIS.AddProgressToRoot(313); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; @@ -6263,58 +6321,67 @@ NAMESPACE AXOpen.Components.Keyence.Vision _progress := 311; // +1 plc cycle to check ProgramSwitchingResponse END_IF; END_IF; - // ChangeProgramTask running: wait for program numbers to be equal. + + // ChangeProgramTask running: set [program switching request] to 1 due to interupted by previous program switching IF _progress = 312 THEN + THIS.AddProgressToRoot(312); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; END_IF; Outputs.CommandControl.ProgramSwitchingRequest := TRUE; + Outputs.CommandControl.ProgramNo := UINT#0; // Reset program number IF TRUE THEN THIS.CallTimers(FALSE); _progress := 313; //+1 plc cycle to wait for falling edge END_IF; END_IF; - // ChangeProgramTask running: setting the new program number. + // ChangeProgramTask running: check if is needed to change program, if current program number is not equal to target program number, continue to change, otherwise skip to the end. IF _progress = 314 THEN + THIS.AddProgressToRoot(314); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#511, eAxoMessageCategory#Potential); Status.Error.Id := UINT#511; END_IF; - Outputs.CommandControl.ProgramNo := _programNumber; - IF Outputs.CommandControl.ProgramNo = Inputs.DeviceStatusWords.CurrentProgramNo THEN - THIS.CallTimers(FALSE); - _progress := 317; - ELSE + // IF _programNumber = Inputs.DeviceStatusWords.CurrentProgramNo THEN // is is equel, skipt to the end, otherwise wait for the change + // THIS.CallTimers(FALSE); + // _progress := 317; + // ELSE THIS.CallTimers(FALSE); _progress := 315; - END_IF; + // END_IF; END_IF; - // ChangeProgramTask running: waiting for the raising of the 'ProgramSwitchingResponse' signal. + + // ChangeProgramTask running: set 'ProgramSwitchingRequest' and wait for 'ProgramSwitchingResponse' signal. IF _progress = 315 THEN + THIS.AddProgressToRoot(315); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#512, eAxoMessageCategory#Potential); Status.Error.Id := UINT#512; END_IF; - - Outputs.CommandControl.ProgramSwitchingRequest := TRUE; + + Outputs.CommandControl.ProgramNo := _programNumber; + Outputs.CommandControl.ProgramSwitchingRequest := TRUE; IF Inputs.CommandStatusBits.ProgramSwitchingResponse THEN THIS.CallTimers(FALSE); _progress := 316; END_IF; END_IF; - // ChangeProgramTask running: waiting for the falling of the 'ProgramSwitchingResponse' signal. + + // ChangeProgramTask running: waiting for the falling of the 'ProgramSwitchingResponse' signal, when 'ProgramSwitchingRequest' is reset. IF _progress = 316 THEN + THIS.AddProgressToRoot(316); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; END_IF; Outputs.CommandControl.ProgramSwitchingRequest := FALSE; + Outputs.CommandControl.ProgramNo := UINT#0; // Reset program number , accoding documentation IF NOT Inputs.CommandStatusBits.ProgramSwitchingResponse THEN THIS.CallTimers(FALSE); @@ -6322,26 +6389,45 @@ NAMESPACE AXOpen.Components.Keyence.Vision END_IF; END_IF; - // ChangeProgramTask running: waiting for equals program change. - IF _progress = 317 THEN + + // ChangeProgramTask running: validate that program is selected successfully and other control signals are right, + IF _progress = 318 THEN + THIS.AddProgressToRoot(318); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; END_IF; - IF (_programNumber = Inputs.DeviceStatusWords.CurrentProgramNo) - AND (Outputs.CommandControl.ProgramNo = Inputs.DeviceStatusWords.CurrentProgramNo) + IF NOT Inputs.CommandStatusBits.ProgramSwitchingResponse + AND NOT Inputs.CommandStatusBits.BUSY + AND ( Inputs.DeviceStatusWords.CurrentProgramNo = _programNumber) THEN THIS.CallTimers(FALSE); - _progress := 318; + _progress := 319; + END_IF; + END_IF; + + // ChangeProgramTask running: validate that program is selected successfully, + IF _progress = 317 THEN + THIS.AddProgressToRoot(317); + IF _infoTimer.output THEN + TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); + Status.Error.Id := UINT#513; + END_IF; + + IF (_programNumber = Inputs.DeviceStatusWords.CurrentProgramNo) THEN + THIS.CallTimers(FALSE); + _progress := 318; //+1 plc cycle to check the status after program change END_IF; END_IF; // ChangeProgramTask finished. - IF _progress = 318 THEN + IF _progress = 319 THEN + THIS.AddProgressToRoot(319); ChangeProgramTask.DoneWhen(TRUE); _progress := 0; END_IF; + THIS.CallTimers(TRUE); @@ -6363,7 +6449,7 @@ NAMESPACE AXOpen.Components.Keyence.Vision Messenger.ActivateOnCondition(ULINT#10010,ChangeProgramTask.HasError(), eAxoMessageCategory#Error); Messenger.ActivateOnCondition(ULINT#10011,ChangeProgramTask.IsAborted(), eAxoMessageCategory#Info); Messenger.ActivateOnCondition(ULINT#112,ChangeProgramTask.RestoreTriggered() , eAxoMessageCategory#Info); - IF ChangeProgramTask.RestoreTriggered() AND _progress >= 310 AND _progress <= 319 THEN + IF ChangeProgramTask.RestoreTriggered() AND _progress >= 310 AND _progress <= 329 THEN Status.Action.Id := UINT#112; _progress := 0; END_IF; From ed95b97f4a246756a9d4160edd7f5ff7b1148a56 Mon Sep 17 00:00:00 2001 From: "blazej.kuhajda" Date: Mon, 18 May 2026 16:38:07 +0200 Subject: [PATCH 2/4] pwip --- .../ctrl/src/Axo_IV3/Axo_IV3.st | 51 +++++-------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st b/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st index 0ae403a82..69d40d895 100644 --- a/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st +++ b/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st @@ -25,7 +25,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision {#ix-attr:[ComponentDetails("Tasks")]} {#ix-set:AttributeName = "<#Restore#>"} RestoreTask : AXOpen.Core.AxoTask; - {#ix-attr:[Group(GroupLayout.GroupBox)]} {#ix-attr:[ComponentDetails("Tasks")]} @@ -6286,11 +6285,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision IF _progress = 311 THEN THIS.AddProgressToRoot(311); - IF _infoTimer.output THEN - TaskMessenger.Activate( UINT#511, eAxoMessageCategory#Potential); - Status.Error.Id := UINT#511; - END_IF; - // Do not cancel (1 → 0) [Program switching request] before [Program switching response] changes from // 0 to 1. The program may not be able to switch correctly. // When [Program switching request] was canceled (1 → 0) before [Program switching response] changes @@ -6338,26 +6332,9 @@ NAMESPACE AXOpen.Components.Keyence.Vision END_IF; END_IF; - // ChangeProgramTask running: check if is needed to change program, if current program number is not equal to target program number, continue to change, otherwise skip to the end. - IF _progress = 314 THEN - THIS.AddProgressToRoot(314); - IF _infoTimer.output THEN - TaskMessenger.Activate( UINT#511, eAxoMessageCategory#Potential); - Status.Error.Id := UINT#511; - END_IF; - - // IF _programNumber = Inputs.DeviceStatusWords.CurrentProgramNo THEN // is is equel, skipt to the end, otherwise wait for the change - // THIS.CallTimers(FALSE); - // _progress := 317; - // ELSE - THIS.CallTimers(FALSE); - _progress := 315; - // END_IF; - END_IF; - // ChangeProgramTask running: set 'ProgramSwitchingRequest' and wait for 'ProgramSwitchingResponse' signal. - IF _progress = 315 THEN - THIS.AddProgressToRoot(315); + IF _progress = 314 THEN + THIS.AddProgressToRoot(314); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#512, eAxoMessageCategory#Potential); Status.Error.Id := UINT#512; @@ -6368,13 +6345,13 @@ NAMESPACE AXOpen.Components.Keyence.Vision IF Inputs.CommandStatusBits.ProgramSwitchingResponse THEN THIS.CallTimers(FALSE); - _progress := 316; + _progress := 315; END_IF; END_IF; // ChangeProgramTask running: waiting for the falling of the 'ProgramSwitchingResponse' signal, when 'ProgramSwitchingRequest' is reset. - IF _progress = 316 THEN - THIS.AddProgressToRoot(316); + IF _progress = 315 THEN + THIS.AddProgressToRoot(315); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; @@ -6385,14 +6362,14 @@ NAMESPACE AXOpen.Components.Keyence.Vision IF NOT Inputs.CommandStatusBits.ProgramSwitchingResponse THEN THIS.CallTimers(FALSE); - _progress := 317; + _progress := 316; END_IF; END_IF; // ChangeProgramTask running: validate that program is selected successfully and other control signals are right, - IF _progress = 318 THEN - THIS.AddProgressToRoot(318); + IF _progress = 317 THEN + THIS.AddProgressToRoot(317); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; @@ -6403,13 +6380,13 @@ NAMESPACE AXOpen.Components.Keyence.Vision AND ( Inputs.DeviceStatusWords.CurrentProgramNo = _programNumber) THEN THIS.CallTimers(FALSE); - _progress := 319; + _progress := 318; END_IF; END_IF; // ChangeProgramTask running: validate that program is selected successfully, - IF _progress = 317 THEN - THIS.AddProgressToRoot(317); + IF _progress = 316 THEN + THIS.AddProgressToRoot(316); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; @@ -6417,13 +6394,13 @@ NAMESPACE AXOpen.Components.Keyence.Vision IF (_programNumber = Inputs.DeviceStatusWords.CurrentProgramNo) THEN THIS.CallTimers(FALSE); - _progress := 318; //+1 plc cycle to check the status after program change + _progress := 317; //+1 plc cycle to check the status after program change END_IF; END_IF; // ChangeProgramTask finished. - IF _progress = 319 THEN - THIS.AddProgressToRoot(319); + IF _progress = 318 THEN + THIS.AddProgressToRoot(318); ChangeProgramTask.DoneWhen(TRUE); _progress := 0; END_IF; From fbc81770e7c4ce941d1498aba1fec081452ffb93 Mon Sep 17 00:00:00 2001 From: "blazej.kuhajda" Date: Mon, 18 May 2026 16:44:56 +0200 Subject: [PATCH 3/4] clean up --- .../ctrl/src/Axo_IV3/Axo_IV3.st | 54 ------------------- 1 file changed, 54 deletions(-) diff --git a/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st b/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st index 69d40d895..61842cbc6 100644 --- a/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st +++ b/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st @@ -71,10 +71,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision {#ix-attr:[ComponentDetails("Hardware diagnostics")]} {#ix-set:AttributeName = "<#Update diagnostics#>"} HardwareDiagnosticsTask : AXOpen.Io.AxoHardwareDiagnostics; - - LastProgressRoot : ARRAY[0..20] OF INT; - ProgressRoot : ARRAY[0..20] OF INT; - ActiveProgressRootIndex : INT; END_VAR VAR PRIVATE @@ -101,41 +97,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision _ProgChangeInterrupted : BOOL; END_VAR - METHOD AddProgressToRoot - VAR_INPUT - inProgress : INT; - END_VAR - - var - lastProgress : INT; - end_var; - - lastProgress := ProgressRoot[ActiveProgressRootIndex]; - - IF inProgress <> lastProgress THEN - ActiveProgressRootIndex := ActiveProgressRootIndex + 1; - IF ActiveProgressRootIndex > 20 THEN - ActiveProgressRootIndex := 0; - END_IF; - ProgressRoot[ActiveProgressRootIndex] := inProgress; - END_IF; - - END_METHOD - - - METHOD ClearProgressRoot - var - iterator : INT; - end_var; - - ActiveProgressRootIndex := 0; - FOR iterator := 0 TO 20 DO - LastProgressRoot[iterator] := ProgressRoot[iterator]; - ProgressRoot[iterator] := -1; - END_FOR; - END_METHOD - - /// /// Runs tasks and logic of this component. /// >[!IMPORTANT] This method must or one of its overloads be called cyclically. @@ -6249,9 +6210,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision Messenger.ActivateOnCondition(ULINT#111,ChangeProgramTask.IsDone(), eAxoMessageCategory#Info); IF ChangeProgramTask.Execute(THIS) THEN IF _progress = 0 THEN - THIS.ClearProgressRoot(); - THIS.AddProgressToRoot(0); - Outputs.CommandControl.TriggerRequest := FALSE; Outputs.CommandControl.MasterRegistrationRequest := FALSE; Outputs.CommandControl.ProgramSwitchingRequest := FALSE; @@ -6270,8 +6228,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision END_IF; // ChangeProgramTask running: checking the program number. IF _progress = 310 THEN - THIS.AddProgressToRoot(310); - IF _programNumber <= Config.MaxProgramNumber THEN THIS.CallTimers(FALSE); _progress := 311; @@ -6283,8 +6239,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask running: if 'ProgramSwitchingResponse' signal is true, finish previous change. IF _progress = 311 THEN - THIS.AddProgressToRoot(311); - // Do not cancel (1 → 0) [Program switching request] before [Program switching response] changes from // 0 to 1. The program may not be able to switch correctly. // When [Program switching request] was canceled (1 → 0) before [Program switching response] changes @@ -6303,7 +6257,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision // evaluated before 312 => +1 plc cycle // ChangeProgramTask running: check if is not Busy, due to interrupted by previous program switching IF _progress = 313 THEN - THIS.AddProgressToRoot(313); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; @@ -6318,7 +6271,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask running: set [program switching request] to 1 due to interupted by previous program switching IF _progress = 312 THEN - THIS.AddProgressToRoot(312); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; @@ -6334,7 +6286,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask running: set 'ProgramSwitchingRequest' and wait for 'ProgramSwitchingResponse' signal. IF _progress = 314 THEN - THIS.AddProgressToRoot(314); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#512, eAxoMessageCategory#Potential); Status.Error.Id := UINT#512; @@ -6351,7 +6302,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask running: waiting for the falling of the 'ProgramSwitchingResponse' signal, when 'ProgramSwitchingRequest' is reset. IF _progress = 315 THEN - THIS.AddProgressToRoot(315); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; @@ -6369,7 +6319,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask running: validate that program is selected successfully and other control signals are right, IF _progress = 317 THEN - THIS.AddProgressToRoot(317); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; @@ -6386,7 +6335,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask running: validate that program is selected successfully, IF _progress = 316 THEN - THIS.AddProgressToRoot(316); IF _infoTimer.output THEN TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); Status.Error.Id := UINT#513; @@ -6400,11 +6348,9 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask finished. IF _progress = 318 THEN - THIS.AddProgressToRoot(318); ChangeProgramTask.DoneWhen(TRUE); _progress := 0; END_IF; - THIS.CallTimers(TRUE); From 67d454370bfe1894fe677717ec9d63ef12976c31 Mon Sep 17 00:00:00 2001 From: "blazej.kuhajda" Date: Mon, 18 May 2026 17:05:36 +0200 Subject: [PATCH 4/4] messages --- .../ctrl/src/Axo_IV3/Axo_IV3.st | 17 ++++++----------- .../Axo_IV3/Axo_IV3.cs | 7 ++++++- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st b/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st index 61842cbc6..cb59b763b 100644 --- a/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st +++ b/src/components.keyence.vision/ctrl/src/Axo_IV3/Axo_IV3.st @@ -6258,8 +6258,8 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask running: check if is not Busy, due to interrupted by previous program switching IF _progress = 313 THEN IF _infoTimer.output THEN - TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); - Status.Error.Id := UINT#513; + TaskMessenger.Activate( UINT#514, eAxoMessageCategory#Potential); + Status.Error.Id := UINT#514; END_IF; Outputs.CommandControl.ProgramSwitchingRequest := FALSE; @@ -6271,11 +6271,6 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask running: set [program switching request] to 1 due to interupted by previous program switching IF _progress = 312 THEN - IF _infoTimer.output THEN - TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); - Status.Error.Id := UINT#513; - END_IF; - Outputs.CommandControl.ProgramSwitchingRequest := TRUE; Outputs.CommandControl.ProgramNo := UINT#0; // Reset program number IF TRUE THEN @@ -6320,8 +6315,8 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask running: validate that program is selected successfully and other control signals are right, IF _progress = 317 THEN IF _infoTimer.output THEN - TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); - Status.Error.Id := UINT#513; + TaskMessenger.Activate( UINT#514, eAxoMessageCategory#Potential); + Status.Error.Id := UINT#514; END_IF; IF NOT Inputs.CommandStatusBits.ProgramSwitchingResponse @@ -6336,8 +6331,8 @@ NAMESPACE AXOpen.Components.Keyence.Vision // ChangeProgramTask running: validate that program is selected successfully, IF _progress = 316 THEN IF _infoTimer.output THEN - TaskMessenger.Activate( UINT#513, eAxoMessageCategory#Potential); - Status.Error.Id := UINT#513; + TaskMessenger.Activate( UINT#515, eAxoMessageCategory#Potential); + Status.Error.Id := UINT#515; END_IF; IF (_programNumber = Inputs.DeviceStatusWords.CurrentProgramNo) THEN diff --git a/src/components.keyence.vision/src/AXOpen.Components.Keyence.Vision/Axo_IV3/Axo_IV3.cs b/src/components.keyence.vision/src/AXOpen.Components.Keyence.Vision/Axo_IV3/Axo_IV3.cs index d2bc81cf5..4d53aed47 100644 --- a/src/components.keyence.vision/src/AXOpen.Components.Keyence.Vision/Axo_IV3/Axo_IV3.cs +++ b/src/components.keyence.vision/src/AXOpen.Components.Keyence.Vision/Axo_IV3/Axo_IV3.cs @@ -1,4 +1,4 @@ -using AXOpen.Messaging.Static; +using AXOpen.Messaging.Static; using AXSharp.Connector; using Microsoft.AspNetCore.Http; using System; @@ -882,6 +882,9 @@ private void InitializeTaskMessenger() new KeyValuePair(511, new AxoMessengerTextItem("Waiting for the signal/variable `Inputs.DeviceStatusWords.CurrentProgramNo` to be equal to `Outputs.CommandControl.ProgramNo`" ,"Check the status of the `Inputs.DeviceStatusWords.CurrentProgramNo` signal/variable.")), new KeyValuePair(512, new AxoMessengerTextItem("Waiting for the signal/variable `Inputs.CommandStatusBits.ProgramSwitchingResponse` to be set!" ,"Check the status of the `Inputs.CommandStatusBits.ProgramSwitchingResponse` signal/variable.")), new KeyValuePair(513, new AxoMessengerTextItem("Waiting for the signal/variable `Inputs.CommandStatusBits.ProgramSwitchingResponse` to be reseted!" ,"Check the status of the `Inputs.CommandStatusBits.ProgramSwitchingResponse` signal/variable.")), + new KeyValuePair(514, new AxoMessengerTextItem("Waiting for the signal/variable `Inputs.CommandStatusBits.BUSY` to be reseted!" ,"Check the status of the `Inputs.CommandStatusBits.BUSY` signal/variable.")), + new KeyValuePair(515, new AxoMessengerTextItem("Waiting for the signal/variable `Inputs.DeviceStatusWords.CurrentProgramNo` to be equal to `Outputs.CommandControl.ProgramNo`!" ,"Check the status of the `Inputs.DeviceStatusWords.CurrentProgramNo` signal/variable")), + }; @@ -973,6 +976,8 @@ public string ErrorDescription errorDescriptionDict.Add(511, "Waiting for the signal/variable `Inputs.DeviceStatusWords.CurrentProgramNo` to be equal to `Outputs.CommandControl.ProgramNo`" ); errorDescriptionDict.Add(512, "Waiting for the signal/variable `Inputs.CommandStatusBits.ProgramSwitchingResponse` to be set!" ); errorDescriptionDict.Add(513, "Waiting for the signal/variable `Inputs.CommandStatusBits.ProgramSwitchingResponse` to be reseted!" ); + errorDescriptionDict.Add(514, "Waiting for the signal/variable `Inputs.CommandStatusBits.BUSY` to be reseted!"); + errorDescriptionDict.Add(515, "Waiting for the signal/variable `Inputs.DeviceStatusWords.CurrentProgramNo` to be equal to `Outputs.CommandControl.ProgramNo`!"); // General alarms errorDescriptionDict.Add(700, "Input variable `parent` has NULL reference in `Run` method!" ); errorDescriptionDict.Add(701, "Input variable `Config.HWIDs.HwID_Device` has invalid value in `Run` method!" );