From 25edacfb1099109a088c952a11809a63f9026ef7 Mon Sep 17 00:00:00 2001 From: Tomas Kovac Date: Wed, 26 Jul 2023 20:03:23 +0200 Subject: [PATCH] Cognex dataman readear, very first release ready to test with the hardware --- .config/dotnet-tools.json | 6 +- cake/ApaxCmd.cs | 1 + cake/BuildContext.cs | 2 + src/AXOpen.Cognex.Vision/ctrl/.gitignore | 8 + .../ctrl/AXSharp.config.json | 1 + src/AXOpen.Cognex.Vision/ctrl/apax.yml | 19 + .../ctrl/package-lock.json | 11 + .../ctrl/src/AxoDataman/v_6_0_0/AxoDataman.st | 357 ++++++++++++++++++ .../Tasks/AxoDatamanClearResultData.st | 116 ++++++ .../v_6_0_0/Tasks/AxoDatamanRead.st | 144 +++++++ .../AxoDataman_AcquisitionControl.st | 9 + .../AxoDataman_AcquisitionStatus.st | 12 + .../AxoDataman_Config.st | 16 + .../AxoDataman_Results.st | 12 + .../AxoDataman_ResultsControl.st | 9 + .../AxoDataman_ResultsStatus.st | 12 + .../AxoDataman_SignalStates.st | 49 +++ .../AxoDataman_SoftEventControl.st | 15 + .../AxoDataman_SoftEventStatus.st | 15 + .../AxoDataman_Status.st | 10 + .../TypeStructuresAndEnums/AxoDataman_User.st | 10 + .../eAxoDataman_ResultDataSize.st | 13 + .../eAxoDataman_UserDataSize.st | 13 + .../ExampleJsInterop.cs | 37 ++ .../Properties/AssemblyInfo.cs | 3 + .../_Imports.razor | 2 + .../axopen_cognex_vision_blazor.csproj | 31 ++ .../package-lock.json | 11 + .../wwwroot/background.png | Bin 0 -> 378 bytes .../wwwroot/exampleJsInterop.js | 6 + .../Properties/AssemblyInfo.cs | 3 + .../Resources/PlcStringResources.Designer.cs | 99 +++++ .../Resources/PlcStringResources.resx | 77 ++++ .../ix_ax_axopen_cognex_vision.csproj | 29 ++ .../AXOpen.Cognex.Vision.Tests/Usings.cs | 1 + .../axopen_cognex_vision_tests.csproj | 41 ++ .../xunit.runner.json | 4 + src/AXOpen.sln | 58 +++ src/components.abstractions/ctrl/.gitignore | 8 + .../ctrl/AXSharp.config.json | 1 + src/components.abstractions/ctrl/apax.yml | 15 + .../ctrl/package-lock.json | 11 + .../ctrl/src/IAxoCodeReader.st | 7 + .../Properties/AssemblyInfo.cs | 3 + .../_Imports.razor | 2 + ...open_components_abstractions_blazor.csproj | 35 ++ .../package-lock.json | 11 + .../wwwroot/background.png | Bin 0 -> 378 bytes .../wwwroot/exampleJsInterop.js | 6 + .../Properties/AssemblyInfo.cs | 3 + .../Resources/PlcStringResources.Designer.cs | 99 +++++ .../Resources/PlcStringResources.resx | 77 ++++ ...x_ax_axopen_components_abstractions.csproj | 32 ++ .../Usings.cs | 1 + ...xopen_components_abstractions_tests.csproj | 42 +++ .../xunit.runner.json | 4 + .../AxoComponent/AxoComponentView.razor | 12 +- src/integrations/ctrl/apax.yml | 3 +- .../AxoCognexVisionDatamanExample.st | 33 ++ .../AXOpen.Cognex.Vision/IO/CopyInputs.st | 223 +++++++++++ .../AXOpen.Cognex.Vision/IO/CopyOutputs.st | 210 +++++++++++ .../AXOpen.Cognex.Vision/IO/HwInputs.st | 15 + .../AXOpen.Cognex.Vision/IO/HwOutputs.st | 14 + .../AXOpen.Cognex.Vision/IO/PlcInputs.st | 15 + .../AXOpen.Cognex.Vision/IO/PlcOutputs.st | 14 + src/integrations/ctrl/src/configuration.st | 12 + src/integrations/ctrl/src/program.st | 39 +- .../AxoCognexVisionDatamanExample.razor | 27 ++ .../Shared/NavMenu.razor | 7 +- .../axopen_integrations.csproj | 1 + .../ctrl/.config/dotnet-tools.json | 18 + src/utils/ctrl/src/AXOpenUtils/AxoCRC_16.st | 2 +- src/utils/ctrl/src/AXOpenUtils/AxoCRC_32.st | 2 +- src/utils/ctrl/src/AXOpenUtils/AxoCRC_8.st | 2 +- src/utils/ctrl/src/AXOpenUtils/AxoXORs.st | 200 ---------- .../Conversions/FromBytes/AxoBytesToDint.st | 21 ++ .../Conversions/FromBytes/AxoBytesToInt.st | 18 + .../Conversions/AxoConversions_UnitTests.st | 33 ++ src/ws.code-workspace | 37 -- 79 files changed, 2324 insertions(+), 253 deletions(-) create mode 100644 src/AXOpen.Cognex.Vision/ctrl/.gitignore create mode 100644 src/AXOpen.Cognex.Vision/ctrl/AXSharp.config.json create mode 100644 src/AXOpen.Cognex.Vision/ctrl/apax.yml create mode 100644 src/AXOpen.Cognex.Vision/ctrl/package-lock.json create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/AxoDataman.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanClearResultData.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanRead.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionControl.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionStatus.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Config.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Results.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsControl.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsStatus.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SignalStates.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventControl.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventStatus.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Status.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_User.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_ResultDataSize.st create mode 100644 src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_UserDataSize.st create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/ExampleJsInterop.cs create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/Properties/AssemblyInfo.cs create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/_Imports.razor create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/axopen_cognex_vision_blazor.csproj create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/package-lock.json create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/wwwroot/background.png create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/wwwroot/exampleJsInterop.js create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Properties/AssemblyInfo.cs create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.Designer.cs create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.resx create mode 100644 src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/ix_ax_axopen_cognex_vision.csproj create mode 100644 src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/Usings.cs create mode 100644 src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/axopen_cognex_vision_tests.csproj create mode 100644 src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/xunit.runner.json create mode 100644 src/components.abstractions/ctrl/.gitignore create mode 100644 src/components.abstractions/ctrl/AXSharp.config.json create mode 100644 src/components.abstractions/ctrl/apax.yml create mode 100644 src/components.abstractions/ctrl/package-lock.json create mode 100644 src/components.abstractions/ctrl/src/IAxoCodeReader.st create mode 100644 src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/Properties/AssemblyInfo.cs create mode 100644 src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/_Imports.razor create mode 100644 src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/axopen_components_abstractions_blazor.csproj create mode 100644 src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/package-lock.json create mode 100644 src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/wwwroot/background.png create mode 100644 src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/wwwroot/exampleJsInterop.js create mode 100644 src/components.abstractions/src/AXOpen.Components.Abstractions/Properties/AssemblyInfo.cs create mode 100644 src/components.abstractions/src/AXOpen.Components.Abstractions/Resources/PlcStringResources.Designer.cs create mode 100644 src/components.abstractions/src/AXOpen.Components.Abstractions/Resources/PlcStringResources.resx create mode 100644 src/components.abstractions/src/AXOpen.Components.Abstractions/ix_ax_axopen_components_abstractions.csproj create mode 100644 src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/Usings.cs create mode 100644 src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/axopen_components_abstractions_tests.csproj create mode 100644 src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/xunit.runner.json create mode 100644 src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/AxoCognexVisionDatamanExample.st create mode 100644 src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/CopyInputs.st create mode 100644 src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/CopyOutputs.st create mode 100644 src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/HwInputs.st create mode 100644 src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/HwOutputs.st create mode 100644 src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/PlcInputs.st create mode 100644 src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/PlcOutputs.st create mode 100644 src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoCognexVision/AxoCognexVisionDatamanExample.razor create mode 100644 src/templates.simple/ctrl/.config/dotnet-tools.json delete mode 100644 src/utils/ctrl/src/AXOpenUtils/AxoXORs.st create mode 100644 src/utils/ctrl/src/Conversions/FromBytes/AxoBytesToDint.st create mode 100644 src/utils/ctrl/src/Conversions/FromBytes/AxoBytesToInt.st create mode 100644 src/utils/ctrl/test/Conversions/AxoConversions_UnitTests.st delete mode 100644 src/ws.code-workspace diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 21666e5cf..eddbaa55e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "AXSharp.ixc": { - "version": "0.14.0-alpha.112", + "version": "0.14.0-alpha.113", "commands": [ "ixc" ] @@ -15,13 +15,13 @@ ] }, "AXSharp.ixd": { - "version": "0.14.0-alpha.112", + "version": "0.14.0-alpha.113", "commands": [ "ixd" ] }, "AXSharp.ixr": { - "version": "0.14.0-alpha.112", + "version": "0.14.0-alpha.113", "commands": [ "ixr" ] diff --git a/cake/ApaxCmd.cs b/cake/ApaxCmd.cs index 5bbc2de7b..994f1cb59 100644 --- a/cake/ApaxCmd.cs +++ b/cake/ApaxCmd.cs @@ -46,6 +46,7 @@ public static void ApaxClean(this BuildContext context, (string folder, string n RedirectStandardError = false, Silent = false }).WaitForExit(); + context.Log.Information($"apax clean finished for '{lib.folder} : {lib.name}'"); } public static void ApaxClean(this BuildContext context, (string folder, string name, string targetIp, string targetPlatform) app) diff --git a/cake/BuildContext.cs b/cake/BuildContext.cs index cc20d706a..7651544ca 100644 --- a/cake/BuildContext.cs +++ b/cake/BuildContext.cs @@ -144,6 +144,8 @@ public BuildContext(ICakeContext context, BuildParameters buildParameters) ("core", "axopen.core"), ("data", "axopen.data"), ("probers", "axopen.probers"), + ("components.abstractions", "axopen.components.abstractions"), + ("AXOpen.Cognex.Vision", "axopen.cognex.vision"), }; public IEnumerable<(string folder, string name, string targetIp, string targetPlatform)> Integrations { get; } = new[] diff --git a/src/AXOpen.Cognex.Vision/ctrl/.gitignore b/src/AXOpen.Cognex.Vision/ctrl/.gitignore new file mode 100644 index 000000000..0228acd94 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/.gitignore @@ -0,0 +1,8 @@ +.apax +.env +bin + +obj +testresult + +*.apax.tgz diff --git a/src/AXOpen.Cognex.Vision/ctrl/AXSharp.config.json b/src/AXOpen.Cognex.Vision/ctrl/AXSharp.config.json new file mode 100644 index 000000000..655bdb431 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/AXSharp.config.json @@ -0,0 +1 @@ +{"OutputProjectFolder":"..\\src\\AXOpen.Cognex.Vision"} \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/apax.yml b/src/AXOpen.Cognex.Vision/ctrl/apax.yml new file mode 100644 index 000000000..8732ee17a --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/apax.yml @@ -0,0 +1,19 @@ +name: "@ix-ax/axopen.cognex.vision" +version: '0.1.4-alpha.79' +type: lib +targets: + - axunit-llvm + - llvm +files: + - src +devDependencies: + "@ax/sdk": ^4.0.3 +scripts: + # prebuild: + # - dotnet ixc + postbuild: + - dotnet ixc +dependencies: + "@ix-ax/axopen.components.abstractions": '0.1.4-alpha.79' + "@ix-ax/axopen.utils": '0.1.4-alpha.79' + "@ax/system-timer": ^4.0.1 diff --git a/src/AXOpen.Cognex.Vision/ctrl/package-lock.json b/src/AXOpen.Cognex.Vision/ctrl/package-lock.json new file mode 100644 index 000000000..a1067c7ca --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/package-lock.json @@ -0,0 +1,11 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "bootstrap-icons": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.3.tgz", + "integrity": "sha512-7Qvj0j0idEm/DdX9Q0CpxAnJYqBCFCiUI6qzSPYfERMcokVuV9Mdm/AJiVZI8+Gawe4h/l6zFcOzvV7oXCZArw==" + } + } +} diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/AxoDataman.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/AxoDataman.st new file mode 100644 index 000000000..33165fce3 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/AxoDataman.st @@ -0,0 +1,357 @@ +USING AXOpen.Core; +USING AXOpen.Components.Abstractions; + +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + + CLASS PUBLIC AxoDataman EXTENDS AXOpen.Core.AxoComponent IMPLEMENTS AXOpen.Components.Abstractions.IAxoCodeReader + VAR PUBLIC + {#ix-attr:[Container(Layout.Wrap)]} + {#ix-attr:[ComponentHeader()]} + {#ix-set:AttributeName = "<#Read#>"} + _readTask : AxoDatamanRead; + {#ix-attr:[ComponentHeader()]} + {#ix-attr:[ReadOnly()]} + {#ix-set:AttributeName = "<#Results#>"} + Results : AxoDataman_Results; + + {#ix-attr:[Container(Layout.Wrap)]} + {#ix-attr:[ComponentDetails("Tasks")]} + {#ix-set:AttributeName = "<#Restore#>"} + _restoreTask : AXOpen.Core.AxoTask; + {#ix-attr:[ComponentDetails("Tasks")]} + {#ix-set:AttributeName = "<#Update signal states#>"} + _updateSignalStatesTask : AXOpen.Core.AxoTask; + {#ix-attr:[ComponentDetails("Tasks")]} + {#ix-set:AttributeName = "<#Clear result data#>"} + _clearResultDataTask : AxoDatamanClearResultData; + + + {#ix-attr:[Container(Layout.Wrap)]} + {#ix-attr:[ComponentDetails("Config")]} + {#ix-attr:[ReadOnly()]} + Config : AxoDataman_Config; + + {#ix-attr:[Container(Layout.Wrap)]} + {#ix-attr:[ComponentDetails("Status")]} + {#ix-attr:[ReadOnly()]} + Status : AxoDataman_Status; + + {#ix-attr:[Container(Layout.Wrap)]} + {#ix-attr:[ComponentDetails("User data")]} + User : AxoDataman_User; + END_VAR + + VAR PRIVATE + _AcquisitionControl : AxoDataman_AcquisitionControl; + _AcquisitionStatus : AxoDataman_AcquisitionStatus; + _ResultsControl : AxoDataman_ResultsControl; + _ResultsStatus : AxoDataman_ResultsStatus; + _SoftEventControl : AxoDataman_SoftEventControl; + _SoftEventStatus : AxoDataman_SoftEventStatus; + _taskDisabled : BOOL; + END_VAR + + /// + /// Restores this instance. + /// + METHOD PROTECTED OVERRIDE Restore: IAxoTask + VAR + _index : INT; + END_VAR + + _updateSignalStatesTask.Restore(); + _clearResultDataTask.Restore(); + _readTask.Restore(); + + Results.Code := UINT#0; + Results.Extended := UINT#0; + Results.Id := UINT#0; + Results.Length := UINT#0; + + FOR _index := 0 TO 245 DO + Results.Data[_index] := BYTE#0; + END_FOR; + + _AcquisitionControl.TriggerEnable := FALSE; + _AcquisitionControl.Trigger := FALSE; + + _ResultsControl.EnableResultBuffering := FALSE; + _ResultsControl.ResultsAcknowledge := FALSE; + + _SoftEventControl.TrainCode := FALSE; + _SoftEventControl.TrainMatchString := FALSE; + _SoftEventControl.TrainFocus := FALSE; + _SoftEventControl.TrainBrightness := FALSE; + _SoftEventControl.Untrain := FALSE; + _SoftEventControl.ExecuteDMCC := FALSE; + _SoftEventControl.Reserved06 := FALSE; + _SoftEventControl.SetMatchString := FALSE; + + User.Option := UINT#0; + User.Length := UINT#0; + FOR _index := 0 TO 245 DO + User.Data[_index] := BYTE#0; + END_FOR; + + Status.ActionDescription := '<#Restore executed!#>'; + _restoreTask.Restore(); + END_METHOD + + /// + /// Custom logic for manual control of the AxoDataman. + /// + METHOD PROTECTED OVERRIDE ManualControl + ; + END_METHOD + + METHOD PRIVATE UpdateInputs + VAR_INPUT + AcquisitionStatus : ARRAY[0..2] OF BYTE; + ResultsStatus : BYTE; + SoftEventStatus : BYTE; + END_VAR + VAR_IN_OUT + ResultData : ARRAY[*] OF BYTE; + END_VAR + + _AcquisitionStatus.TriggerReady := AcquisitionStatus[0].%X0; + _AcquisitionStatus.TriggerAcknowledge := AcquisitionStatus[0].%X1; + _AcquisitionStatus.MissedAcquisition := AcquisitionStatus[0].%X3; + _AcquisitionStatus.TriggerID.%B0 := AcquisitionStatus[1]; //TODO check order of the bytes + _AcquisitionStatus.TriggerID.%B1 := AcquisitionStatus[2]; //TODO check order of the bytes + + _ResultsStatus.Decoding := ResultsStatus.%X0; + _ResultsStatus.DecodeComplete := ResultsStatus.%X1; + _ResultsStatus.ResultsBufferOverrun := ResultsStatus.%X2; + _ResultsStatus.ResultsAvailable := ResultsStatus.%X3; + _ResultsStatus.ErrorDetected := ResultsStatus.%X7; + + _SoftEventStatus.TrainCodeAcknowledge := SoftEventStatus.%X0; + _SoftEventStatus.TrainMatchStringAcknowledge := SoftEventStatus.%X1; + _SoftEventStatus.TrainFocusAcknowledge := SoftEventStatus.%X2; + _SoftEventStatus.TrainBrightnessAcknowledge := SoftEventStatus.%X3; + _SoftEventStatus.UntrainAcknowledge := SoftEventStatus.%X4; + _SoftEventStatus.ExecuteDmccAcknowledge := SoftEventStatus.%X5; + _SoftEventStatus.Reserved06 := SoftEventStatus.%X6; + _SoftEventStatus.SetMatchStringAcknowledge := SoftEventStatus.%X7; + + IF (LOWER_BOUND(ResultData,1) = 0) THEN + IF (UPPER_BOUND(ResultData,1) = 23) THEN + Config.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_16B; + ELSIF (UPPER_BOUND(ResultData,1) = 39) THEN + Config.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_32B; + ELSIF (UPPER_BOUND(ResultData,1) = 71) THEN + Config.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_64B; + ELSIF (UPPER_BOUND(ResultData,1) = 135) THEN + Config.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_128B; + ELSIF (UPPER_BOUND(ResultData,1) = 253) THEN + Config.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_246B; + ELSE + Config.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_SIZE_INVALID; + END_IF; + ELSE + Config.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_SIZE_INVALID; + END_IF; + + IF(Config.ResultDataSize <> eAxoDataman_ResultDataSize#RESULT_DATA_SIZE_INVALID) THEN + Results.Id.%B0 := ResultData[0]; //TODO check order of the bytes + Results.Id.%B1 := ResultData[1]; //TODO check order of the bytes + Results.Code.%B0 := ResultData[2]; //TODO check order of the bytes + Results.Code.%B1 := ResultData[3]; //TODO check order of the bytes + Results.Extended.%B0 := ResultData[4]; //TODO check order of the bytes + Results.Extended.%B1 := ResultData[5]; //TODO check order of the bytes + Results.Length.%B0 := ResultData[6]; //TODO check order of the bytes + Results.Length.%B1 := ResultData[7]; //TODO check order of the bytes + END_IF; + + END_METHOD + + METHOD PRIVATE UpdateOutputs + VAR_IN_OUT + AcquisitionControl : BYTE; + ResultsControl : BYTE; + SoftEventControl : BYTE; + UserData : ARRAY[*] OF BYTE; + END_VAR + + AcquisitionControl.%X0 := _AcquisitionControl.Trigger; + AcquisitionControl.%X1 := _AcquisitionControl.TriggerEnable; + + ResultsControl.%X0 := _ResultsControl.EnableResultBuffering; + ResultsControl.%X1 := _ResultsControl.ResultsAcknowledge; + + SoftEventControl.%X0 := _SoftEventControl.TrainCode; + SoftEventControl.%X1 := _SoftEventControl.TrainMatchString; + SoftEventControl.%X2 := _SoftEventControl.TrainFocus; + SoftEventControl.%X3 := _SoftEventControl.TrainBrightness; + SoftEventControl.%X4 := _SoftEventControl.Untrain; + SoftEventControl.%X5 := _SoftEventControl.ExecuteDMCC; + SoftEventControl.%X6 := _SoftEventControl.Reserved06; + SoftEventControl.%X7 := _SoftEventControl.SetMatchString; + + IF (LOWER_BOUND(UserData,1) = 0) THEN + IF (UPPER_BOUND(UserData,1) = 19) THEN + Config.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_16B; + ELSIF (UPPER_BOUND(UserData,1) = 35) THEN + Config.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_32B; + ELSIF (UPPER_BOUND(UserData,1) = 67) THEN + Config.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_64B; + ELSIF (UPPER_BOUND(UserData,1) = 131) THEN + Config.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_128B; + ELSIF (UPPER_BOUND(UserData,1) = 253) THEN + Config.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_250B; + ELSE + Config.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_SIZE_INVALID; + END_IF; + ELSE + Config.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_SIZE_INVALID; + END_IF; + + IF(Config.UserDataSize <> eAxoDataman_UserDataSize#USER_DATA_SIZE_INVALID) THEN + UserData[0] := User.Option.%B0; //TODO check order of the bytes + UserData[1] := User.Option.%B1; //TODO check order of the bytes + UserData[2] := User.Length.%B0; //TODO check order of the bytes + UserData[3] := User.Length.%B0; //TODO check order of the bytes + END_IF; + END_METHOD + + METHOD PROTECTED OVERRIDE Open + SUPER.Open(); + END_METHOD + + METHOD PUBLIC Run + VAR_INPUT + parent : IAxoObject; + AcquisitionStatus : ARRAY[0..2] OF BYTE; + ResultsStatus : BYTE; + SoftEventStatus : BYTE; + END_VAR + VAR_IN_OUT + ResultData : ARRAY[*] OF BYTE; + AcquisitionControl : BYTE; + ResultsControl : BYTE; + SoftEventControl : BYTE; + UserData : ARRAY[*] OF BYTE; + END_VAR + + THIS.Initialize(parent); + THIS.Open(); + THIS.Execute(AcquisitionStatus,ResultsStatus,SoftEventStatus,ResultData,AcquisitionControl,ResultsControl,SoftEventControl,UserData); + THIS.Close(); + END_METHOD + + METHOD PUBLIC Run + VAR_INPUT + parent : IAxoContext; + AcquisitionStatus : ARRAY[0..2] OF BYTE; + ResultsStatus : BYTE; + SoftEventStatus : BYTE; + END_VAR + VAR_IN_OUT + ResultData : ARRAY[*] OF BYTE; + AcquisitionControl : BYTE; + ResultsControl : BYTE; + SoftEventControl : BYTE; + UserData : ARRAY[*] OF BYTE; + END_VAR + + THIS.Initialize(parent); + THIS.Open(); + THIS.Execute(AcquisitionStatus,ResultsStatus,SoftEventStatus,ResultData,AcquisitionControl,ResultsControl,SoftEventControl,UserData); + THIS.Close(); + END_METHOD + + METHOD PRIVATE Execute + VAR_INPUT + AcquisitionStatus : ARRAY[0..2] OF BYTE; + ResultsStatus : BYTE; + SoftEventStatus : BYTE; + END_VAR + VAR_IN_OUT + ResultData : ARRAY[*] OF BYTE; + AcquisitionControl : BYTE; + ResultsControl : BYTE; + SoftEventControl : BYTE; + UserData : ARRAY[*] OF BYTE; + END_VAR + + _restoreTask.Initialize(THIS); + _updateSignalStatesTask.Initialize(THIS); + _clearResultDataTask.Initialize(THIS); + _readTask.Initialize(THIS); + + THIS.UpdateInputs(AcquisitionStatus,ResultsStatus,SoftEventStatus,ResultData); + + //*************RESTORE******************** + _taskDisabled := FALSE; + _restoreTask.IsDisabled := _taskDisabled; + IF _restoreTask.Execute() THEN + THIS.Restore(); + END_IF; + //**************************************** + + //*************UPDATE********************* + _taskDisabled := _taskDisabled OR _restoreTask.IsBusy(); + _updateSignalStatesTask.IsDisabled:= _taskDisabled; + IF _updateSignalStatesTask.Execute() THEN + THIS.UpdateSignalStates(); + END_IF; + //**************************************** + + //*************CLEAR*DATA***************** + _taskDisabled := _taskDisabled OR _updateSignalStatesTask.IsBusy(); + _clearResultDataTask.IsDisabled := _taskDisabled; + _clearResultDataTask.Run(_AcquisitionControl,_AcquisitionStatus,_ResultsControl,_ResultsStatus,Config,Status,Results); + //**************************************** + + + //*************READ*********************** + _taskDisabled := _taskDisabled OR _clearResultDataTask.IsBusy(); + _readTask.IsDisabled := _taskDisabled; + _readTask.Run(_AcquisitionControl,_AcquisitionStatus,_ResultsControl,_ResultsStatus,ResultData,Config,Status,Results); + //**************************************** + + THIS.UpdateOutputs(AcquisitionControl,ResultsControl,SoftEventControl,UserData); + END_METHOD + + METHOD PROTECTED OVERRIDE Close + SUPER.Close(); + END_METHOD + + METHOD PUBLIC ClearResultData : IAxoTaskState + ClearResultData :=_clearResultDataTask.Invoke();; + END_METHOD + + METHOD PUBLIC Read : IAxoTaskState + Read := _readTask.Invoke(); + END_METHOD + + METHOD PRIVATE UpdateSignalStates + Status.SignalStatus.TriggerEnable := _AcquisitionControl.TriggerEnable; + Status.SignalStatus.Trigger := _AcquisitionControl.Trigger; + + Status.SignalStatus.EnableResultBuffering := _ResultsControl.EnableResultBuffering; + Status.SignalStatus.ResultsAcknowledge := _ResultsControl.ResultsAcknowledge; + + Status.SignalStatus.TriggerReady := _AcquisitionStatus.TriggerReady; + Status.SignalStatus.TriggerAcknowledge := _AcquisitionStatus.TriggerAcknowledge; + Status.SignalStatus.Acquiring := _AcquisitionStatus.Acquiring; + Status.SignalStatus.MissedAcquisition := _AcquisitionStatus.MissedAcquisition; + Status.SignalStatus.TriggerID := _AcquisitionStatus.TriggerID; + + Status.SignalStatus.Decoding := _ResultsStatus.Decoding; + Status.SignalStatus.DecodeComplete := _ResultsStatus.DecodeComplete; + Status.SignalStatus.ResultsBufferOverrun := _ResultsStatus.ResultsBufferOverrun; + Status.SignalStatus.ResultsAvailable := _ResultsStatus.ResultsAvailable; + Status.SignalStatus.ErrorDetected := _ResultsStatus.ErrorDetected; + + Status.SignalStatus.ResultID := Results.ID; + Status.SignalStatus.ResultCode := Results.Code; + Status.SignalStatus.ResultExtended := Results.Extended; + Status.SignalStatus.ResultLength := Results.Length; + + _updateSignalStatesTask.DoneWhen(TRUE); + END_METHOD + END_CLASS + +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanClearResultData.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanClearResultData.st new file mode 100644 index 000000000..6d9f7d15f --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanClearResultData.st @@ -0,0 +1,116 @@ +//USING AXOpen.Core; + +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + CLASS PUBLIC AxoDatamanClearResultData EXTENDS AXOpen.Core.AxoTask + VAR PROTECTED + _progress : INT := 0; + _infoTimer : System.Timer.OnDelay; + _errorTimer : System.Timer.OnDelay; + + // _varInfo : __SYSTEM.VAR_INFO; + // _sb : TcoCore.StringBuilder; + END_VAR + + VAR PRIVATE + _infoTime : LTIME := LT#2S; + _errorTime : LTIME := LT#5S; + END_VAR + + METHOD PUBLIC Run + VAR_IN_OUT + AcquisitionControl : AxoDataman_AcquisitionControl; + AcquisitionStatus : AxoDataman_AcquisitionStatus; + ResultsControl : AxoDataman_ResultsControl; + ResultsStatus : AxoDataman_ResultsStatus; + Config : AxoDataman_Config; + Status : AxoDataman_Status; + Results : AxoDataman_Results; + END_VAR + + VAR + _index : INT; + END_VAR + + IF THIS.Execute() THEN + IF _progress = 0 THEN + _infoTime := Config.InfoTime; + _errorTime := Config.ErrorTime; + // IF NOT __ISVALIDREF(inoIoData) THEN + // _varInfo :=__VARINFO(inoIoData); + // Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); + // ELSIF NOT __ISVALIDREF(inoConfig) THEN + // _varInfo :=__VARINFO(inoConfig); + // Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); + // ELSIF NOT __ISVALIDREF(inoStatus) THEN + // _varInfo :=__VARINFO(inoStatus); + // Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); + // ELSIF NOT __ISVALIDREF(inoResults) THEN + // _varInfo :=__VARINFO(inoResults); + // Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); + // ELSE + _progress := _progress + 1; + // END_IF; + END_IF; + + IF _progress = 1 THEN + Status.ActionDescription := '<#Clearing of the result data running.#>'; + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + + IF _progress = 2 THEN + AcquisitionControl.TriggerEnable := FALSE; + AcquisitionControl.Trigger := FALSE; + ResultsControl.ResultsAcknowledge := TRUE; + // THIS^.Messenger.OnCondition(_infoTimer.Q).Warning('<#Waiting for the result data cleared!#>').Pin(); + Results.Id := UINT#0; + Results.Code := UINT#0; + Results.Extended := UINT#0; + Results.Length := UINT#0; + + FOR _index := 0 TO 245 DO + Results.Data[_index] := BYTE#0; + END_FOR; + //IF Tc2_System.MEMSET(destAddr:= ADR(THIS^.inoResults.Data) , fillByte:= 0 , n:= SIZEOF(THIS^.inoResults.Data)) >0 THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + //END_IF; + END_IF; + + IF _progress = 3 THEN + // THIS^.Messenger.OnCondition(_infoTimer.Q).Warning('<#Waiting for the signal ResultsAvailable to be reseted!#>').Pin(); + IF NOT ResultsStatus.ResultsAvailable THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 4 THEN + ResultsControl.ResultsAcknowledge := FALSE; + THIS.DoneWhen(TRUE); + THIS.CallTimers(FALSE); + _progress := 0; + END_IF; + + THIS.CallTimers(TRUE); + + THIS.ThrowWhen(_errorTimer.output); + END_IF; + + END_METHOD + + METHOD PRIVATE CallTimers + VAR_INPUT + signal : BOOL; + END_VAR + + _infoTimer(signal , _infoTime); + _errorTimer(signal , _errorTime ); + END_METHOD + + METHOD PROTECTED OVERRIDE OnRestore + _progress := 0; + THIS.CallTimers(FALSE); + END_METHOD + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanRead.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanRead.st new file mode 100644 index 000000000..e16270365 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanRead.st @@ -0,0 +1,144 @@ +// USING AXOpen.Core; + +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + CLASS PUBLIC AxoDatamanRead EXTENDS AXOpen.Core.AxoTask + VAR PROTECTED + _progress : INT := 0; + _infoTimer : System.Timer.OnDelay; + _errorTimer : System.Timer.OnDelay; + + // _varInfo : __SYSTEM.VAR_INFO; + // _sb : TcoCore.StringBuilder; + END_VAR + + VAR PRIVATE + _infoTime : LTIME := LT#2S; + _errorTime : LTIME := LT#5S; + END_VAR + + METHOD PUBLIC Run + VAR_IN_OUT + AcquisitionControl : AxoDataman_AcquisitionControl; + AcquisitionStatus : AxoDataman_AcquisitionStatus; + ResultsControl : AxoDataman_ResultsControl; + ResultsStatus : AxoDataman_ResultsStatus; + ResultData : ARRAY[*] OF BYTE; + Config : AxoDataman_Config; + Status : AxoDataman_Status; + Results : AxoDataman_Results; + END_VAR + + VAR + _index : INT; + END_VAR + + IF THIS.Execute() THEN + IF _progress = 0 THEN + // IF NOT __ISVALIDREF(inoIoData) THEN + // _varInfo :=__VARINFO(inoIoData); + // Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); + // ELSIF NOT __ISVALIDREF(inoConfig) THEN + // _varInfo :=__VARINFO(inoConfig); + // Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); + // ELSIF NOT __ISVALIDREF(inoStatus) THEN + // _varInfo :=__VARINFO(inoStatus); + // Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); + // ELSIF NOT __ISVALIDREF(inoResults) THEN + // _varInfo :=__VARINFO(inoResults); + // Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); + // ELSE + _progress := _progress + 1; + // END_IF; + END_IF; + + IF _progress = 1 THEN + Status.ActionDescription := '<#Reading running.#>'; + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + + IF _progress = 2 THEN + AcquisitionControl.TriggerEnable := TRUE; + AcquisitionControl.Trigger := FALSE; + ResultsControl.EnableResultBuffering := FALSE; + ResultsControl.ResultsAcknowledge := ResultsStatus.ResultsAvailable; + // THIS^.Messenger.OnCondition(_infoTimer.Q).Warning('<#Waiting for the signal ResultsAvailable to be reseted!#>').Pin(); + IF NOT ResultsStatus.ResultsAvailable THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 3 THEN + // THIS^.Messenger.OnCondition(_infoTimer.Q).Warning('<#Waiting for the signal TriggerReady to be set!#>').Pin(); + IF AcquisitionStatus.TriggerReady THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 4 THEN + AcquisitionControl.Trigger := TRUE; + // THIS^.Messenger.OnCondition(_infoTimer.Q).Warning('<#Waiting for the signal TriggerAcknowledge to be set!#>').Pin(); + IF AcquisitionStatus.TriggerAcknowledge THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 5 THEN + // THIS^.Messenger.OnCondition(_infoTimer.Q).Warning('<#Waiting for the signal ResultsAvailable to be set!#>').Pin(); + IF ResultsStatus.ResultsAvailable THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 6 THEN + THIS.ThrowWhen(Results.Code = UINT#0 OR Results.Length=UINT#0 OR Results.Length > TO_UINT(Config.ResultDataSize)); + // THIS^.inoResults.Length := THIS^.inoIoData.ResultData.ResultLength; + // THIS^.Messenger.OnCondition(_infoTimer.Q).Warning('<#Waiting for the ResultData copied!#>').Pin(); + // IF Tc2_System.MEMCPY(srcAddr := ADR(THIS^.inoIoData.ResultData.ResultData) , destAddr:= ADR(THIS^.inoResults.Data) , n:= THIS^.inoResults.Length) > 0 AND + // Tc2_System.MEMSET(destAddr:= ADR(THIS^.inoResults.Data) + THIS^.inoResults.Length, fillByte:= 0 , n:= SIZEOF(THIS^.inoResults.Data) - THIS^.inoResults.Length)>0 THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + // END_IF; + END_IF; + + IF _progress = 7 THEN + FOR _index := 0 TO (TO_INT(Results.Length) - 1) DO + Results.Data[_index] := ResultData[_index + 8]; + END_FOR; + FOR _index := TO_INT(Results.Length) TO 245 DO + Results.Data[_index] := BYTE#0; + END_FOR; + + AcquisitionControl.Trigger := FALSE; + ResultsControl.EnableResultBuffering := FALSE; + ResultsControl.ResultsAcknowledge := TRUE; + THIS.DoneWhen(TRUE); + _progress := 0; + END_IF; + + THIS.CallTimers(TRUE); + + THIS.ThrowWhen(_errorTimer.output); + + END_IF; + END_METHOD + + METHOD PRIVATE CallTimers + VAR_INPUT + signal : BOOL; + END_VAR + + _infoTimer(signal , _infoTime); + _errorTimer(signal , _errorTime ); + END_METHOD + + METHOD PROTECTED OVERRIDE OnRestore + _progress := 0; + THIS.CallTimers(FALSE); + END_METHOD + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionControl.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionControl.st new file mode 100644 index 000000000..c7180e31b --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionControl.st @@ -0,0 +1,9 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + AxoDataman_AcquisitionControl : + STRUCT + TriggerEnable : BOOL; + Trigger : BOOL; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionStatus.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionStatus.st new file mode 100644 index 000000000..1ff1ae920 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionStatus.st @@ -0,0 +1,12 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + AxoDataman_AcquisitionStatus : + STRUCT + TriggerReady : BOOL; + TriggerAcknowledge : BOOL; + Acquiring : BOOL; + MissedAcquisition : BOOL; + TriggerID : UINT; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Config.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Config.st new file mode 100644 index 000000000..d35997e37 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Config.st @@ -0,0 +1,16 @@ +USING System.SerDe; + +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + {#ix-attr:[Container(Layout.Stack)]} + AxoDataman_Config : + STRUCT + ResultDataSize : eAxoDataman_ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_64B; + UserDataSize : eAxoDataman_UserDataSize := eAxoDataman_UserDataSize#USER_DATA_64B; + DataFormat : Endianness := Endianness#Big; + ContinuousReading : BOOL := FALSE; + InfoTime : LTIME := LT#2S; + ErrorTime : LTIME := LT#5S; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Results.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Results.st new file mode 100644 index 000000000..c777672d3 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Results.st @@ -0,0 +1,12 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + AxoDataman_Results : + STRUCT + Id: UINT; + Code: UINT; + Extended: UINT; + Length : UINT; + Data : ARRAY[0..245] OF BYTE; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsControl.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsControl.st new file mode 100644 index 000000000..2b80b85f2 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsControl.st @@ -0,0 +1,9 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + AxoDataman_ResultsControl : + STRUCT + EnableResultBuffering : BOOL; + ResultsAcknowledge : BOOL; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsStatus.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsStatus.st new file mode 100644 index 000000000..f31c43954 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsStatus.st @@ -0,0 +1,12 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + AxoDataman_ResultsStatus : + STRUCT + Decoding : BOOL; + DecodeComplete : BOOL; + ResultsBufferOverrun : BOOL; + ResultsAvailable : BOOL; + ErrorDetected : BOOL; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SignalStates.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SignalStates.st new file mode 100644 index 000000000..4ccd67c25 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SignalStates.st @@ -0,0 +1,49 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + {attribute addProperty Name "<#Signal states#>"} + {#ix-attr:[Container(Layout.Wrap)]} + AxoDataman_SignalStates : + STRUCT + {attribute addProperty Name "<#Trigger enable#>"} + TriggerEnable : BOOL; + {attribute addProperty Name "<#Trigger#>"} + Trigger : BOOL; + + {attribute addProperty Name "<#Enable result buffering#>"} + EnableResultBuffering : BOOL; + {attribute addProperty Name "<#Result acknowledge#>"} + ResultsAcknowledge : BOOL; + + {attribute addProperty Name "<#Trigger ready#>"} + TriggerReady : BOOL; + {attribute addProperty Name "<#Trigger acknowledge#>"} + TriggerAcknowledge : BOOL; + {attribute addProperty Name "<#Acquiring#>"} + Acquiring : BOOL; + {attribute addProperty Name "<#Missed acquisition#>"} + MissedAcquisition : BOOL; + {attribute addProperty Name "<#Trigger ID#>"} + TriggerID : UINT; + + {attribute addProperty Name "<#Decoding#>"} + Decoding : BOOL; + {attribute addProperty Name "<#Decode complete#>"} + DecodeComplete : BOOL; + {attribute addProperty Name "<#Result buffer overrun#>"} + ResultsBufferOverrun : BOOL; + {attribute addProperty Name "<#Results available#>"} + ResultsAvailable : BOOL; + {attribute addProperty Name "<#Error detected#>"} + ErrorDetected : BOOL; + + {attribute addProperty Name "<#Result ID#>"} + ResultID : UINT; + {attribute addProperty Name "<#Result code#>"} + ResultCode : UINT; + {attribute addProperty Name "<#Result extended#>"} + ResultExtended : UINT; + {attribute addProperty Name "<#Result length#>"} + ResultLength : UINT; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventControl.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventControl.st new file mode 100644 index 000000000..d987ac64d --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventControl.st @@ -0,0 +1,15 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + AxoDataman_SoftEventControl : + STRUCT + TrainCode : BOOL; + TrainMatchString : BOOL; + TrainFocus : BOOL; + TrainBrightness : BOOL; + Untrain : BOOL; + ExecuteDMCC : BOOL; + Reserved06 : BOOL; + SetMatchString : BOOL; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventStatus.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventStatus.st new file mode 100644 index 000000000..2d8e3a7bd --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventStatus.st @@ -0,0 +1,15 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + AxoDataman_SoftEventStatus : + STRUCT + TrainCodeAcknowledge : BOOL; + TrainMatchStringAcknowledge : BOOL; + TrainFocusAcknowledge : BOOL; + TrainBrightnessAcknowledge : BOOL; + UntrainAcknowledge : BOOL; + ExecuteDMCCAcknowledge : BOOL; + Reserved06 : BOOL; + SetMatchStringAcknowledge : BOOL; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Status.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Status.st new file mode 100644 index 000000000..ab349dfcf --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Status.st @@ -0,0 +1,10 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + {#ix-attr:[Container(Layout.Stack)]} + AxoDataman_Status : + STRUCT + ActionDescription : STRING[100]; + SignalStatus : AxoDataman_SignalStates; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_User.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_User.st new file mode 100644 index 000000000..1a9480698 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_User.st @@ -0,0 +1,10 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + AxoDataman_User : + STRUCT + Option : UINT; + Length : UINT; + Data : ARRAY[0..249] OF BYTE; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_ResultDataSize.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_ResultDataSize.st new file mode 100644 index 000000000..4488150e5 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_ResultDataSize.st @@ -0,0 +1,13 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE PUBLIC + eAxoDataman_ResultDataSize : INT + ( + RESULT_DATA_SIZE_INVALID := 0, + RESULT_DATA_16B := 16, + RESULT_DATA_32B := 32, + RESULT_DATA_64B := 64, + RESULT_DATA_128B := 128, + RESULT_DATA_246B := 246 + ) := RESULT_DATA_64B; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_UserDataSize.st b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_UserDataSize.st new file mode 100644 index 000000000..5bb8a9b56 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_UserDataSize.st @@ -0,0 +1,13 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE PUBLIC + eAxoDataman_UserDataSize : INT + ( + USER_DATA_SIZE_INVALID := 0, + USER_DATA_16B := 16, + USER_DATA_32B := 32, + USER_DATA_64B := 64, + USER_DATA_128B := 128, + USER_DATA_250B := 250 + ) := USER_DATA_64B; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/ExampleJsInterop.cs b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/ExampleJsInterop.cs new file mode 100644 index 000000000..a8f8b7b5d --- /dev/null +++ b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/ExampleJsInterop.cs @@ -0,0 +1,37 @@ +using Microsoft.JSInterop; + +namespace ix.ax.core.blazor +{ + // This class provides an example of how JavaScript functionality can be wrapped + // in a .NET class for easy consumption. The associated JavaScript module is + // loaded on demand when first needed. + // + // This class can be registered as scoped DI service and then injected into Blazor + // components for use. + + //public class ExampleJsInterop : IAsyncDisposable + //{ + // private readonly Lazy> moduleTask; + + // public ExampleJsInterop(IJSRuntime jsRuntime) + // { + // moduleTask = new(() => jsRuntime.InvokeAsync( + // "import", "./_content/ix.ax.core.blazor/exampleJsInterop.js").AsTask()); + // } + + // public async ValueTask Prompt(string message) + // { + // var module = await moduleTask.Value; + // return await module.InvokeAsync("showPrompt", message); + // } + + // public async ValueTask DisposeAsync() + // { + // if (moduleTask.IsValueCreated) + // { + // var module = await moduleTask.Value; + // await module.DisposeAsync(); + // } + // } + //} +} \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/Properties/AssemblyInfo.cs b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..7fc953296 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using AXSharp.Presentation.Blazor.Attributes; + +[assembly: RenderableBlazorAssembly()] \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/_Imports.razor b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/_Imports.razor new file mode 100644 index 000000000..9ec08f956 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/_Imports.razor @@ -0,0 +1,2 @@ +@using Microsoft.AspNetCore.Components.Web +@using AXSharp.Presentation.Blazor.Controls.RenderableContent diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/axopen_cognex_vision_blazor.csproj b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/axopen_cognex_vision_blazor.csproj new file mode 100644 index 000000000..980278f6d --- /dev/null +++ b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/axopen_cognex_vision_blazor.csproj @@ -0,0 +1,31 @@ + + + + net7.0 + enable + enable + AXOpen.Cognex.Vision.Blazor + AXOpen.Cognex.Vision.Blazor + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/package-lock.json b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/package-lock.json new file mode 100644 index 000000000..a1067c7ca --- /dev/null +++ b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/package-lock.json @@ -0,0 +1,11 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "bootstrap-icons": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.3.tgz", + "integrity": "sha512-7Qvj0j0idEm/DdX9Q0CpxAnJYqBCFCiUI6qzSPYfERMcokVuV9Mdm/AJiVZI8+Gawe4h/l6zFcOzvV7oXCZArw==" + } + } +} diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/wwwroot/background.png b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/wwwroot/background.png new file mode 100644 index 0000000000000000000000000000000000000000..e15a3bde6e2bdb380df6a0b46d7ed00bdeb0aaa8 GIT binary patch literal 378 zcmeAS@N?(olHy`uVBq!ia0vp^x**KK1SGdsl%54rjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwr2>%=KS^ie7oTIEF;HpS|GCbyPusHSqiXaCu3qf)82(9Gq&mZq2{Kq}M*X&MWtJ zSi1Jo7ZzfImg%g=t(qo=wsSR2lZoP(Rj#3wacN=q0?Br(rXzgZEGK2$ID{|A=5S{xJEuzSH>!M+7wSY6hB<=-E^*n0W7 S8wY^CX7F_Nb6Mw<&;$S{dxtsz literal 0 HcmV?d00001 diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/wwwroot/exampleJsInterop.js b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/wwwroot/exampleJsInterop.js new file mode 100644 index 000000000..ea8d76ad2 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision.Blazor/wwwroot/exampleJsInterop.js @@ -0,0 +1,6 @@ +// This is a JavaScript module that is loaded on demand. It can export any number of +// functions, and may import other JavaScript modules if required. + +export function showPrompt(message) { + return prompt(message, 'Type anything here'); +} diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Properties/AssemblyInfo.cs b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..cb7f895ae --- /dev/null +++ b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; + +[assembly:InternalsVisibleTo("axopen_cognex_vision_tests")] \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.Designer.cs b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.Designer.cs new file mode 100644 index 000000000..53c5e8fe4 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.Designer.cs @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AXOpen.Core.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class PlcStringResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal PlcStringResources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AXOpen.Core.Resources.PlcStringResources", typeof(PlcStringResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Command state. + /// + public static string Command_state { + get { + return ResourceManager.GetString("Command_state", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run step. + /// + public static string Run_step { + get { + return ResourceManager.GetString("Run_step", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sequence mode. + /// + public static string Sequence_mode { + get { + return ResourceManager.GetString("Sequence_mode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stepping mode. + /// + public static string Stepping_mode { + get { + return ResourceManager.GetString("Stepping_mode", resourceCulture); + } + } + } +} diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.resx b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.resx new file mode 100644 index 000000000..0182b2b53 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.resx @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Command state + src\AxoTask\AxoTask.st,8 + + + Stepping mode + src\AxoCoordination\AxoSequencer\AxoSequencer.st,3 + + + Sequence mode + src\AxoCoordination\AxoSequencer\AxoSequencer.st,5 + + + Run step + src\AxoCoordination\AxoSequencer\AxoSequencer.st,10 + + \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/ix_ax_axopen_cognex_vision.csproj b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/ix_ax_axopen_cognex_vision.csproj new file mode 100644 index 000000000..a22929a50 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/src/AXOpen.Cognex.Vision/ix_ax_axopen_cognex_vision.csproj @@ -0,0 +1,29 @@ + + + net7.0 + enable + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + diff --git a/src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/Usings.cs b/src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/Usings.cs new file mode 100644 index 000000000..8c927eb74 --- /dev/null +++ b/src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/axopen_cognex_vision_tests.csproj b/src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/axopen_cognex_vision_tests.csproj new file mode 100644 index 000000000..aa6dfebfb --- /dev/null +++ b/src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/axopen_cognex_vision_tests.csproj @@ -0,0 +1,41 @@ + + + net7.0 + enable + enable + + false + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + Always + + + + diff --git a/src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/xunit.runner.json b/src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/xunit.runner.json new file mode 100644 index 000000000..7c6944a1d --- /dev/null +++ b/src/AXOpen.Cognex.Vision/tests/AXOpen.Cognex.Vision.Tests/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "parallelizeTestCollections": false, + "maxParallelThreads": -1 +} diff --git a/src/AXOpen.sln b/src/AXOpen.sln index c7121bc4f..fb69ae903 100644 --- a/src/AXOpen.sln +++ b/src/AXOpen.sln @@ -128,6 +128,30 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.Security.Blazor", "s EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.Security", "security\src\AXOpen.Security\AXOpen.Security.csproj", "{52B6EFDD-8FF9-4FA7-9624-2E7D8EEDD5C1}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AXOpen.Cognex.Vision", "AXOpen.Cognex.Vision", "{AC0F84EB-14D2-48B8-B300-1BA40C03B211}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9AA531A7-5755-4367-96AC-7B2E2710A88D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{6AFC7347-C33A-451E-85C9-53CE6988FB3C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "components.abstractions", "components.abstractions", "{7B7AAED6-B6BF-46B5-80FF-0AE11B4D0039}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5107F409-9BF4-4066-A73D-DABBCBEA096C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_components_abstractions", "components.abstractions\src\AXOpen.Components.Abstractions\ix_ax_axopen_components_abstractions.csproj", "{863F8789-8441-492F-B5B1-D647B4EE370E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D16A155E-75AE-48B5-8AC1-81112187DA28}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "axopen_components_abstractions_tests", "components.abstractions\tests\AXOpen.Components.Abstractions.Tests\axopen_components_abstractions_tests.csproj", "{B8E0FF16-6539-412C-B132-25561350C826}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_cognex_vision", "AXOpen.Cognex.Vision\src\AXOpen.Cognex.Vision\ix_ax_axopen_cognex_vision.csproj", "{BEACF24D-78B8-4B8D-B6A6-19475143AB50}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "axopen_cognex_vision_blazor", "AXOpen.Cognex.Vision\src\AXOpen.Cognex.Vision.Blazor\axopen_cognex_vision_blazor.csproj", "{96C2A3EE-76A1-4218-A04C-31AC69BCD398}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "axopen_cognex_vision_tests", "AXOpen.Cognex.Vision\tests\AXOpen.Cognex.Vision.Tests\axopen_cognex_vision_tests.csproj", "{58C24B69-00DC-40A7-9CC5-2AD5EE278E4B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "axopen_components_abstractions_blazor", "components.abstractions\src\AXOpen.Components.Abstractions.Blazor\axopen_components_abstractions_blazor.csproj", "{F99B9470-120F-4D27-8FD7-D1AF5C306A23}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -262,6 +286,30 @@ Global {52B6EFDD-8FF9-4FA7-9624-2E7D8EEDD5C1}.Debug|Any CPU.Build.0 = Debug|Any CPU {52B6EFDD-8FF9-4FA7-9624-2E7D8EEDD5C1}.Release|Any CPU.ActiveCfg = Release|Any CPU {52B6EFDD-8FF9-4FA7-9624-2E7D8EEDD5C1}.Release|Any CPU.Build.0 = Release|Any CPU + {863F8789-8441-492F-B5B1-D647B4EE370E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {863F8789-8441-492F-B5B1-D647B4EE370E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {863F8789-8441-492F-B5B1-D647B4EE370E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {863F8789-8441-492F-B5B1-D647B4EE370E}.Release|Any CPU.Build.0 = Release|Any CPU + {B8E0FF16-6539-412C-B132-25561350C826}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B8E0FF16-6539-412C-B132-25561350C826}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8E0FF16-6539-412C-B132-25561350C826}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B8E0FF16-6539-412C-B132-25561350C826}.Release|Any CPU.Build.0 = Release|Any CPU + {BEACF24D-78B8-4B8D-B6A6-19475143AB50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BEACF24D-78B8-4B8D-B6A6-19475143AB50}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BEACF24D-78B8-4B8D-B6A6-19475143AB50}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BEACF24D-78B8-4B8D-B6A6-19475143AB50}.Release|Any CPU.Build.0 = Release|Any CPU + {96C2A3EE-76A1-4218-A04C-31AC69BCD398}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96C2A3EE-76A1-4218-A04C-31AC69BCD398}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96C2A3EE-76A1-4218-A04C-31AC69BCD398}.Release|Any CPU.ActiveCfg = Release|Any CPU + {96C2A3EE-76A1-4218-A04C-31AC69BCD398}.Release|Any CPU.Build.0 = Release|Any CPU + {58C24B69-00DC-40A7-9CC5-2AD5EE278E4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58C24B69-00DC-40A7-9CC5-2AD5EE278E4B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58C24B69-00DC-40A7-9CC5-2AD5EE278E4B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58C24B69-00DC-40A7-9CC5-2AD5EE278E4B}.Release|Any CPU.Build.0 = Release|Any CPU + {F99B9470-120F-4D27-8FD7-D1AF5C306A23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F99B9470-120F-4D27-8FD7-D1AF5C306A23}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F99B9470-120F-4D27-8FD7-D1AF5C306A23}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F99B9470-120F-4D27-8FD7-D1AF5C306A23}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -317,6 +365,16 @@ Global {1EC46148-A114-4018-92BE-93F1E0273A33} = {FFD509A8-8D3C-4756-9B2E-10A063A246E9} {7DEF0B7B-0F6C-4829-A1A9-2C0C2720BF3C} = {8017588A-7145-460D-ACEB-402D7005DA33} {52B6EFDD-8FF9-4FA7-9624-2E7D8EEDD5C1} = {8017588A-7145-460D-ACEB-402D7005DA33} + {9AA531A7-5755-4367-96AC-7B2E2710A88D} = {AC0F84EB-14D2-48B8-B300-1BA40C03B211} + {6AFC7347-C33A-451E-85C9-53CE6988FB3C} = {AC0F84EB-14D2-48B8-B300-1BA40C03B211} + {5107F409-9BF4-4066-A73D-DABBCBEA096C} = {7B7AAED6-B6BF-46B5-80FF-0AE11B4D0039} + {863F8789-8441-492F-B5B1-D647B4EE370E} = {5107F409-9BF4-4066-A73D-DABBCBEA096C} + {D16A155E-75AE-48B5-8AC1-81112187DA28} = {7B7AAED6-B6BF-46B5-80FF-0AE11B4D0039} + {B8E0FF16-6539-412C-B132-25561350C826} = {D16A155E-75AE-48B5-8AC1-81112187DA28} + {BEACF24D-78B8-4B8D-B6A6-19475143AB50} = {9AA531A7-5755-4367-96AC-7B2E2710A88D} + {96C2A3EE-76A1-4218-A04C-31AC69BCD398} = {9AA531A7-5755-4367-96AC-7B2E2710A88D} + {58C24B69-00DC-40A7-9CC5-2AD5EE278E4B} = {6AFC7347-C33A-451E-85C9-53CE6988FB3C} + {F99B9470-120F-4D27-8FD7-D1AF5C306A23} = {5107F409-9BF4-4066-A73D-DABBCBEA096C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {292B45BE-E9CB-443B-979D-C0AFCD8D5675} diff --git a/src/components.abstractions/ctrl/.gitignore b/src/components.abstractions/ctrl/.gitignore new file mode 100644 index 000000000..0228acd94 --- /dev/null +++ b/src/components.abstractions/ctrl/.gitignore @@ -0,0 +1,8 @@ +.apax +.env +bin + +obj +testresult + +*.apax.tgz diff --git a/src/components.abstractions/ctrl/AXSharp.config.json b/src/components.abstractions/ctrl/AXSharp.config.json new file mode 100644 index 000000000..57d005617 --- /dev/null +++ b/src/components.abstractions/ctrl/AXSharp.config.json @@ -0,0 +1 @@ +{"OutputProjectFolder":"..\\src\\AXOpen.Components.Abstractions"} \ No newline at end of file diff --git a/src/components.abstractions/ctrl/apax.yml b/src/components.abstractions/ctrl/apax.yml new file mode 100644 index 000000000..8c4d162fd --- /dev/null +++ b/src/components.abstractions/ctrl/apax.yml @@ -0,0 +1,15 @@ +name: "@ix-ax/axopen.components.abstractions" +version: '0.1.4-alpha.79' +type: lib +targets: + - axunit-llvm + - llvm +files: + - src +devDependencies: + "@ax/sdk": ^4.0.3 +scripts: + postbuild: + - dotnet ixc +dependencies: + "@ix-ax/axopen.core": '0.1.4-alpha.79' diff --git a/src/components.abstractions/ctrl/package-lock.json b/src/components.abstractions/ctrl/package-lock.json new file mode 100644 index 000000000..a1067c7ca --- /dev/null +++ b/src/components.abstractions/ctrl/package-lock.json @@ -0,0 +1,11 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "bootstrap-icons": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.3.tgz", + "integrity": "sha512-7Qvj0j0idEm/DdX9Q0CpxAnJYqBCFCiUI6qzSPYfERMcokVuV9Mdm/AJiVZI8+Gawe4h/l6zFcOzvV7oXCZArw==" + } + } +} diff --git a/src/components.abstractions/ctrl/src/IAxoCodeReader.st b/src/components.abstractions/ctrl/src/IAxoCodeReader.st new file mode 100644 index 000000000..1ec923b96 --- /dev/null +++ b/src/components.abstractions/ctrl/src/IAxoCodeReader.st @@ -0,0 +1,7 @@ +USING AXOpen.Core; +NAMESPACE AXOpen.Components.Abstractions + INTERFACE PUBLIC IAxoCodeReader + METHOD ClearResultData : IAxoTaskState END_METHOD + METHOD Read : IAxoTaskState END_METHOD + END_INTERFACE +END_NAMESPACE diff --git a/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/Properties/AssemblyInfo.cs b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..7fc953296 --- /dev/null +++ b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using AXSharp.Presentation.Blazor.Attributes; + +[assembly: RenderableBlazorAssembly()] \ No newline at end of file diff --git a/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/_Imports.razor b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/_Imports.razor new file mode 100644 index 000000000..9ec08f956 --- /dev/null +++ b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/_Imports.razor @@ -0,0 +1,2 @@ +@using Microsoft.AspNetCore.Components.Web +@using AXSharp.Presentation.Blazor.Controls.RenderableContent diff --git a/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/axopen_components_abstractions_blazor.csproj b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/axopen_components_abstractions_blazor.csproj new file mode 100644 index 000000000..239acfdbf --- /dev/null +++ b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/axopen_components_abstractions_blazor.csproj @@ -0,0 +1,35 @@ + + + + net7.0 + enable + enable + AXOpen.Core.Blazor + AXOpen.Core.Blazor + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + diff --git a/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/package-lock.json b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/package-lock.json new file mode 100644 index 000000000..a1067c7ca --- /dev/null +++ b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/package-lock.json @@ -0,0 +1,11 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "bootstrap-icons": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.3.tgz", + "integrity": "sha512-7Qvj0j0idEm/DdX9Q0CpxAnJYqBCFCiUI6qzSPYfERMcokVuV9Mdm/AJiVZI8+Gawe4h/l6zFcOzvV7oXCZArw==" + } + } +} diff --git a/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/wwwroot/background.png b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/wwwroot/background.png new file mode 100644 index 0000000000000000000000000000000000000000..e15a3bde6e2bdb380df6a0b46d7ed00bdeb0aaa8 GIT binary patch literal 378 zcmeAS@N?(olHy`uVBq!ia0vp^x**KK1SGdsl%54rjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwr2>%=KS^ie7oTIEF;HpS|GCbyPusHSqiXaCu3qf)82(9Gq&mZq2{Kq}M*X&MWtJ zSi1Jo7ZzfImg%g=t(qo=wsSR2lZoP(Rj#3wacN=q0?Br(rXzgZEGK2$ID{|A=5S{xJEuzSH>!M+7wSY6hB<=-E^*n0W7 S8wY^CX7F_Nb6Mw<&;$S{dxtsz literal 0 HcmV?d00001 diff --git a/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/wwwroot/exampleJsInterop.js b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/wwwroot/exampleJsInterop.js new file mode 100644 index 000000000..ea8d76ad2 --- /dev/null +++ b/src/components.abstractions/src/AXOpen.Components.Abstractions.Blazor/wwwroot/exampleJsInterop.js @@ -0,0 +1,6 @@ +// This is a JavaScript module that is loaded on demand. It can export any number of +// functions, and may import other JavaScript modules if required. + +export function showPrompt(message) { + return prompt(message, 'Type anything here'); +} diff --git a/src/components.abstractions/src/AXOpen.Components.Abstractions/Properties/AssemblyInfo.cs b/src/components.abstractions/src/AXOpen.Components.Abstractions/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5abc351bd --- /dev/null +++ b/src/components.abstractions/src/AXOpen.Components.Abstractions/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; + +[assembly:InternalsVisibleTo("axopen_core_tests")] \ No newline at end of file diff --git a/src/components.abstractions/src/AXOpen.Components.Abstractions/Resources/PlcStringResources.Designer.cs b/src/components.abstractions/src/AXOpen.Components.Abstractions/Resources/PlcStringResources.Designer.cs new file mode 100644 index 000000000..53c5e8fe4 --- /dev/null +++ b/src/components.abstractions/src/AXOpen.Components.Abstractions/Resources/PlcStringResources.Designer.cs @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AXOpen.Core.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class PlcStringResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal PlcStringResources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AXOpen.Core.Resources.PlcStringResources", typeof(PlcStringResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Command state. + /// + public static string Command_state { + get { + return ResourceManager.GetString("Command_state", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run step. + /// + public static string Run_step { + get { + return ResourceManager.GetString("Run_step", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sequence mode. + /// + public static string Sequence_mode { + get { + return ResourceManager.GetString("Sequence_mode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stepping mode. + /// + public static string Stepping_mode { + get { + return ResourceManager.GetString("Stepping_mode", resourceCulture); + } + } + } +} diff --git a/src/components.abstractions/src/AXOpen.Components.Abstractions/Resources/PlcStringResources.resx b/src/components.abstractions/src/AXOpen.Components.Abstractions/Resources/PlcStringResources.resx new file mode 100644 index 000000000..0182b2b53 --- /dev/null +++ b/src/components.abstractions/src/AXOpen.Components.Abstractions/Resources/PlcStringResources.resx @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Command state + src\AxoTask\AxoTask.st,8 + + + Stepping mode + src\AxoCoordination\AxoSequencer\AxoSequencer.st,3 + + + Sequence mode + src\AxoCoordination\AxoSequencer\AxoSequencer.st,5 + + + Run step + src\AxoCoordination\AxoSequencer\AxoSequencer.st,10 + + \ No newline at end of file diff --git a/src/components.abstractions/src/AXOpen.Components.Abstractions/ix_ax_axopen_components_abstractions.csproj b/src/components.abstractions/src/AXOpen.Components.Abstractions/ix_ax_axopen_components_abstractions.csproj new file mode 100644 index 000000000..6e899e4ae --- /dev/null +++ b/src/components.abstractions/src/AXOpen.Components.Abstractions/ix_ax_axopen_components_abstractions.csproj @@ -0,0 +1,32 @@ + + + net7.0 + enable + enable + AXOpen.Components.Abstractions + AXOpen.Components.Abstractions + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/Usings.cs b/src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/Usings.cs new file mode 100644 index 000000000..8c927eb74 --- /dev/null +++ b/src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/axopen_components_abstractions_tests.csproj b/src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/axopen_components_abstractions_tests.csproj new file mode 100644 index 000000000..78a6369e3 --- /dev/null +++ b/src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/axopen_components_abstractions_tests.csproj @@ -0,0 +1,42 @@ + + + + net7.0 + enable + enable + + false + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + Always + + + + diff --git a/src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/xunit.runner.json b/src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/xunit.runner.json new file mode 100644 index 000000000..7c6944a1d --- /dev/null +++ b/src/components.abstractions/tests/AXOpen.Components.Abstractions.Tests/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "parallelizeTestCollections": false, + "maxParallelThreads": -1 +} diff --git a/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor index 0273a4fcd..1f65aa048 100644 --- a/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor +++ b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor @@ -20,17 +20,15 @@
@if (@Component._isManuallyControllable.Cyclic) { - + currentPresentation = "Command-Control"; } else { - + currentPresentation = "Status-Display"; } +
@if (containsDetailsAttribute) diff --git a/src/integrations/ctrl/apax.yml b/src/integrations/ctrl/apax.yml index 35481d816..f738a37f7 100644 --- a/src/integrations/ctrl/apax.yml +++ b/src/integrations/ctrl/apax.yml @@ -11,7 +11,8 @@ devDependencies: dependencies: "@ix-ax/axopen.data": '0.1.4-alpha.79' "@ix-ax/axopen.probers": '0.1.4-alpha.79' - "@ix-ax/axopen.simatic1500": '0.1.4-alpha.79' + "@ix-ax/axopen.simatic1500": '0.1.4-alpha.79' + "@ix-ax/axopen.cognex.vision": '0.1.4-alpha.79' variables: APAX_BUILD_ARGS: [ -d ] diff --git a/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/AxoCognexVisionDatamanExample.st b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/AxoCognexVisionDatamanExample.st new file mode 100644 index 000000000..b94f08d54 --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/AxoCognexVisionDatamanExample.st @@ -0,0 +1,33 @@ +USING AXOpen.Core; +//USING AXOpen.Cognex.Vision.v_6_0_0_0; + +NAMESPACE AxoCognexVisionDatamanExamples + + CLASS AxoCognexVisionDatamanExampleContext EXTENDS AXOpen.AxoContext + VAR PUBLIC + {#ix-set:AttributeName = "10A1"} + MyDataman : AXOpen.Cognex.Vision.v_6_0_0_0.AxoDataman; + {#ix-set:AttributeName = "<#Activate manual control#>"} + ActivateManualControl : BOOL; + PlcInputs : PlcInputs; + PlcOutputs : PlcOutputs; + END_VAR + + METHOD PROTECTED OVERRIDE Main + // Example of the activation of the manual control. + IF ActivateManualControl THEN + MyDataman.ActivateManualControl(); + END_IF; + // Calling the main method `Run` with respective input and output variables. + MyDataman.Run( parent := THIS, + AcquisitionStatus := PlcInputs._10a1_Acquisition_Status_1, + ResultsStatus := PlcInputs._10a1_Results_Status_1, + SoftEventStatus := PlcInputs._10a1_Soft_Event_Control_1, + ResultData := PlcInputs._10a1_Result_Data_128_bytes_1, + AcquisitionControl := PlcOutputs._10a1_Acquisition_Control_1, + ResultsControl := PlcOutputs._10a1_Results_Control_1, + SoftEventControl := PlcOutputs._10a1_Soft_Event_Control_1, + UserData := PlcOutputs._10a1_User_Data_128_bytes_1); + END_METHOD + END_CLASS +END_NAMESPACE diff --git a/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/CopyInputs.st b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/CopyInputs.st new file mode 100644 index 000000000..a1690b2c6 --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/CopyInputs.st @@ -0,0 +1,223 @@ +FUNCTION CopyInputs + VAR_EXTERNAL + HwInputs : HwInputs; + PlcInputs : PlcInputs; + END_VAR + PlcInputs._11a1_DI_8x24VDC_ST_1 := HwInputs._11a1_DI_8x24VDC_ST_1; + PlcInputs._11a1_DI_8x24VDC_ST_2 := HwInputs._11a1_DI_8x24VDC_ST_2; + PlcInputs._12a1_Acquisition_Status_1[0] := HwInputs._12a1_Acquisition_Status_1[0]; + PlcInputs._12a1_Acquisition_Status_1[1] := HwInputs._12a1_Acquisition_Status_1[1]; + PlcInputs._12a1_Acquisition_Status_1[2] := HwInputs._12a1_Acquisition_Status_1[2]; + PlcInputs._12a1_Inspection_Status_1 := HwInputs._12a1_Inspection_Status_1; + PlcInputs._12a1_Command_Control_1 := HwInputs._12a1_Command_Control_1; + PlcInputs._12a1_SoftEvent_Control_1 := HwInputs._12a1_SoftEvent_Control_1; + PlcInputs._12a1_Results_64_bytes_1[0] := HwInputs._12a1_Results_64_bytes_1[0]; + PlcInputs._12a1_Results_64_bytes_1[1] := HwInputs._12a1_Results_64_bytes_1[1]; + PlcInputs._12a1_Results_64_bytes_1[2] := HwInputs._12a1_Results_64_bytes_1[2]; + PlcInputs._12a1_Results_64_bytes_1[3] := HwInputs._12a1_Results_64_bytes_1[3]; + PlcInputs._12a1_Results_64_bytes_1[4] := HwInputs._12a1_Results_64_bytes_1[4]; + PlcInputs._12a1_Results_64_bytes_1[5] := HwInputs._12a1_Results_64_bytes_1[5]; + PlcInputs._12a1_Results_64_bytes_1[6] := HwInputs._12a1_Results_64_bytes_1[6]; + PlcInputs._12a1_Results_64_bytes_1[7] := HwInputs._12a1_Results_64_bytes_1[7]; + PlcInputs._12a1_Results_64_bytes_1[8] := HwInputs._12a1_Results_64_bytes_1[8]; + PlcInputs._12a1_Results_64_bytes_1[9] := HwInputs._12a1_Results_64_bytes_1[9]; + PlcInputs._12a1_Results_64_bytes_1[10] := HwInputs._12a1_Results_64_bytes_1[10]; + PlcInputs._12a1_Results_64_bytes_1[11] := HwInputs._12a1_Results_64_bytes_1[11]; + PlcInputs._12a1_Results_64_bytes_1[12] := HwInputs._12a1_Results_64_bytes_1[12]; + PlcInputs._12a1_Results_64_bytes_1[13] := HwInputs._12a1_Results_64_bytes_1[13]; + PlcInputs._12a1_Results_64_bytes_1[14] := HwInputs._12a1_Results_64_bytes_1[14]; + PlcInputs._12a1_Results_64_bytes_1[15] := HwInputs._12a1_Results_64_bytes_1[15]; + PlcInputs._12a1_Results_64_bytes_1[16] := HwInputs._12a1_Results_64_bytes_1[16]; + PlcInputs._12a1_Results_64_bytes_1[17] := HwInputs._12a1_Results_64_bytes_1[17]; + PlcInputs._12a1_Results_64_bytes_1[18] := HwInputs._12a1_Results_64_bytes_1[18]; + PlcInputs._12a1_Results_64_bytes_1[19] := HwInputs._12a1_Results_64_bytes_1[19]; + PlcInputs._12a1_Results_64_bytes_1[20] := HwInputs._12a1_Results_64_bytes_1[20]; + PlcInputs._12a1_Results_64_bytes_1[21] := HwInputs._12a1_Results_64_bytes_1[21]; + PlcInputs._12a1_Results_64_bytes_1[22] := HwInputs._12a1_Results_64_bytes_1[22]; + PlcInputs._12a1_Results_64_bytes_1[23] := HwInputs._12a1_Results_64_bytes_1[23]; + PlcInputs._12a1_Results_64_bytes_1[24] := HwInputs._12a1_Results_64_bytes_1[24]; + PlcInputs._12a1_Results_64_bytes_1[25] := HwInputs._12a1_Results_64_bytes_1[25]; + PlcInputs._12a1_Results_64_bytes_1[26] := HwInputs._12a1_Results_64_bytes_1[26]; + PlcInputs._12a1_Results_64_bytes_1[27] := HwInputs._12a1_Results_64_bytes_1[27]; + PlcInputs._12a1_Results_64_bytes_1[28] := HwInputs._12a1_Results_64_bytes_1[28]; + PlcInputs._12a1_Results_64_bytes_1[29] := HwInputs._12a1_Results_64_bytes_1[29]; + PlcInputs._12a1_Results_64_bytes_1[30] := HwInputs._12a1_Results_64_bytes_1[30]; + PlcInputs._12a1_Results_64_bytes_1[31] := HwInputs._12a1_Results_64_bytes_1[31]; + PlcInputs._12a1_Results_64_bytes_1[32] := HwInputs._12a1_Results_64_bytes_1[32]; + PlcInputs._12a1_Results_64_bytes_1[33] := HwInputs._12a1_Results_64_bytes_1[33]; + PlcInputs._12a1_Results_64_bytes_1[34] := HwInputs._12a1_Results_64_bytes_1[34]; + PlcInputs._12a1_Results_64_bytes_1[35] := HwInputs._12a1_Results_64_bytes_1[35]; + PlcInputs._12a1_Results_64_bytes_1[36] := HwInputs._12a1_Results_64_bytes_1[36]; + PlcInputs._12a1_Results_64_bytes_1[37] := HwInputs._12a1_Results_64_bytes_1[37]; + PlcInputs._12a1_Results_64_bytes_1[38] := HwInputs._12a1_Results_64_bytes_1[38]; + PlcInputs._12a1_Results_64_bytes_1[39] := HwInputs._12a1_Results_64_bytes_1[39]; + PlcInputs._12a1_Results_64_bytes_1[40] := HwInputs._12a1_Results_64_bytes_1[40]; + PlcInputs._12a1_Results_64_bytes_1[41] := HwInputs._12a1_Results_64_bytes_1[41]; + PlcInputs._12a1_Results_64_bytes_1[42] := HwInputs._12a1_Results_64_bytes_1[42]; + PlcInputs._12a1_Results_64_bytes_1[43] := HwInputs._12a1_Results_64_bytes_1[43]; + PlcInputs._12a1_Results_64_bytes_1[44] := HwInputs._12a1_Results_64_bytes_1[44]; + PlcInputs._12a1_Results_64_bytes_1[45] := HwInputs._12a1_Results_64_bytes_1[45]; + PlcInputs._12a1_Results_64_bytes_1[46] := HwInputs._12a1_Results_64_bytes_1[46]; + PlcInputs._12a1_Results_64_bytes_1[47] := HwInputs._12a1_Results_64_bytes_1[47]; + PlcInputs._12a1_Results_64_bytes_1[48] := HwInputs._12a1_Results_64_bytes_1[48]; + PlcInputs._12a1_Results_64_bytes_1[49] := HwInputs._12a1_Results_64_bytes_1[49]; + PlcInputs._12a1_Results_64_bytes_1[50] := HwInputs._12a1_Results_64_bytes_1[50]; + PlcInputs._12a1_Results_64_bytes_1[51] := HwInputs._12a1_Results_64_bytes_1[51]; + PlcInputs._12a1_Results_64_bytes_1[52] := HwInputs._12a1_Results_64_bytes_1[52]; + PlcInputs._12a1_Results_64_bytes_1[53] := HwInputs._12a1_Results_64_bytes_1[53]; + PlcInputs._12a1_Results_64_bytes_1[54] := HwInputs._12a1_Results_64_bytes_1[54]; + PlcInputs._12a1_Results_64_bytes_1[55] := HwInputs._12a1_Results_64_bytes_1[55]; + PlcInputs._12a1_Results_64_bytes_1[56] := HwInputs._12a1_Results_64_bytes_1[56]; + PlcInputs._12a1_Results_64_bytes_1[57] := HwInputs._12a1_Results_64_bytes_1[57]; + PlcInputs._12a1_Results_64_bytes_1[58] := HwInputs._12a1_Results_64_bytes_1[58]; + PlcInputs._12a1_Results_64_bytes_1[59] := HwInputs._12a1_Results_64_bytes_1[59]; + PlcInputs._12a1_Results_64_bytes_1[60] := HwInputs._12a1_Results_64_bytes_1[60]; + PlcInputs._12a1_Results_64_bytes_1[61] := HwInputs._12a1_Results_64_bytes_1[61]; + PlcInputs._12a1_Results_64_bytes_1[62] := HwInputs._12a1_Results_64_bytes_1[62]; + PlcInputs._12a1_Results_64_bytes_1[63] := HwInputs._12a1_Results_64_bytes_1[63]; + PlcInputs._12a1_Results_64_bytes_1[64] := HwInputs._12a1_Results_64_bytes_1[64]; + PlcInputs._12a1_Results_64_bytes_1[65] := HwInputs._12a1_Results_64_bytes_1[65]; + PlcInputs._12a1_Results_64_bytes_1[66] := HwInputs._12a1_Results_64_bytes_1[66]; + PlcInputs._12a1_Results_64_bytes_1[67] := HwInputs._12a1_Results_64_bytes_1[67]; + PlcInputs._10a1_Acquisition_Status_1[0] := HwInputs._10a1_Acquisition_Status_1[0]; + PlcInputs._10a1_Acquisition_Status_1[1] := HwInputs._10a1_Acquisition_Status_1[1]; + PlcInputs._10a1_Acquisition_Status_1[2] := HwInputs._10a1_Acquisition_Status_1[2]; + PlcInputs._10a1_Results_Status_1 := HwInputs._10a1_Results_Status_1; + PlcInputs._10a1_Soft_Event_Control_1 := HwInputs._10a1_Soft_Event_Control_1; + PlcInputs._10a1_Result_Data_128_bytes_1[0] := HwInputs._10a1_Result_Data_128_bytes_1[0]; + PlcInputs._10a1_Result_Data_128_bytes_1[1] := HwInputs._10a1_Result_Data_128_bytes_1[1]; + PlcInputs._10a1_Result_Data_128_bytes_1[2] := HwInputs._10a1_Result_Data_128_bytes_1[2]; + PlcInputs._10a1_Result_Data_128_bytes_1[3] := HwInputs._10a1_Result_Data_128_bytes_1[3]; + PlcInputs._10a1_Result_Data_128_bytes_1[4] := HwInputs._10a1_Result_Data_128_bytes_1[4]; + PlcInputs._10a1_Result_Data_128_bytes_1[5] := HwInputs._10a1_Result_Data_128_bytes_1[5]; + PlcInputs._10a1_Result_Data_128_bytes_1[6] := HwInputs._10a1_Result_Data_128_bytes_1[6]; + PlcInputs._10a1_Result_Data_128_bytes_1[7] := HwInputs._10a1_Result_Data_128_bytes_1[7]; + PlcInputs._10a1_Result_Data_128_bytes_1[8] := HwInputs._10a1_Result_Data_128_bytes_1[8]; + PlcInputs._10a1_Result_Data_128_bytes_1[9] := HwInputs._10a1_Result_Data_128_bytes_1[9]; + PlcInputs._10a1_Result_Data_128_bytes_1[10] := HwInputs._10a1_Result_Data_128_bytes_1[10]; + PlcInputs._10a1_Result_Data_128_bytes_1[11] := HwInputs._10a1_Result_Data_128_bytes_1[11]; + PlcInputs._10a1_Result_Data_128_bytes_1[12] := HwInputs._10a1_Result_Data_128_bytes_1[12]; + PlcInputs._10a1_Result_Data_128_bytes_1[13] := HwInputs._10a1_Result_Data_128_bytes_1[13]; + PlcInputs._10a1_Result_Data_128_bytes_1[14] := HwInputs._10a1_Result_Data_128_bytes_1[14]; + PlcInputs._10a1_Result_Data_128_bytes_1[15] := HwInputs._10a1_Result_Data_128_bytes_1[15]; + PlcInputs._10a1_Result_Data_128_bytes_1[16] := HwInputs._10a1_Result_Data_128_bytes_1[16]; + PlcInputs._10a1_Result_Data_128_bytes_1[17] := HwInputs._10a1_Result_Data_128_bytes_1[17]; + PlcInputs._10a1_Result_Data_128_bytes_1[18] := HwInputs._10a1_Result_Data_128_bytes_1[18]; + PlcInputs._10a1_Result_Data_128_bytes_1[19] := HwInputs._10a1_Result_Data_128_bytes_1[19]; + PlcInputs._10a1_Result_Data_128_bytes_1[20] := HwInputs._10a1_Result_Data_128_bytes_1[20]; + PlcInputs._10a1_Result_Data_128_bytes_1[21] := HwInputs._10a1_Result_Data_128_bytes_1[21]; + PlcInputs._10a1_Result_Data_128_bytes_1[22] := HwInputs._10a1_Result_Data_128_bytes_1[22]; + PlcInputs._10a1_Result_Data_128_bytes_1[23] := HwInputs._10a1_Result_Data_128_bytes_1[23]; + PlcInputs._10a1_Result_Data_128_bytes_1[24] := HwInputs._10a1_Result_Data_128_bytes_1[24]; + PlcInputs._10a1_Result_Data_128_bytes_1[25] := HwInputs._10a1_Result_Data_128_bytes_1[25]; + PlcInputs._10a1_Result_Data_128_bytes_1[26] := HwInputs._10a1_Result_Data_128_bytes_1[26]; + PlcInputs._10a1_Result_Data_128_bytes_1[27] := HwInputs._10a1_Result_Data_128_bytes_1[27]; + PlcInputs._10a1_Result_Data_128_bytes_1[28] := HwInputs._10a1_Result_Data_128_bytes_1[28]; + PlcInputs._10a1_Result_Data_128_bytes_1[29] := HwInputs._10a1_Result_Data_128_bytes_1[29]; + PlcInputs._10a1_Result_Data_128_bytes_1[30] := HwInputs._10a1_Result_Data_128_bytes_1[30]; + PlcInputs._10a1_Result_Data_128_bytes_1[31] := HwInputs._10a1_Result_Data_128_bytes_1[31]; + PlcInputs._10a1_Result_Data_128_bytes_1[32] := HwInputs._10a1_Result_Data_128_bytes_1[32]; + PlcInputs._10a1_Result_Data_128_bytes_1[33] := HwInputs._10a1_Result_Data_128_bytes_1[33]; + PlcInputs._10a1_Result_Data_128_bytes_1[34] := HwInputs._10a1_Result_Data_128_bytes_1[34]; + PlcInputs._10a1_Result_Data_128_bytes_1[35] := HwInputs._10a1_Result_Data_128_bytes_1[35]; + PlcInputs._10a1_Result_Data_128_bytes_1[36] := HwInputs._10a1_Result_Data_128_bytes_1[36]; + PlcInputs._10a1_Result_Data_128_bytes_1[37] := HwInputs._10a1_Result_Data_128_bytes_1[37]; + PlcInputs._10a1_Result_Data_128_bytes_1[38] := HwInputs._10a1_Result_Data_128_bytes_1[38]; + PlcInputs._10a1_Result_Data_128_bytes_1[39] := HwInputs._10a1_Result_Data_128_bytes_1[39]; + PlcInputs._10a1_Result_Data_128_bytes_1[40] := HwInputs._10a1_Result_Data_128_bytes_1[40]; + PlcInputs._10a1_Result_Data_128_bytes_1[41] := HwInputs._10a1_Result_Data_128_bytes_1[41]; + PlcInputs._10a1_Result_Data_128_bytes_1[42] := HwInputs._10a1_Result_Data_128_bytes_1[42]; + PlcInputs._10a1_Result_Data_128_bytes_1[43] := HwInputs._10a1_Result_Data_128_bytes_1[43]; + PlcInputs._10a1_Result_Data_128_bytes_1[44] := HwInputs._10a1_Result_Data_128_bytes_1[44]; + PlcInputs._10a1_Result_Data_128_bytes_1[45] := HwInputs._10a1_Result_Data_128_bytes_1[45]; + PlcInputs._10a1_Result_Data_128_bytes_1[46] := HwInputs._10a1_Result_Data_128_bytes_1[46]; + PlcInputs._10a1_Result_Data_128_bytes_1[47] := HwInputs._10a1_Result_Data_128_bytes_1[47]; + PlcInputs._10a1_Result_Data_128_bytes_1[48] := HwInputs._10a1_Result_Data_128_bytes_1[48]; + PlcInputs._10a1_Result_Data_128_bytes_1[49] := HwInputs._10a1_Result_Data_128_bytes_1[49]; + PlcInputs._10a1_Result_Data_128_bytes_1[50] := HwInputs._10a1_Result_Data_128_bytes_1[50]; + PlcInputs._10a1_Result_Data_128_bytes_1[51] := HwInputs._10a1_Result_Data_128_bytes_1[51]; + PlcInputs._10a1_Result_Data_128_bytes_1[52] := HwInputs._10a1_Result_Data_128_bytes_1[52]; + PlcInputs._10a1_Result_Data_128_bytes_1[53] := HwInputs._10a1_Result_Data_128_bytes_1[53]; + PlcInputs._10a1_Result_Data_128_bytes_1[54] := HwInputs._10a1_Result_Data_128_bytes_1[54]; + PlcInputs._10a1_Result_Data_128_bytes_1[55] := HwInputs._10a1_Result_Data_128_bytes_1[55]; + PlcInputs._10a1_Result_Data_128_bytes_1[56] := HwInputs._10a1_Result_Data_128_bytes_1[56]; + PlcInputs._10a1_Result_Data_128_bytes_1[57] := HwInputs._10a1_Result_Data_128_bytes_1[57]; + PlcInputs._10a1_Result_Data_128_bytes_1[58] := HwInputs._10a1_Result_Data_128_bytes_1[58]; + PlcInputs._10a1_Result_Data_128_bytes_1[59] := HwInputs._10a1_Result_Data_128_bytes_1[59]; + PlcInputs._10a1_Result_Data_128_bytes_1[60] := HwInputs._10a1_Result_Data_128_bytes_1[60]; + PlcInputs._10a1_Result_Data_128_bytes_1[61] := HwInputs._10a1_Result_Data_128_bytes_1[61]; + PlcInputs._10a1_Result_Data_128_bytes_1[62] := HwInputs._10a1_Result_Data_128_bytes_1[62]; + PlcInputs._10a1_Result_Data_128_bytes_1[63] := HwInputs._10a1_Result_Data_128_bytes_1[63]; + PlcInputs._10a1_Result_Data_128_bytes_1[64] := HwInputs._10a1_Result_Data_128_bytes_1[64]; + PlcInputs._10a1_Result_Data_128_bytes_1[65] := HwInputs._10a1_Result_Data_128_bytes_1[65]; + PlcInputs._10a1_Result_Data_128_bytes_1[66] := HwInputs._10a1_Result_Data_128_bytes_1[66]; + PlcInputs._10a1_Result_Data_128_bytes_1[67] := HwInputs._10a1_Result_Data_128_bytes_1[67]; + PlcInputs._10a1_Result_Data_128_bytes_1[68] := HwInputs._10a1_Result_Data_128_bytes_1[68]; + PlcInputs._10a1_Result_Data_128_bytes_1[69] := HwInputs._10a1_Result_Data_128_bytes_1[69]; + PlcInputs._10a1_Result_Data_128_bytes_1[70] := HwInputs._10a1_Result_Data_128_bytes_1[70]; + PlcInputs._10a1_Result_Data_128_bytes_1[71] := HwInputs._10a1_Result_Data_128_bytes_1[71]; + PlcInputs._10a1_Result_Data_128_bytes_1[72] := HwInputs._10a1_Result_Data_128_bytes_1[72]; + PlcInputs._10a1_Result_Data_128_bytes_1[73] := HwInputs._10a1_Result_Data_128_bytes_1[73]; + PlcInputs._10a1_Result_Data_128_bytes_1[74] := HwInputs._10a1_Result_Data_128_bytes_1[74]; + PlcInputs._10a1_Result_Data_128_bytes_1[75] := HwInputs._10a1_Result_Data_128_bytes_1[75]; + PlcInputs._10a1_Result_Data_128_bytes_1[76] := HwInputs._10a1_Result_Data_128_bytes_1[76]; + PlcInputs._10a1_Result_Data_128_bytes_1[77] := HwInputs._10a1_Result_Data_128_bytes_1[77]; + PlcInputs._10a1_Result_Data_128_bytes_1[78] := HwInputs._10a1_Result_Data_128_bytes_1[78]; + PlcInputs._10a1_Result_Data_128_bytes_1[79] := HwInputs._10a1_Result_Data_128_bytes_1[79]; + PlcInputs._10a1_Result_Data_128_bytes_1[80] := HwInputs._10a1_Result_Data_128_bytes_1[80]; + PlcInputs._10a1_Result_Data_128_bytes_1[81] := HwInputs._10a1_Result_Data_128_bytes_1[81]; + PlcInputs._10a1_Result_Data_128_bytes_1[82] := HwInputs._10a1_Result_Data_128_bytes_1[82]; + PlcInputs._10a1_Result_Data_128_bytes_1[83] := HwInputs._10a1_Result_Data_128_bytes_1[83]; + PlcInputs._10a1_Result_Data_128_bytes_1[84] := HwInputs._10a1_Result_Data_128_bytes_1[84]; + PlcInputs._10a1_Result_Data_128_bytes_1[85] := HwInputs._10a1_Result_Data_128_bytes_1[85]; + PlcInputs._10a1_Result_Data_128_bytes_1[86] := HwInputs._10a1_Result_Data_128_bytes_1[86]; + PlcInputs._10a1_Result_Data_128_bytes_1[87] := HwInputs._10a1_Result_Data_128_bytes_1[87]; + PlcInputs._10a1_Result_Data_128_bytes_1[88] := HwInputs._10a1_Result_Data_128_bytes_1[88]; + PlcInputs._10a1_Result_Data_128_bytes_1[89] := HwInputs._10a1_Result_Data_128_bytes_1[89]; + PlcInputs._10a1_Result_Data_128_bytes_1[90] := HwInputs._10a1_Result_Data_128_bytes_1[90]; + PlcInputs._10a1_Result_Data_128_bytes_1[91] := HwInputs._10a1_Result_Data_128_bytes_1[91]; + PlcInputs._10a1_Result_Data_128_bytes_1[92] := HwInputs._10a1_Result_Data_128_bytes_1[92]; + PlcInputs._10a1_Result_Data_128_bytes_1[93] := HwInputs._10a1_Result_Data_128_bytes_1[93]; + PlcInputs._10a1_Result_Data_128_bytes_1[94] := HwInputs._10a1_Result_Data_128_bytes_1[94]; + PlcInputs._10a1_Result_Data_128_bytes_1[95] := HwInputs._10a1_Result_Data_128_bytes_1[95]; + PlcInputs._10a1_Result_Data_128_bytes_1[96] := HwInputs._10a1_Result_Data_128_bytes_1[96]; + PlcInputs._10a1_Result_Data_128_bytes_1[97] := HwInputs._10a1_Result_Data_128_bytes_1[97]; + PlcInputs._10a1_Result_Data_128_bytes_1[98] := HwInputs._10a1_Result_Data_128_bytes_1[98]; + PlcInputs._10a1_Result_Data_128_bytes_1[99] := HwInputs._10a1_Result_Data_128_bytes_1[99]; + PlcInputs._10a1_Result_Data_128_bytes_1[100] := HwInputs._10a1_Result_Data_128_bytes_1[100]; + PlcInputs._10a1_Result_Data_128_bytes_1[101] := HwInputs._10a1_Result_Data_128_bytes_1[101]; + PlcInputs._10a1_Result_Data_128_bytes_1[102] := HwInputs._10a1_Result_Data_128_bytes_1[102]; + PlcInputs._10a1_Result_Data_128_bytes_1[103] := HwInputs._10a1_Result_Data_128_bytes_1[103]; + PlcInputs._10a1_Result_Data_128_bytes_1[104] := HwInputs._10a1_Result_Data_128_bytes_1[104]; + PlcInputs._10a1_Result_Data_128_bytes_1[105] := HwInputs._10a1_Result_Data_128_bytes_1[105]; + PlcInputs._10a1_Result_Data_128_bytes_1[106] := HwInputs._10a1_Result_Data_128_bytes_1[106]; + PlcInputs._10a1_Result_Data_128_bytes_1[107] := HwInputs._10a1_Result_Data_128_bytes_1[107]; + PlcInputs._10a1_Result_Data_128_bytes_1[108] := HwInputs._10a1_Result_Data_128_bytes_1[108]; + PlcInputs._10a1_Result_Data_128_bytes_1[109] := HwInputs._10a1_Result_Data_128_bytes_1[109]; + PlcInputs._10a1_Result_Data_128_bytes_1[110] := HwInputs._10a1_Result_Data_128_bytes_1[110]; + PlcInputs._10a1_Result_Data_128_bytes_1[111] := HwInputs._10a1_Result_Data_128_bytes_1[111]; + PlcInputs._10a1_Result_Data_128_bytes_1[112] := HwInputs._10a1_Result_Data_128_bytes_1[112]; + PlcInputs._10a1_Result_Data_128_bytes_1[113] := HwInputs._10a1_Result_Data_128_bytes_1[113]; + PlcInputs._10a1_Result_Data_128_bytes_1[114] := HwInputs._10a1_Result_Data_128_bytes_1[114]; + PlcInputs._10a1_Result_Data_128_bytes_1[115] := HwInputs._10a1_Result_Data_128_bytes_1[115]; + PlcInputs._10a1_Result_Data_128_bytes_1[116] := HwInputs._10a1_Result_Data_128_bytes_1[116]; + PlcInputs._10a1_Result_Data_128_bytes_1[117] := HwInputs._10a1_Result_Data_128_bytes_1[117]; + PlcInputs._10a1_Result_Data_128_bytes_1[118] := HwInputs._10a1_Result_Data_128_bytes_1[118]; + PlcInputs._10a1_Result_Data_128_bytes_1[119] := HwInputs._10a1_Result_Data_128_bytes_1[119]; + PlcInputs._10a1_Result_Data_128_bytes_1[120] := HwInputs._10a1_Result_Data_128_bytes_1[120]; + PlcInputs._10a1_Result_Data_128_bytes_1[121] := HwInputs._10a1_Result_Data_128_bytes_1[121]; + PlcInputs._10a1_Result_Data_128_bytes_1[122] := HwInputs._10a1_Result_Data_128_bytes_1[122]; + PlcInputs._10a1_Result_Data_128_bytes_1[123] := HwInputs._10a1_Result_Data_128_bytes_1[123]; + PlcInputs._10a1_Result_Data_128_bytes_1[124] := HwInputs._10a1_Result_Data_128_bytes_1[124]; + PlcInputs._10a1_Result_Data_128_bytes_1[125] := HwInputs._10a1_Result_Data_128_bytes_1[125]; + PlcInputs._10a1_Result_Data_128_bytes_1[126] := HwInputs._10a1_Result_Data_128_bytes_1[126]; + PlcInputs._10a1_Result_Data_128_bytes_1[127] := HwInputs._10a1_Result_Data_128_bytes_1[127]; + PlcInputs._10a1_Result_Data_128_bytes_1[128] := HwInputs._10a1_Result_Data_128_bytes_1[128]; + PlcInputs._10a1_Result_Data_128_bytes_1[129] := HwInputs._10a1_Result_Data_128_bytes_1[129]; + PlcInputs._10a1_Result_Data_128_bytes_1[130] := HwInputs._10a1_Result_Data_128_bytes_1[130]; + PlcInputs._10a1_Result_Data_128_bytes_1[131] := HwInputs._10a1_Result_Data_128_bytes_1[131]; + PlcInputs._10a1_Result_Data_128_bytes_1[132] := HwInputs._10a1_Result_Data_128_bytes_1[132]; + PlcInputs._10a1_Result_Data_128_bytes_1[133] := HwInputs._10a1_Result_Data_128_bytes_1[133]; + PlcInputs._10a1_Result_Data_128_bytes_1[134] := HwInputs._10a1_Result_Data_128_bytes_1[134]; + PlcInputs._10a1_Result_Data_128_bytes_1[135] := HwInputs._10a1_Result_Data_128_bytes_1[135]; +END_FUNCTION diff --git a/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/CopyOutputs.st b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/CopyOutputs.st new file mode 100644 index 000000000..caf897994 --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/CopyOutputs.st @@ -0,0 +1,210 @@ +FUNCTION CopyOutputs + VAR_EXTERNAL + HwOutputs : HwOutputs; + PlcOutputs : PlcOutputs; + END_VAR + HwOutputs._11a1_DQ_8x24VDC_0_5A_ST_1 := PlcOutputs._11a1_DQ_8x24VDC_0_5A_ST_1; + HwOutputs._12a1_Acquisition_Control_1 := PlcOutputs._12a1_Acquisition_Control_1; + HwOutputs._12a1_Inspection_Control_1 := PlcOutputs._12a1_Inspection_Control_1; + HwOutputs._12a1_Command_Control_1 := PlcOutputs._12a1_Command_Control_1; + HwOutputs._12a1_SoftEvent_Control_1 := PlcOutputs._12a1_SoftEvent_Control_1; + HwOutputs._12a1_User_Data_64_bytes_1[0] := PlcOutputs._12a1_User_Data_64_bytes_1[0]; + HwOutputs._12a1_User_Data_64_bytes_1[1] := PlcOutputs._12a1_User_Data_64_bytes_1[1]; + HwOutputs._12a1_User_Data_64_bytes_1[2] := PlcOutputs._12a1_User_Data_64_bytes_1[2]; + HwOutputs._12a1_User_Data_64_bytes_1[3] := PlcOutputs._12a1_User_Data_64_bytes_1[3]; + HwOutputs._12a1_User_Data_64_bytes_1[4] := PlcOutputs._12a1_User_Data_64_bytes_1[4]; + HwOutputs._12a1_User_Data_64_bytes_1[5] := PlcOutputs._12a1_User_Data_64_bytes_1[5]; + HwOutputs._12a1_User_Data_64_bytes_1[6] := PlcOutputs._12a1_User_Data_64_bytes_1[6]; + HwOutputs._12a1_User_Data_64_bytes_1[7] := PlcOutputs._12a1_User_Data_64_bytes_1[7]; + HwOutputs._12a1_User_Data_64_bytes_1[8] := PlcOutputs._12a1_User_Data_64_bytes_1[8]; + HwOutputs._12a1_User_Data_64_bytes_1[9] := PlcOutputs._12a1_User_Data_64_bytes_1[9]; + HwOutputs._12a1_User_Data_64_bytes_1[10] := PlcOutputs._12a1_User_Data_64_bytes_1[10]; + HwOutputs._12a1_User_Data_64_bytes_1[11] := PlcOutputs._12a1_User_Data_64_bytes_1[11]; + HwOutputs._12a1_User_Data_64_bytes_1[12] := PlcOutputs._12a1_User_Data_64_bytes_1[12]; + HwOutputs._12a1_User_Data_64_bytes_1[13] := PlcOutputs._12a1_User_Data_64_bytes_1[13]; + HwOutputs._12a1_User_Data_64_bytes_1[14] := PlcOutputs._12a1_User_Data_64_bytes_1[14]; + HwOutputs._12a1_User_Data_64_bytes_1[15] := PlcOutputs._12a1_User_Data_64_bytes_1[15]; + HwOutputs._12a1_User_Data_64_bytes_1[16] := PlcOutputs._12a1_User_Data_64_bytes_1[16]; + HwOutputs._12a1_User_Data_64_bytes_1[17] := PlcOutputs._12a1_User_Data_64_bytes_1[17]; + HwOutputs._12a1_User_Data_64_bytes_1[18] := PlcOutputs._12a1_User_Data_64_bytes_1[18]; + HwOutputs._12a1_User_Data_64_bytes_1[19] := PlcOutputs._12a1_User_Data_64_bytes_1[19]; + HwOutputs._12a1_User_Data_64_bytes_1[20] := PlcOutputs._12a1_User_Data_64_bytes_1[20]; + HwOutputs._12a1_User_Data_64_bytes_1[21] := PlcOutputs._12a1_User_Data_64_bytes_1[21]; + HwOutputs._12a1_User_Data_64_bytes_1[22] := PlcOutputs._12a1_User_Data_64_bytes_1[22]; + HwOutputs._12a1_User_Data_64_bytes_1[23] := PlcOutputs._12a1_User_Data_64_bytes_1[23]; + HwOutputs._12a1_User_Data_64_bytes_1[24] := PlcOutputs._12a1_User_Data_64_bytes_1[24]; + HwOutputs._12a1_User_Data_64_bytes_1[25] := PlcOutputs._12a1_User_Data_64_bytes_1[25]; + HwOutputs._12a1_User_Data_64_bytes_1[26] := PlcOutputs._12a1_User_Data_64_bytes_1[26]; + HwOutputs._12a1_User_Data_64_bytes_1[27] := PlcOutputs._12a1_User_Data_64_bytes_1[27]; + HwOutputs._12a1_User_Data_64_bytes_1[28] := PlcOutputs._12a1_User_Data_64_bytes_1[28]; + HwOutputs._12a1_User_Data_64_bytes_1[29] := PlcOutputs._12a1_User_Data_64_bytes_1[29]; + HwOutputs._12a1_User_Data_64_bytes_1[30] := PlcOutputs._12a1_User_Data_64_bytes_1[30]; + HwOutputs._12a1_User_Data_64_bytes_1[31] := PlcOutputs._12a1_User_Data_64_bytes_1[31]; + HwOutputs._12a1_User_Data_64_bytes_1[32] := PlcOutputs._12a1_User_Data_64_bytes_1[32]; + HwOutputs._12a1_User_Data_64_bytes_1[33] := PlcOutputs._12a1_User_Data_64_bytes_1[33]; + HwOutputs._12a1_User_Data_64_bytes_1[34] := PlcOutputs._12a1_User_Data_64_bytes_1[34]; + HwOutputs._12a1_User_Data_64_bytes_1[35] := PlcOutputs._12a1_User_Data_64_bytes_1[35]; + HwOutputs._12a1_User_Data_64_bytes_1[36] := PlcOutputs._12a1_User_Data_64_bytes_1[36]; + HwOutputs._12a1_User_Data_64_bytes_1[37] := PlcOutputs._12a1_User_Data_64_bytes_1[37]; + HwOutputs._12a1_User_Data_64_bytes_1[38] := PlcOutputs._12a1_User_Data_64_bytes_1[38]; + HwOutputs._12a1_User_Data_64_bytes_1[39] := PlcOutputs._12a1_User_Data_64_bytes_1[39]; + HwOutputs._12a1_User_Data_64_bytes_1[40] := PlcOutputs._12a1_User_Data_64_bytes_1[40]; + HwOutputs._12a1_User_Data_64_bytes_1[41] := PlcOutputs._12a1_User_Data_64_bytes_1[41]; + HwOutputs._12a1_User_Data_64_bytes_1[42] := PlcOutputs._12a1_User_Data_64_bytes_1[42]; + HwOutputs._12a1_User_Data_64_bytes_1[43] := PlcOutputs._12a1_User_Data_64_bytes_1[43]; + HwOutputs._12a1_User_Data_64_bytes_1[44] := PlcOutputs._12a1_User_Data_64_bytes_1[44]; + HwOutputs._12a1_User_Data_64_bytes_1[45] := PlcOutputs._12a1_User_Data_64_bytes_1[45]; + HwOutputs._12a1_User_Data_64_bytes_1[46] := PlcOutputs._12a1_User_Data_64_bytes_1[46]; + HwOutputs._12a1_User_Data_64_bytes_1[47] := PlcOutputs._12a1_User_Data_64_bytes_1[47]; + HwOutputs._12a1_User_Data_64_bytes_1[48] := PlcOutputs._12a1_User_Data_64_bytes_1[48]; + HwOutputs._12a1_User_Data_64_bytes_1[49] := PlcOutputs._12a1_User_Data_64_bytes_1[49]; + HwOutputs._12a1_User_Data_64_bytes_1[50] := PlcOutputs._12a1_User_Data_64_bytes_1[50]; + HwOutputs._12a1_User_Data_64_bytes_1[51] := PlcOutputs._12a1_User_Data_64_bytes_1[51]; + HwOutputs._12a1_User_Data_64_bytes_1[52] := PlcOutputs._12a1_User_Data_64_bytes_1[52]; + HwOutputs._12a1_User_Data_64_bytes_1[53] := PlcOutputs._12a1_User_Data_64_bytes_1[53]; + HwOutputs._12a1_User_Data_64_bytes_1[54] := PlcOutputs._12a1_User_Data_64_bytes_1[54]; + HwOutputs._12a1_User_Data_64_bytes_1[55] := PlcOutputs._12a1_User_Data_64_bytes_1[55]; + HwOutputs._12a1_User_Data_64_bytes_1[56] := PlcOutputs._12a1_User_Data_64_bytes_1[56]; + HwOutputs._12a1_User_Data_64_bytes_1[57] := PlcOutputs._12a1_User_Data_64_bytes_1[57]; + HwOutputs._12a1_User_Data_64_bytes_1[58] := PlcOutputs._12a1_User_Data_64_bytes_1[58]; + HwOutputs._12a1_User_Data_64_bytes_1[59] := PlcOutputs._12a1_User_Data_64_bytes_1[59]; + HwOutputs._12a1_User_Data_64_bytes_1[60] := PlcOutputs._12a1_User_Data_64_bytes_1[60]; + HwOutputs._12a1_User_Data_64_bytes_1[61] := PlcOutputs._12a1_User_Data_64_bytes_1[61]; + HwOutputs._12a1_User_Data_64_bytes_1[62] := PlcOutputs._12a1_User_Data_64_bytes_1[62]; + HwOutputs._12a1_User_Data_64_bytes_1[63] := PlcOutputs._12a1_User_Data_64_bytes_1[63]; + HwOutputs._10a1_Acquisition_Control_1 := PlcOutputs._10a1_Acquisition_Control_1; + HwOutputs._10a1_Results_Control_1 := PlcOutputs._10a1_Results_Control_1; + HwOutputs._10a1_Soft_Event_Control_1 := PlcOutputs._10a1_Soft_Event_Control_1; + HwOutputs._10a1_User_Data_128_bytes_1[0] := PlcOutputs._10a1_User_Data_128_bytes_1[0]; + HwOutputs._10a1_User_Data_128_bytes_1[1] := PlcOutputs._10a1_User_Data_128_bytes_1[1]; + HwOutputs._10a1_User_Data_128_bytes_1[2] := PlcOutputs._10a1_User_Data_128_bytes_1[2]; + HwOutputs._10a1_User_Data_128_bytes_1[3] := PlcOutputs._10a1_User_Data_128_bytes_1[3]; + HwOutputs._10a1_User_Data_128_bytes_1[4] := PlcOutputs._10a1_User_Data_128_bytes_1[4]; + HwOutputs._10a1_User_Data_128_bytes_1[5] := PlcOutputs._10a1_User_Data_128_bytes_1[5]; + HwOutputs._10a1_User_Data_128_bytes_1[6] := PlcOutputs._10a1_User_Data_128_bytes_1[6]; + HwOutputs._10a1_User_Data_128_bytes_1[7] := PlcOutputs._10a1_User_Data_128_bytes_1[7]; + HwOutputs._10a1_User_Data_128_bytes_1[8] := PlcOutputs._10a1_User_Data_128_bytes_1[8]; + HwOutputs._10a1_User_Data_128_bytes_1[9] := PlcOutputs._10a1_User_Data_128_bytes_1[9]; + HwOutputs._10a1_User_Data_128_bytes_1[10] := PlcOutputs._10a1_User_Data_128_bytes_1[10]; + HwOutputs._10a1_User_Data_128_bytes_1[11] := PlcOutputs._10a1_User_Data_128_bytes_1[11]; + HwOutputs._10a1_User_Data_128_bytes_1[12] := PlcOutputs._10a1_User_Data_128_bytes_1[12]; + HwOutputs._10a1_User_Data_128_bytes_1[13] := PlcOutputs._10a1_User_Data_128_bytes_1[13]; + HwOutputs._10a1_User_Data_128_bytes_1[14] := PlcOutputs._10a1_User_Data_128_bytes_1[14]; + HwOutputs._10a1_User_Data_128_bytes_1[15] := PlcOutputs._10a1_User_Data_128_bytes_1[15]; + HwOutputs._10a1_User_Data_128_bytes_1[16] := PlcOutputs._10a1_User_Data_128_bytes_1[16]; + HwOutputs._10a1_User_Data_128_bytes_1[17] := PlcOutputs._10a1_User_Data_128_bytes_1[17]; + HwOutputs._10a1_User_Data_128_bytes_1[18] := PlcOutputs._10a1_User_Data_128_bytes_1[18]; + HwOutputs._10a1_User_Data_128_bytes_1[19] := PlcOutputs._10a1_User_Data_128_bytes_1[19]; + HwOutputs._10a1_User_Data_128_bytes_1[20] := PlcOutputs._10a1_User_Data_128_bytes_1[20]; + HwOutputs._10a1_User_Data_128_bytes_1[21] := PlcOutputs._10a1_User_Data_128_bytes_1[21]; + HwOutputs._10a1_User_Data_128_bytes_1[22] := PlcOutputs._10a1_User_Data_128_bytes_1[22]; + HwOutputs._10a1_User_Data_128_bytes_1[23] := PlcOutputs._10a1_User_Data_128_bytes_1[23]; + HwOutputs._10a1_User_Data_128_bytes_1[24] := PlcOutputs._10a1_User_Data_128_bytes_1[24]; + HwOutputs._10a1_User_Data_128_bytes_1[25] := PlcOutputs._10a1_User_Data_128_bytes_1[25]; + HwOutputs._10a1_User_Data_128_bytes_1[26] := PlcOutputs._10a1_User_Data_128_bytes_1[26]; + HwOutputs._10a1_User_Data_128_bytes_1[27] := PlcOutputs._10a1_User_Data_128_bytes_1[27]; + HwOutputs._10a1_User_Data_128_bytes_1[28] := PlcOutputs._10a1_User_Data_128_bytes_1[28]; + HwOutputs._10a1_User_Data_128_bytes_1[29] := PlcOutputs._10a1_User_Data_128_bytes_1[29]; + HwOutputs._10a1_User_Data_128_bytes_1[30] := PlcOutputs._10a1_User_Data_128_bytes_1[30]; + HwOutputs._10a1_User_Data_128_bytes_1[31] := PlcOutputs._10a1_User_Data_128_bytes_1[31]; + HwOutputs._10a1_User_Data_128_bytes_1[32] := PlcOutputs._10a1_User_Data_128_bytes_1[32]; + HwOutputs._10a1_User_Data_128_bytes_1[33] := PlcOutputs._10a1_User_Data_128_bytes_1[33]; + HwOutputs._10a1_User_Data_128_bytes_1[34] := PlcOutputs._10a1_User_Data_128_bytes_1[34]; + HwOutputs._10a1_User_Data_128_bytes_1[35] := PlcOutputs._10a1_User_Data_128_bytes_1[35]; + HwOutputs._10a1_User_Data_128_bytes_1[36] := PlcOutputs._10a1_User_Data_128_bytes_1[36]; + HwOutputs._10a1_User_Data_128_bytes_1[37] := PlcOutputs._10a1_User_Data_128_bytes_1[37]; + HwOutputs._10a1_User_Data_128_bytes_1[38] := PlcOutputs._10a1_User_Data_128_bytes_1[38]; + HwOutputs._10a1_User_Data_128_bytes_1[39] := PlcOutputs._10a1_User_Data_128_bytes_1[39]; + HwOutputs._10a1_User_Data_128_bytes_1[40] := PlcOutputs._10a1_User_Data_128_bytes_1[40]; + HwOutputs._10a1_User_Data_128_bytes_1[41] := PlcOutputs._10a1_User_Data_128_bytes_1[41]; + HwOutputs._10a1_User_Data_128_bytes_1[42] := PlcOutputs._10a1_User_Data_128_bytes_1[42]; + HwOutputs._10a1_User_Data_128_bytes_1[43] := PlcOutputs._10a1_User_Data_128_bytes_1[43]; + HwOutputs._10a1_User_Data_128_bytes_1[44] := PlcOutputs._10a1_User_Data_128_bytes_1[44]; + HwOutputs._10a1_User_Data_128_bytes_1[45] := PlcOutputs._10a1_User_Data_128_bytes_1[45]; + HwOutputs._10a1_User_Data_128_bytes_1[46] := PlcOutputs._10a1_User_Data_128_bytes_1[46]; + HwOutputs._10a1_User_Data_128_bytes_1[47] := PlcOutputs._10a1_User_Data_128_bytes_1[47]; + HwOutputs._10a1_User_Data_128_bytes_1[48] := PlcOutputs._10a1_User_Data_128_bytes_1[48]; + HwOutputs._10a1_User_Data_128_bytes_1[49] := PlcOutputs._10a1_User_Data_128_bytes_1[49]; + HwOutputs._10a1_User_Data_128_bytes_1[50] := PlcOutputs._10a1_User_Data_128_bytes_1[50]; + HwOutputs._10a1_User_Data_128_bytes_1[51] := PlcOutputs._10a1_User_Data_128_bytes_1[51]; + HwOutputs._10a1_User_Data_128_bytes_1[52] := PlcOutputs._10a1_User_Data_128_bytes_1[52]; + HwOutputs._10a1_User_Data_128_bytes_1[53] := PlcOutputs._10a1_User_Data_128_bytes_1[53]; + HwOutputs._10a1_User_Data_128_bytes_1[54] := PlcOutputs._10a1_User_Data_128_bytes_1[54]; + HwOutputs._10a1_User_Data_128_bytes_1[55] := PlcOutputs._10a1_User_Data_128_bytes_1[55]; + HwOutputs._10a1_User_Data_128_bytes_1[56] := PlcOutputs._10a1_User_Data_128_bytes_1[56]; + HwOutputs._10a1_User_Data_128_bytes_1[57] := PlcOutputs._10a1_User_Data_128_bytes_1[57]; + HwOutputs._10a1_User_Data_128_bytes_1[58] := PlcOutputs._10a1_User_Data_128_bytes_1[58]; + HwOutputs._10a1_User_Data_128_bytes_1[59] := PlcOutputs._10a1_User_Data_128_bytes_1[59]; + HwOutputs._10a1_User_Data_128_bytes_1[60] := PlcOutputs._10a1_User_Data_128_bytes_1[60]; + HwOutputs._10a1_User_Data_128_bytes_1[61] := PlcOutputs._10a1_User_Data_128_bytes_1[61]; + HwOutputs._10a1_User_Data_128_bytes_1[62] := PlcOutputs._10a1_User_Data_128_bytes_1[62]; + HwOutputs._10a1_User_Data_128_bytes_1[63] := PlcOutputs._10a1_User_Data_128_bytes_1[63]; + HwOutputs._10a1_User_Data_128_bytes_1[64] := PlcOutputs._10a1_User_Data_128_bytes_1[64]; + HwOutputs._10a1_User_Data_128_bytes_1[65] := PlcOutputs._10a1_User_Data_128_bytes_1[65]; + HwOutputs._10a1_User_Data_128_bytes_1[66] := PlcOutputs._10a1_User_Data_128_bytes_1[66]; + HwOutputs._10a1_User_Data_128_bytes_1[67] := PlcOutputs._10a1_User_Data_128_bytes_1[67]; + HwOutputs._10a1_User_Data_128_bytes_1[68] := PlcOutputs._10a1_User_Data_128_bytes_1[68]; + HwOutputs._10a1_User_Data_128_bytes_1[69] := PlcOutputs._10a1_User_Data_128_bytes_1[69]; + HwOutputs._10a1_User_Data_128_bytes_1[70] := PlcOutputs._10a1_User_Data_128_bytes_1[70]; + HwOutputs._10a1_User_Data_128_bytes_1[71] := PlcOutputs._10a1_User_Data_128_bytes_1[71]; + HwOutputs._10a1_User_Data_128_bytes_1[72] := PlcOutputs._10a1_User_Data_128_bytes_1[72]; + HwOutputs._10a1_User_Data_128_bytes_1[73] := PlcOutputs._10a1_User_Data_128_bytes_1[73]; + HwOutputs._10a1_User_Data_128_bytes_1[74] := PlcOutputs._10a1_User_Data_128_bytes_1[74]; + HwOutputs._10a1_User_Data_128_bytes_1[75] := PlcOutputs._10a1_User_Data_128_bytes_1[75]; + HwOutputs._10a1_User_Data_128_bytes_1[76] := PlcOutputs._10a1_User_Data_128_bytes_1[76]; + HwOutputs._10a1_User_Data_128_bytes_1[77] := PlcOutputs._10a1_User_Data_128_bytes_1[77]; + HwOutputs._10a1_User_Data_128_bytes_1[78] := PlcOutputs._10a1_User_Data_128_bytes_1[78]; + HwOutputs._10a1_User_Data_128_bytes_1[79] := PlcOutputs._10a1_User_Data_128_bytes_1[79]; + HwOutputs._10a1_User_Data_128_bytes_1[80] := PlcOutputs._10a1_User_Data_128_bytes_1[80]; + HwOutputs._10a1_User_Data_128_bytes_1[81] := PlcOutputs._10a1_User_Data_128_bytes_1[81]; + HwOutputs._10a1_User_Data_128_bytes_1[82] := PlcOutputs._10a1_User_Data_128_bytes_1[82]; + HwOutputs._10a1_User_Data_128_bytes_1[83] := PlcOutputs._10a1_User_Data_128_bytes_1[83]; + HwOutputs._10a1_User_Data_128_bytes_1[84] := PlcOutputs._10a1_User_Data_128_bytes_1[84]; + HwOutputs._10a1_User_Data_128_bytes_1[85] := PlcOutputs._10a1_User_Data_128_bytes_1[85]; + HwOutputs._10a1_User_Data_128_bytes_1[86] := PlcOutputs._10a1_User_Data_128_bytes_1[86]; + HwOutputs._10a1_User_Data_128_bytes_1[87] := PlcOutputs._10a1_User_Data_128_bytes_1[87]; + HwOutputs._10a1_User_Data_128_bytes_1[88] := PlcOutputs._10a1_User_Data_128_bytes_1[88]; + HwOutputs._10a1_User_Data_128_bytes_1[89] := PlcOutputs._10a1_User_Data_128_bytes_1[89]; + HwOutputs._10a1_User_Data_128_bytes_1[90] := PlcOutputs._10a1_User_Data_128_bytes_1[90]; + HwOutputs._10a1_User_Data_128_bytes_1[91] := PlcOutputs._10a1_User_Data_128_bytes_1[91]; + HwOutputs._10a1_User_Data_128_bytes_1[92] := PlcOutputs._10a1_User_Data_128_bytes_1[92]; + HwOutputs._10a1_User_Data_128_bytes_1[93] := PlcOutputs._10a1_User_Data_128_bytes_1[93]; + HwOutputs._10a1_User_Data_128_bytes_1[94] := PlcOutputs._10a1_User_Data_128_bytes_1[94]; + HwOutputs._10a1_User_Data_128_bytes_1[95] := PlcOutputs._10a1_User_Data_128_bytes_1[95]; + HwOutputs._10a1_User_Data_128_bytes_1[96] := PlcOutputs._10a1_User_Data_128_bytes_1[96]; + HwOutputs._10a1_User_Data_128_bytes_1[97] := PlcOutputs._10a1_User_Data_128_bytes_1[97]; + HwOutputs._10a1_User_Data_128_bytes_1[98] := PlcOutputs._10a1_User_Data_128_bytes_1[98]; + HwOutputs._10a1_User_Data_128_bytes_1[99] := PlcOutputs._10a1_User_Data_128_bytes_1[99]; + HwOutputs._10a1_User_Data_128_bytes_1[100] := PlcOutputs._10a1_User_Data_128_bytes_1[100]; + HwOutputs._10a1_User_Data_128_bytes_1[101] := PlcOutputs._10a1_User_Data_128_bytes_1[101]; + HwOutputs._10a1_User_Data_128_bytes_1[102] := PlcOutputs._10a1_User_Data_128_bytes_1[102]; + HwOutputs._10a1_User_Data_128_bytes_1[103] := PlcOutputs._10a1_User_Data_128_bytes_1[103]; + HwOutputs._10a1_User_Data_128_bytes_1[104] := PlcOutputs._10a1_User_Data_128_bytes_1[104]; + HwOutputs._10a1_User_Data_128_bytes_1[105] := PlcOutputs._10a1_User_Data_128_bytes_1[105]; + HwOutputs._10a1_User_Data_128_bytes_1[106] := PlcOutputs._10a1_User_Data_128_bytes_1[106]; + HwOutputs._10a1_User_Data_128_bytes_1[107] := PlcOutputs._10a1_User_Data_128_bytes_1[107]; + HwOutputs._10a1_User_Data_128_bytes_1[108] := PlcOutputs._10a1_User_Data_128_bytes_1[108]; + HwOutputs._10a1_User_Data_128_bytes_1[109] := PlcOutputs._10a1_User_Data_128_bytes_1[109]; + HwOutputs._10a1_User_Data_128_bytes_1[110] := PlcOutputs._10a1_User_Data_128_bytes_1[110]; + HwOutputs._10a1_User_Data_128_bytes_1[111] := PlcOutputs._10a1_User_Data_128_bytes_1[111]; + HwOutputs._10a1_User_Data_128_bytes_1[112] := PlcOutputs._10a1_User_Data_128_bytes_1[112]; + HwOutputs._10a1_User_Data_128_bytes_1[113] := PlcOutputs._10a1_User_Data_128_bytes_1[113]; + HwOutputs._10a1_User_Data_128_bytes_1[114] := PlcOutputs._10a1_User_Data_128_bytes_1[114]; + HwOutputs._10a1_User_Data_128_bytes_1[115] := PlcOutputs._10a1_User_Data_128_bytes_1[115]; + HwOutputs._10a1_User_Data_128_bytes_1[116] := PlcOutputs._10a1_User_Data_128_bytes_1[116]; + HwOutputs._10a1_User_Data_128_bytes_1[117] := PlcOutputs._10a1_User_Data_128_bytes_1[117]; + HwOutputs._10a1_User_Data_128_bytes_1[118] := PlcOutputs._10a1_User_Data_128_bytes_1[118]; + HwOutputs._10a1_User_Data_128_bytes_1[119] := PlcOutputs._10a1_User_Data_128_bytes_1[119]; + HwOutputs._10a1_User_Data_128_bytes_1[120] := PlcOutputs._10a1_User_Data_128_bytes_1[120]; + HwOutputs._10a1_User_Data_128_bytes_1[121] := PlcOutputs._10a1_User_Data_128_bytes_1[121]; + HwOutputs._10a1_User_Data_128_bytes_1[122] := PlcOutputs._10a1_User_Data_128_bytes_1[122]; + HwOutputs._10a1_User_Data_128_bytes_1[123] := PlcOutputs._10a1_User_Data_128_bytes_1[123]; + HwOutputs._10a1_User_Data_128_bytes_1[124] := PlcOutputs._10a1_User_Data_128_bytes_1[124]; + HwOutputs._10a1_User_Data_128_bytes_1[125] := PlcOutputs._10a1_User_Data_128_bytes_1[125]; + HwOutputs._10a1_User_Data_128_bytes_1[126] := PlcOutputs._10a1_User_Data_128_bytes_1[126]; + HwOutputs._10a1_User_Data_128_bytes_1[127] := PlcOutputs._10a1_User_Data_128_bytes_1[127]; + HwOutputs._10a1_User_Data_128_bytes_1[128] := PlcOutputs._10a1_User_Data_128_bytes_1[128]; + HwOutputs._10a1_User_Data_128_bytes_1[129] := PlcOutputs._10a1_User_Data_128_bytes_1[129]; + HwOutputs._10a1_User_Data_128_bytes_1[130] := PlcOutputs._10a1_User_Data_128_bytes_1[130]; + HwOutputs._10a1_User_Data_128_bytes_1[131] := PlcOutputs._10a1_User_Data_128_bytes_1[131]; +END_FUNCTION diff --git a/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/HwInputs.st b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/HwInputs.st new file mode 100644 index 000000000..9dfa1760b --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/HwInputs.st @@ -0,0 +1,15 @@ +TYPE + HwInputs : STRUCT + _11a1_DI_8x24VDC_ST_1 AT %B0 : BYTE; + _11a1_DI_8x24VDC_ST_2 AT %B1 : BYTE; + _12a1_Acquisition_Status_1 AT %B2 : ARRAY[0..2] OF BYTE; + _12a1_Inspection_Status_1 AT %B5 : DWORD; + _12a1_Command_Control_1 AT %B9 : WORD; + _12a1_SoftEvent_Control_1 AT %B11 : BYTE; + _12a1_Results_64_bytes_1 AT %B12 : ARRAY[0..67] OF BYTE; + _10a1_Acquisition_Status_1 AT %B80 : ARRAY[0..2] OF BYTE; + _10a1_Results_Status_1 AT %B83 : BYTE; + _10a1_Soft_Event_Control_1 AT %B84 : BYTE; + _10a1_Result_Data_128_bytes_1 AT %B85 : ARRAY[0..135] OF BYTE; + END_STRUCT; +END_TYPE diff --git a/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/HwOutputs.st b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/HwOutputs.st new file mode 100644 index 000000000..97d565aed --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/HwOutputs.st @@ -0,0 +1,14 @@ +TYPE + HwOutputs : STRUCT + _11a1_DQ_8x24VDC_0_5A_ST_1 AT %B0 : BYTE; + _12a1_Acquisition_Control_1 AT %B1 : BYTE; + _12a1_Inspection_Control_1 AT %B2 : BYTE; + _12a1_Command_Control_1 AT %B3 : WORD; + _12a1_SoftEvent_Control_1 AT %B5 : BYTE; + _12a1_User_Data_64_bytes_1 AT %B6 : ARRAY[0..63] OF BYTE; + _10a1_Acquisition_Control_1 AT %B70 : BYTE; + _10a1_Results_Control_1 AT %B71 : BYTE; + _10a1_Soft_Event_Control_1 AT %B72 : BYTE; + _10a1_User_Data_128_bytes_1 AT %B73 : ARRAY[0..131] OF BYTE; + END_STRUCT; +END_TYPE diff --git a/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/PlcInputs.st b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/PlcInputs.st new file mode 100644 index 000000000..7fe1d3a2a --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/PlcInputs.st @@ -0,0 +1,15 @@ +TYPE + PlcInputs : STRUCT + _11a1_DI_8x24VDC_ST_1 : BYTE; + _11a1_DI_8x24VDC_ST_2 : BYTE; + _12a1_Acquisition_Status_1 : ARRAY[0..2] OF BYTE; + _12a1_Inspection_Status_1 : DWORD; + _12a1_Command_Control_1 : WORD; + _12a1_SoftEvent_Control_1 : BYTE; + _12a1_Results_64_bytes_1 : ARRAY[0..67] OF BYTE; + _10a1_Acquisition_Status_1 : ARRAY[0..2] OF BYTE; + _10a1_Results_Status_1 : BYTE; + _10a1_Soft_Event_Control_1 : BYTE; + _10a1_Result_Data_128_bytes_1 : ARRAY[0..135] OF BYTE; + END_STRUCT; +END_TYPE diff --git a/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/PlcOutputs.st b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/PlcOutputs.st new file mode 100644 index 000000000..2ea4d4ab4 --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/PlcOutputs.st @@ -0,0 +1,14 @@ +TYPE + PlcOutputs : STRUCT + _11a1_DQ_8x24VDC_0_5A_ST_1 : BYTE; + _12a1_Acquisition_Control_1 : BYTE; + _12a1_Inspection_Control_1 : BYTE; + _12a1_Command_Control_1 : WORD; + _12a1_SoftEvent_Control_1 : BYTE; + _12a1_User_Data_64_bytes_1 : ARRAY[0..63] OF BYTE; + _10a1_Acquisition_Control_1 : BYTE; + _10a1_Results_Control_1 : BYTE; + _10a1_Soft_Event_Control_1 : BYTE; + _10a1_User_Data_128_bytes_1 : ARRAY[0..131] OF BYTE; + END_STRUCT; +END_TYPE diff --git a/src/integrations/ctrl/src/configuration.st b/src/integrations/ctrl/src/configuration.st index 697f71973..723e41805 100644 --- a/src/integrations/ctrl/src/configuration.st +++ b/src/integrations/ctrl/src/configuration.st @@ -26,6 +26,8 @@ CONFIGURATION MyConfiguration AxoMessengersDocu : AxoStaticMessengerDocuExample.Messengers; AxoRtc : AxoRtc.AxoS71500Rtc; AxoDataFragmentExchangeContext : AxoDataFramentsExchangeDocuExample.AxoDataFragmentExchangeContext; + AxoCognexVisionDatamanExampleContext : AxoCognexVisionDatamanExamples.AxoCognexVisionDatamanExampleContext; + process_data_manager: AxoDataExamples.AxoProcessDataManager; test_data_manager: AxoDataExamples.AxoTestDataManager; AxoLoggers : AxoLoggerExamples.Loggers; @@ -35,4 +37,14 @@ CONFIGURATION MyConfiguration // Integration tests Integrations : IntegrationTests.Integrations; END_VAR + + //Copy this VAR_GLOBAL section into your configuration file inside your project. + //Do not change any names, addresses or any another content. + VAR_GLOBAL + HwInputs AT %IB0 : HwInputs; + HwOutputs AT %QB0 : HwOutputs; + PlcInputs : PlcInputs; + PlcOutputs : PlcOutputs; + END_VAR + END_CONFIGURATION diff --git a/src/integrations/ctrl/src/program.st b/src/integrations/ctrl/src/program.st index 1cff27b03..1d393c140 100644 --- a/src/integrations/ctrl/src/program.st +++ b/src/integrations/ctrl/src/program.st @@ -22,6 +22,7 @@ PROGRAM MyProgram AxoMessengersDocu : AxoStaticMessengerDocuExample.Messengers; AxoDataFragmentExchangeContext : AxoDataFramentsExchangeDocuExample.AxoDataFragmentExchangeContext; + AxoCognexVisionDatamanExampleContext : AxoCognexVisionDatamanExamples.AxoCognexVisionDatamanExampleContext; AxoLoggers : AxoLoggerExamples.Loggers; @@ -30,6 +31,17 @@ PROGRAM MyProgram AxoRtc : AxoRtc.AxoS71500Rtc; END_VAR + + //Copy this VAR_EXTERNAL section into the declaration part of your main program file inside your project. + //Do not change any names, addresses or any another content. + VAR_EXTERNAL + PlcInputs : PlcInputs; + PlcOutputs : PlcOutputs; + END_VAR + //Copy this function call at the very beginning of your program. + //Do not change any names, addresses or any another content. + CopyInputs(); + I_am_alive := I_am_alive + ULINT#1; MainContext.Run(); @@ -50,11 +62,19 @@ PROGRAM MyProgram AxoMessengersDocu.Run(); AxoMessengersDocu.InjectRtc(AxoRtc); AxoDataFragmentExchangeContext.Run(); + + AxoCognexVisionDatamanExampleContext.PlcInputs := PlcInputs; + AxoCognexVisionDatamanExampleContext.PlcOutputs := PlcOutputs; + AxoCognexVisionDatamanExampleContext.Run(); + AxoLoggers.InjectRtc(AxoRtc); AxoLoggers.Run(); // Integration tests Integrations.Run(); - + + //Copy this function call at the very end of your program. + //Do not change any names, addresses or any another content. + CopyOutputs(); END_PROGRAM @@ -97,3 +117,20 @@ CLASS MyContext EXTENDS AxoContext END_METHOD END_CLASS + + + + // Context.Inputs := REF(Inputs); + // Context.Outputs := REF(Outputs); + // Context.PlcInputs := REF(PlcInputs); + // Context.PlcOutputs := REF(PlcOutputs); + + + // ContextLogger.SetMinimumLevel(AXOpen.Logging.eLogLevel#Verbose); + // Context.InjectRtc(S71500Rtc); + // Context.InjectLogger(ContextLogger); + // // Executes the main context of this application. + // Context.Run(); + + +// END_PROGRAM diff --git a/src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoCognexVision/AxoCognexVisionDatamanExample.razor b/src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoCognexVision/AxoCognexVisionDatamanExample.razor new file mode 100644 index 000000000..cb9a8f7c7 --- /dev/null +++ b/src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoCognexVision/AxoCognexVisionDatamanExample.razor @@ -0,0 +1,27 @@ +@page "/AxoCognexVisionDatamanExample" +@using axopen_integrations +@using AXOpen.Core; +@using AXOpen.Cognex.Vision.v_6_0_0_0; + +

AxoCognexVisionDatamanExample

+ +
+
+ AxoCognexVisionDataman +
+
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+ diff --git a/src/integrations/src/AXOpen.Integrations.Blazor/Shared/NavMenu.razor b/src/integrations/src/AXOpen.Integrations.Blazor/Shared/NavMenu.razor index bc8f94335..22f074c46 100644 --- a/src/integrations/src/AXOpen.Integrations.Blazor/Shared/NavMenu.razor +++ b/src/integrations/src/AXOpen.Integrations.Blazor/Shared/NavMenu.razor @@ -78,7 +78,7 @@ AxoDataFragmentsRemote - + + diff --git a/src/integrations/src/AXOpen.Integrations/axopen_integrations.csproj b/src/integrations/src/AXOpen.Integrations/axopen_integrations.csproj index 6f12ece2a..6521f727d 100644 --- a/src/integrations/src/AXOpen.Integrations/axopen_integrations.csproj +++ b/src/integrations/src/AXOpen.Integrations/axopen_integrations.csproj @@ -24,6 +24,7 @@ + diff --git a/src/templates.simple/ctrl/.config/dotnet-tools.json b/src/templates.simple/ctrl/.config/dotnet-tools.json new file mode 100644 index 000000000..67cb08dcd --- /dev/null +++ b/src/templates.simple/ctrl/.config/dotnet-tools.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "axsharp.ixc": { + "version": "0.14.0-alpha.113", + "commands": [ + "ixc" + ] + }, + "axsharp.ixr": { + "version": "0.14.0-alpha.113", + "commands": [ + "ixr" + ] + } + } +} \ No newline at end of file diff --git a/src/utils/ctrl/src/AXOpenUtils/AxoCRC_16.st b/src/utils/ctrl/src/AXOpenUtils/AxoCRC_16.st index b01636c4d..567abb817 100644 --- a/src/utils/ctrl/src/AXOpenUtils/AxoCRC_16.st +++ b/src/utils/ctrl/src/AXOpenUtils/AxoCRC_16.st @@ -43,7 +43,7 @@ NAMESPACE AXOpen.Utils END_IF; FOR i := UINT#1 TO maxIndex BY UINT#1 DO - crc := AxoXor(SHL(crc, UINT#8),CRC_TABLE[TO_INT(AxoXor(SHR(crc, UINT#8) , serialized[i]))]); + crc :=SHL(crc, UINT#8) XOR CRC_TABLE[TO_INT(SHR(crc, UINT#8) XOR serialized[i])]; END_FOR; AxoCRC_16 := crc; diff --git a/src/utils/ctrl/src/AXOpenUtils/AxoCRC_32.st b/src/utils/ctrl/src/AXOpenUtils/AxoCRC_32.st index 26eb790c1..587c8e3c3 100644 --- a/src/utils/ctrl/src/AXOpenUtils/AxoCRC_32.st +++ b/src/utils/ctrl/src/AXOpenUtils/AxoCRC_32.st @@ -43,7 +43,7 @@ NAMESPACE AXOpen.Utils END_IF; FOR i := UINT#1 TO maxIndex BY UINT#1 DO - crc := AxoXor(SHL(crc, UINT#8),CRC_TABLE[TO_INT(AxoXor(SHR(crc, UINT#24) , serialized[i]))]); + crc := SHL(crc, UINT#8) XOR CRC_TABLE[TO_INT(SHR(crc, UINT#24) XOR serialized[i])]; END_FOR; AxoCRC_32 := crc; diff --git a/src/utils/ctrl/src/AXOpenUtils/AxoCRC_8.st b/src/utils/ctrl/src/AXOpenUtils/AxoCRC_8.st index 8e148a8e4..3da65f490 100644 --- a/src/utils/ctrl/src/AXOpenUtils/AxoCRC_8.st +++ b/src/utils/ctrl/src/AXOpenUtils/AxoCRC_8.st @@ -43,7 +43,7 @@ NAMESPACE AXOpen.Utils END_IF; FOR i := UINT#1 TO maxIndex BY UINT#1 DO - crc := CRC_TABLE[TO_INT(AxoXor(crc , TO_BYTE(TO_CHAR(serialized[i]))))]; + crc := CRC_TABLE[TO_INT(crc XOR TO_BYTE(TO_CHAR(serialized[i])))]; END_FOR; AxoCRC_8 := crc; END_FUNCTION diff --git a/src/utils/ctrl/src/AXOpenUtils/AxoXORs.st b/src/utils/ctrl/src/AXOpenUtils/AxoXORs.st deleted file mode 100644 index c8ca3fcc3..000000000 --- a/src/utils/ctrl/src/AXOpenUtils/AxoXORs.st +++ /dev/null @@ -1,200 +0,0 @@ - -NAMESPACE AXOpen.Utils - FUNCTION AxoXor : BYTE - VAR_INPUT - In1 : BYTE; - In2 : BYTE; - END_VAR - VAR_TEMP - retval : BYTE; - i : USINT; - END_VAR - retval := BYTE#0; - - // TODO check the performance of both principles - // FOR i := USINT#0 TO USINT#7 DO - // SetBit(retval,i,GetBit(In1,i) XOR GetBit(In2,i)); - // END_FOR; - - retval.%X0 := In1.%X0 XOR In2.%X0 ; - retval.%X1 := In1.%X1 XOR In2.%X1 ; - retval.%X2 := In1.%X2 XOR In2.%X2 ; - retval.%X3 := In1.%X3 XOR In2.%X3 ; - retval.%X4 := In1.%X4 XOR In2.%X4 ; - retval.%X5 := In1.%X5 XOR In2.%X5 ; - retval.%X6 := In1.%X6 XOR In2.%X6 ; - retval.%X7 := In1.%X7 XOR In2.%X7 ; - - AxoXor := retval; - END_FUNCTION - - FUNCTION AxoXor : WORD - VAR_INPUT - In1 : WORD; - In2 : WORD; - END_VAR - VAR_TEMP - retval : WORD; - i : USINT; - END_VAR - retval := WORD#0; - - // TODO check the performance of both principles - // FOR i := USINT#0 TO USINT#15 DO - // SetBit(retval,i,GetBit(In1,i) XOR GetBit(In2,i)); - // END_FOR; - - retval.%X0 := In1.%X0 XOR In2.%X0 ; - retval.%X1 := In1.%X1 XOR In2.%X1 ; - retval.%X2 := In1.%X2 XOR In2.%X2 ; - retval.%X3 := In1.%X3 XOR In2.%X3 ; - retval.%X4 := In1.%X4 XOR In2.%X4 ; - retval.%X5 := In1.%X5 XOR In2.%X5 ; - retval.%X6 := In1.%X6 XOR In2.%X6 ; - retval.%X7 := In1.%X7 XOR In2.%X7 ; - retval.%X8 := In1.%X8 XOR In2.%X8 ; - retval.%X9 := In1.%X9 XOR In2.%X9 ; - retval.%X10 := In1.%X10 XOR In2.%X10 ; - retval.%X11 := In1.%X11 XOR In2.%X11 ; - retval.%X12 := In1.%X12 XOR In2.%X12 ; - retval.%X13 := In1.%X13 XOR In2.%X13 ; - retval.%X14 := In1.%X14 XOR In2.%X14 ; - retval.%X15 := In1.%X15 XOR In2.%X15 ; - - AxoXor := retval; - END_FUNCTION - - FUNCTION AxoXor : DWORD - VAR_INPUT - In1 : DWORD; - In2 : DWORD; - END_VAR - VAR_TEMP - retval : DWORD; - i : USINT; - END_VAR - retval := DWORD#0; - - // TODO check the performance of both principles - // FOR i := USINT#0 TO USINT#31 DO - // SetBit(retval,i,GetBit(In1,i) XOR GetBit(In2,i)); - // END_FOR; - - retval.%X0 := In1.%X0 XOR In2.%X0 ; - retval.%X1 := In1.%X1 XOR In2.%X1 ; - retval.%X2 := In1.%X2 XOR In2.%X2 ; - retval.%X3 := In1.%X3 XOR In2.%X3 ; - retval.%X4 := In1.%X4 XOR In2.%X4 ; - retval.%X5 := In1.%X5 XOR In2.%X5 ; - retval.%X6 := In1.%X6 XOR In2.%X6 ; - retval.%X7 := In1.%X7 XOR In2.%X7 ; - retval.%X8 := In1.%X8 XOR In2.%X8 ; - retval.%X9 := In1.%X9 XOR In2.%X9 ; - retval.%X10 := In1.%X10 XOR In2.%X10 ; - retval.%X11 := In1.%X11 XOR In2.%X11 ; - retval.%X12 := In1.%X12 XOR In2.%X12 ; - retval.%X13 := In1.%X13 XOR In2.%X13 ; - retval.%X14 := In1.%X14 XOR In2.%X14 ; - retval.%X15 := In1.%X15 XOR In2.%X15 ; - retval.%X16 := In1.%X16 XOR In2.%X16 ; - retval.%X17 := In1.%X17 XOR In2.%X17 ; - retval.%X18 := In1.%X18 XOR In2.%X18 ; - retval.%X19 := In1.%X19 XOR In2.%X19 ; - retval.%X20 := In1.%X20 XOR In2.%X20 ; - retval.%X21 := In1.%X21 XOR In2.%X21 ; - retval.%X22 := In1.%X22 XOR In2.%X22 ; - retval.%X23 := In1.%X23 XOR In2.%X23 ; - retval.%X24 := In1.%X24 XOR In2.%X24 ; - retval.%X25 := In1.%X25 XOR In2.%X25 ; - retval.%X26 := In1.%X26 XOR In2.%X26 ; - retval.%X27 := In1.%X27 XOR In2.%X27 ; - retval.%X28 := In1.%X28 XOR In2.%X28 ; - retval.%X29 := In1.%X29 XOR In2.%X29 ; - retval.%X30 := In1.%X30 XOR In2.%X30 ; - retval.%X31 := In1.%X31 XOR In2.%X31 ; - AxoXor := retval; - END_FUNCTION - - FUNCTION AxoXor : LWORD - VAR_INPUT - In1 : LWORD; - In2 : LWORD; - END_VAR - VAR_TEMP - retval : LWORD; - i : USINT; - END_VAR - retval := LWORD#0; - - // TODO check the performance of both principles - // FOR i := USINT#0 TO USINT#63 DO - // SetBit(retval,i,GetBit(In1,i) XOR GetBit(In2,i)); - // END_FOR; - - retval.%X0 := In1.%X0 XOR In2.%X0 ; - retval.%X1 := In1.%X1 XOR In2.%X1 ; - retval.%X2 := In1.%X2 XOR In2.%X2 ; - retval.%X3 := In1.%X3 XOR In2.%X3 ; - retval.%X4 := In1.%X4 XOR In2.%X4 ; - retval.%X5 := In1.%X5 XOR In2.%X5 ; - retval.%X6 := In1.%X6 XOR In2.%X6 ; - retval.%X7 := In1.%X7 XOR In2.%X7 ; - retval.%X8 := In1.%X8 XOR In2.%X8 ; - retval.%X9 := In1.%X9 XOR In2.%X9 ; - retval.%X10 := In1.%X10 XOR In2.%X10 ; - retval.%X11 := In1.%X11 XOR In2.%X11 ; - retval.%X12 := In1.%X12 XOR In2.%X12 ; - retval.%X13 := In1.%X13 XOR In2.%X13 ; - retval.%X14 := In1.%X14 XOR In2.%X14 ; - retval.%X15 := In1.%X15 XOR In2.%X15 ; - retval.%X16 := In1.%X16 XOR In2.%X16 ; - retval.%X17 := In1.%X17 XOR In2.%X17 ; - retval.%X18 := In1.%X18 XOR In2.%X18 ; - retval.%X19 := In1.%X19 XOR In2.%X19 ; - retval.%X20 := In1.%X20 XOR In2.%X20 ; - retval.%X21 := In1.%X21 XOR In2.%X21 ; - retval.%X22 := In1.%X22 XOR In2.%X22 ; - retval.%X23 := In1.%X23 XOR In2.%X23 ; - retval.%X24 := In1.%X24 XOR In2.%X24 ; - retval.%X25 := In1.%X25 XOR In2.%X25 ; - retval.%X26 := In1.%X26 XOR In2.%X26 ; - retval.%X27 := In1.%X27 XOR In2.%X27 ; - retval.%X28 := In1.%X28 XOR In2.%X28 ; - retval.%X29 := In1.%X29 XOR In2.%X29 ; - retval.%X30 := In1.%X30 XOR In2.%X30 ; - retval.%X31 := In1.%X31 XOR In2.%X31 ; - retval.%X32 := In1.%X32 XOR In2.%X32 ; - retval.%X33 := In1.%X33 XOR In2.%X33 ; - retval.%X34 := In1.%X34 XOR In2.%X34 ; - retval.%X35 := In1.%X35 XOR In2.%X35 ; - retval.%X36 := In1.%X36 XOR In2.%X36 ; - retval.%X37 := In1.%X37 XOR In2.%X37 ; - retval.%X38 := In1.%X38 XOR In2.%X38 ; - retval.%X39 := In1.%X39 XOR In2.%X39 ; - retval.%X40 := In1.%X40 XOR In2.%X40 ; - retval.%X41 := In1.%X41 XOR In2.%X41 ; - retval.%X42 := In1.%X42 XOR In2.%X42 ; - retval.%X43 := In1.%X43 XOR In2.%X43 ; - retval.%X44 := In1.%X44 XOR In2.%X44 ; - retval.%X45 := In1.%X45 XOR In2.%X45 ; - retval.%X46 := In1.%X46 XOR In2.%X46 ; - retval.%X47 := In1.%X47 XOR In2.%X47 ; - retval.%X48 := In1.%X48 XOR In2.%X48 ; - retval.%X49 := In1.%X49 XOR In2.%X49 ; - retval.%X50 := In1.%X50 XOR In2.%X50 ; - retval.%X51 := In1.%X51 XOR In2.%X51 ; - retval.%X52 := In1.%X52 XOR In2.%X52 ; - retval.%X53 := In1.%X53 XOR In2.%X53 ; - retval.%X54 := In1.%X54 XOR In2.%X54 ; - retval.%X55 := In1.%X55 XOR In2.%X55 ; - retval.%X56 := In1.%X56 XOR In2.%X56 ; - retval.%X57 := In1.%X57 XOR In2.%X57 ; - retval.%X58 := In1.%X58 XOR In2.%X58 ; - retval.%X59 := In1.%X59 XOR In2.%X59 ; - retval.%X60 := In1.%X60 XOR In2.%X60 ; - retval.%X61 := In1.%X61 XOR In2.%X61 ; - retval.%X62 := In1.%X62 XOR In2.%X62 ; - retval.%X63 := In1.%X63 XOR In2.%X63 ; - AxoXor := retval; - END_FUNCTION -END_NAMESPACE \ No newline at end of file diff --git a/src/utils/ctrl/src/Conversions/FromBytes/AxoBytesToDint.st b/src/utils/ctrl/src/Conversions/FromBytes/AxoBytesToDint.st new file mode 100644 index 000000000..8e73be481 --- /dev/null +++ b/src/utils/ctrl/src/Conversions/FromBytes/AxoBytesToDint.st @@ -0,0 +1,21 @@ +USING System.SerDe; + +NAMESPACE AXOpen.Utils + FUNCTION AxoBytesToDint : DINT + VAR_INPUT + inFormat : Endianness; + inByte0: BYTE; + inByte1: BYTE; + inByte2: BYTE; + inByte3: BYTE; + END_VAR + + + IF inFormat=Endianness#Little THEN + AxoBytesToDint := TO_DINT(SHL(SHL(SHL(TO_DWORD(inByte3), UINT#8) OR inByte2,UINT#8) OR inByte1,UINT#8) OR inByte0); + ELSIF inFormat=Endianness#Big THEN + AxoBytesToDint := TO_DINT(SHL(SHL(SHL(TO_DWORD(inByte0), UINT#8) OR inByte1,UINT#8) OR inByte2,UINT#8) OR inByte3); + END_IF; + END_FUNCTION + +END_NAMESPACE \ No newline at end of file diff --git a/src/utils/ctrl/src/Conversions/FromBytes/AxoBytesToInt.st b/src/utils/ctrl/src/Conversions/FromBytes/AxoBytesToInt.st new file mode 100644 index 000000000..6bb59ab75 --- /dev/null +++ b/src/utils/ctrl/src/Conversions/FromBytes/AxoBytesToInt.st @@ -0,0 +1,18 @@ +USING System.SerDe; + +NAMESPACE AXOpen.Utils + FUNCTION AxoBytesToInt : DINT + VAR_INPUT + inFormat : Endianness; + inByte0: BYTE; + inByte1: BYTE; + END_VAR + + IF inFormat=Endianness#Little THEN + AxoBytesToInt := TO_INT(SHL(TO_WORD(inByte1),UINT#8) OR inByte0); + ELSIF inFormat=Endianness#Big THEN + AxoBytesToInt := TO_INT(SHL(TO_WORD(inByte0),UINT#8) OR inByte1); + END_IF; + END_FUNCTION + +END_NAMESPACE \ No newline at end of file diff --git a/src/utils/ctrl/test/Conversions/AxoConversions_UnitTests.st b/src/utils/ctrl/test/Conversions/AxoConversions_UnitTests.st new file mode 100644 index 000000000..cd91cff56 --- /dev/null +++ b/src/utils/ctrl/test/Conversions/AxoConversions_UnitTests.st @@ -0,0 +1,33 @@ +USING AxUnit; +USING AXOpen.Utils; +USING System.SerDe; + +NAMESPACE AXOpen.Utils.Unit_Tests + {TestFixture} + CLASS AxoConversions_UnitTests + {Test} + METHOD PUBLIC should_be_305419896_decimal + Assert.Equal(DINT#305419896, AxoBytesToDint(Endianness#Big,Byte#16#12,Byte#16#34,Byte#16#56,Byte#16#78)); + Assert.Equal(DINT#305419896, AxoBytesToDint(Endianness#Little,Byte#16#78,Byte#16#56,Byte#16#34,Byte#16#12)); + END_METHOD + + {Test} + METHOD PUBLIC should_be_2018915346_decimal + Assert.Equal(DINT#2018915346, AxoBytesToDint(Endianness#Little,Byte#16#12,Byte#16#34,Byte#16#56,Byte#16#78)); + Assert.Equal(DINT#2018915346, AxoBytesToDint(Endianness#Big,Byte#16#78,Byte#16#56,Byte#16#34,Byte#16#12)); + END_METHOD + + {Test} + METHOD PUBLIC should_be_4660_decimal + Assert.Equal(INT#4660, AxoBytesToInt(Endianness#Big,Byte#16#12,Byte#16#34)); + Assert.Equal(INT#4660, AxoBytesToInt(Endianness#Little,Byte#16#34,Byte#16#12)); + END_METHOD + + + {Test} + METHOD PUBLIC should_be_13330_decimal + Assert.Equal(INT#13330, AxoBytesToInt(Endianness#Little,Byte#16#12,Byte#16#34)); + Assert.Equal(INT#13330, AxoBytesToInt(Endianness#Big,Byte#16#34,Byte#16#12)); + END_METHOD + END_CLASS +END_NAMESPACE diff --git a/src/ws.code-workspace b/src/ws.code-workspace deleted file mode 100644 index b0feb9430..000000000 --- a/src/ws.code-workspace +++ /dev/null @@ -1,37 +0,0 @@ -{ - "folders": [ - { - "name": "templates.simple", - "path": "templates.simple/ctrl" - }, - { - "name": "core", - "path": "core/ctrl" - }, - { - "name": "integrations", - "path": "integrations/ctrl" - }, - { - "name": "simatic1500", - "path": "simatic1500/ctrl" - }, - { - "name": "utils", - "path": "utils/ctrl" - }, - { - "name": "data", - "path": "data/ctrl" - }, - { - "name": "probers", - "path": "probers/ctrl" - }, - { - "name": "abstractions", - "path": "abstractions/ctrl" - } - ], - "settings": {} -} \ No newline at end of file