diff --git a/cake/ApaxCmd.cs b/cake/ApaxCmd.cs index 292fc2372..484aecdb6 100644 --- a/cake/ApaxCmd.cs +++ b/cake/ApaxCmd.cs @@ -48,6 +48,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..205548e30 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"), + ("components.cognex.vision", "axopen.cognex.vision"), }; public IEnumerable<(string folder, string name, string targetIp, string targetPlatform)> Integrations { get; } = new[] diff --git a/docfx/articles/components/AXOPENCOGNEVISION/AXOPENCOGNEVISION_V_6_0_0_0.md b/docfx/articles/components/AXOPENCOGNEVISION/AXOPENCOGNEVISION_V_6_0_0_0.md new file mode 100644 index 000000000..6591e06fe --- /dev/null +++ b/docfx/articles/components/AXOPENCOGNEVISION/AXOPENCOGNEVISION_V_6_0_0_0.md @@ -0,0 +1,30 @@ +# AXOpenCognexVision + +The `AXOpenCognexVision` library controls and operates the vision devices from the manufacturer `Cognex`. + + +## AxoDataman + +`AxoDataman` provides the essential control and operation of all code-reader of the `Dataman` family. + +### Implementation +The `AxoDataman` is designed to be used as a member of the `AxoContext` or `AxoObject`. +Therefore its instance must be initialized with the proper `AxoContext` or `AxoObject` before any use. +Also, the hardware signals must be assigned first before calling any method of this instance. +To accomplish this, call the `Run` method cyclically with the proper variables (i.e. inside the `Main` method of the relevant `AxoContext`) as in the example below: + +**Example of the initialization and hardware signal assignement** +[!code-smalltalk[](../../../../src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/AxoCognexVisionDatamanExample.st?name=HWIO_Assignement)] + +There are three public methods to operate the `AxoDataman`: + +`Restore` - restores the state of the `AxoDataman` to the initial state and resets all the internal variables. + +`ClearResultData` - resets the data read and confirms the data received from the device. +**Example of using ClearResultData method** +[!code-smalltalk[](../../../../src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/AxoCognexVisionDatamanExample.st?name=ClearResultData)] + +`Read` - triggers the reading sequence and waits for results. +**Example of using Read method** +[!code-smalltalk[](../../../../src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/AxoCognexVisionDatamanExample.st?name=Read)] + diff --git a/docfx/articles/components/AXOPENCOGNEVISION/README.md b/docfx/articles/components/AXOPENCOGNEVISION/README.md new file mode 100644 index 000000000..0d368dae1 --- /dev/null +++ b/docfx/articles/components/AXOPENCOGNEVISION/README.md @@ -0,0 +1,7 @@ +# AXOpenCognexVision + +The `AXOpenCognexVision` library controls and operates the vision devices from the manufacturer `Cognex`. + +# VERSIONS +[!INCLUDE [V_6_0_0_0](AXOPENCOGNEVISION_V_6_0_0_0.md)] + diff --git a/docfx/articles/components/README.md b/docfx/articles/components/README.md new file mode 100644 index 000000000..10f398e3f --- /dev/null +++ b/docfx/articles/components/README.md @@ -0,0 +1,9 @@ +#**AXOpen.Components** + +**AXOpen.Components** is a group of libraries providing control of the individual types of devices grouped by the +manufacturer and the function group. + +# General rules and conventions +[!INCLUDE [Conventions](../guidelines/components.md)] +[!INCLUDE [AXOPENCOGNEVISION](AXOPENCOGNEVISION/README.md)] + diff --git a/docfx/articles/core/AXOTEXTLIST.md b/docfx/articles/core/AXOTEXTLIST.md new file mode 100644 index 000000000..141f4d76b --- /dev/null +++ b/docfx/articles/core/AXOTEXTLIST.md @@ -0,0 +1,35 @@ +# AxoTextList + +AxoTextList provides displaying the string value from the list defined in the extended class inside the `.NET` twin based on the numerical value read out from the PLC. +Moreover, the display form could also change the background colour with the numerical value change. To achieve this, the attributes `WarningLevel` and `ErrorLevel` need to be declared as in the following example. +[!code-smalltalk[](../../../src/integrations/ctrl/src/Examples/AxoTextList/AxoTextListExample.st?name=AxoTextListWithLevelsDefined)] +The final text displayed in the UI application will be `static prefix`+[`text value from text list`(Id)](for example `Description : ` + [TextList(Id)]). +The static prefix is optional. Use the following example to display the same text list without static prefix and with different levels. +[!code-smalltalk[](../../../src/integrations/ctrl/src/Examples/AxoTextList/AxoTextListExample.st?name=AxoTextListWithoutPrefix)] +If the `WarningLevel` is greater than 0 and the `ErrorLevel` is greater than the `WarningLevel`, all items with the `Id` lower than the `WarningLevel` are displayed with the `Primary` background, all items with the `Id` greater or equal to the `WarningLevel` and lower then the `ErrorLevel` are displayed with the `Warning` background and all the rest are displayed with the `Danger` background. The final colours depend on the style used. +If the attributes `WarningLevel` and `ErrorLevel` are not declared as in the following example, all items are displayed with the `Primary` background. +[!code-smalltalk[](../../../src/integrations/ctrl/src/Examples/AxoTextList/AxoTextListExample.st?name=AxoTextListWithoutLevelsDefined)] + +For each `AxoTextList`, there must be a defined property, named exactly as in the `Attributes` inside the examples above. It must be defined in the extended class that the particular `AxoTextList` is a member of. +This property must return a string value from the dictionary defined in the same class based on the numerical value of the `Id` variable. + +Declaration of the dictionary: +[!code-csharp[](../../../src/integrations/src/AXOpen.Integrations/AxoTextListExample/AxoTextListExampleContext.cs?name=DeclarationOfTheDictionary)] + +Filling the items of the dictionary: +[!code-csharp[](../../../src/integrations/src/AXOpen.Integrations/AxoTextListExample/AxoTextListExampleContext.cs?name=FillingTheItemsOfTheDictionary)] + +Returning the string item from the dictionary: +[!code-csharp[](../../../src/integrations/src/AXOpen.Integrations/AxoTextListExample/AxoTextListExampleContext.cs?name=ReturningTheItemBasedOnId)] + +Complete example for two different `AxoTextList`: +[!code-csharp[](../../../src/integrations/src/AXOpen.Integrations/AxoTextListExample/AxoTextListExampleContext.cs?range=1-71)] + +**How to visualize `AxoTextList`** + +On the UI side, to visualize the `AxoTextList`, use the `RenderableContentControl` and set its Context according to the placement of the instance of the `AxoTextList`. +[!code-csharp[](../../../src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoTextList/AxoTextListExample.razor?name=UI)] + +The displayed result should look like this: + +![Alt text](~/images/AxoTextListExampleVisu.gif) diff --git a/docfx/articles/giudelines/Conventions.md b/docfx/articles/guidelines/Conventions.md similarity index 100% rename from docfx/articles/giudelines/Conventions.md rename to docfx/articles/guidelines/Conventions.md diff --git a/docfx/articles/giudelines/componets.md b/docfx/articles/guidelines/components.md similarity index 95% rename from docfx/articles/giudelines/componets.md rename to docfx/articles/guidelines/components.md index 8d9c24c58..d337dfa93 100644 --- a/docfx/articles/giudelines/componets.md +++ b/docfx/articles/guidelines/components.md @@ -5,6 +5,7 @@ | REVISION | DATE | NOTES | |----------|-----------|-----------------| | 0.0 | June 2023 | Initial release | +| 0.1 | August 2023 | Initial release | This document describes the format and practices for writing components in TcOpen. These are universal rules to observe. Each rule knows exception when there is a reasonable argument behind it. @@ -12,9 +13,13 @@ This document describes the format and practices for writing components in TcOpe ## General rules +## Library placement + +Library must be placed in `src` folder of the repository. The containing folder should be named `components`.[manufacturer].[function_group] (e.g. components.cognex.vision). + ### Abstractions -Each component should implement basic contract interface defined in the `AxoAbstractions` library (e.g. `AxoAbbRobot` should implenent `IAxoRobot`, `AxoCongexReader` should impement `IAxoReader`) +Each component should implement basic contract interface defined in the `AxoAbstractions` library (e.g. `AxoAbbRobot` should implenent `IAxoRobot`, `AxoCognexReader` should impement `IAxoReader`) ### I/O variables diff --git a/docfx/articles/toc.yml b/docfx/articles/toc.yml index 057a67786..1d1676727 100644 --- a/docfx/articles/toc.yml +++ b/docfx/articles/toc.yml @@ -27,6 +27,8 @@ href: ~/articles/core/AXODIALOG.md - name: AxoAlertDialog href: ~/articles/core/AXOALERTDIALOG.md + - name: AxoTestList + href: ~/articles/core/AXOTEXTLIST.md - name: AXOpen.Data href: ~/articles/data/README.md items: @@ -39,6 +41,14 @@ items: - name: AxoMessenger href: ~/articles/messaging/AXOMESSENGER.md +- name: AXOpen.Components + href: ~/articles/components/README.md + items: + - name: AxoCognexVision + href: ~/articles/components/AXOPENCOGNEVISION/README.md + items: + - name: V_6_0_0_0 + href: ~/articles/components/AXOPENCOGNEVISION/AXOPENCOGNEVISION_V_6_0_0_0.md - name: AXOpen.Logging href: ~/articles/logging/README.md items: diff --git a/docfx/images/AxoTextList.PNG b/docfx/images/AxoTextList.PNG new file mode 100644 index 000000000..df11c1823 Binary files /dev/null and b/docfx/images/AxoTextList.PNG differ diff --git a/src/AXOpen-packable-only.slnf b/src/AXOpen-packable-only.slnf index 63554a876..467e0591a 100644 --- a/src/AXOpen-packable-only.slnf +++ b/src/AXOpen-packable-only.slnf @@ -4,6 +4,9 @@ "projects": [ "abstractions\\src\\AXOpen.Abstractions\\ix_ax_axopen_abstractions.csproj", "base\\src\\AXOpen.Base.Abstractions\\AXOpen.Base.Abstractions.csproj", + "components.abstractions\\src\\AXOpen.Components.Abstractions\\ix_ax_axopen_components_abstractions.csproj", + "components.cognex.vision\\src\\AXOpen.Cognex.Vision.Blazor\\axopen_cognex_vision_blazor.csproj", + "components.cognex.vision\\src\\AXOpen.Cognex.Vision\\ix_ax_axopen_cognex_vision.csproj", "core\\src\\AXOpen.Core.Blazor\\axopen_core_blazor.csproj", "core\\src\\AXOpen.Core\\ix_ax_axopen_core.csproj", "data\\src\\AXOpen.Data.Blazor\\axopen_data_blazor.csproj", @@ -11,7 +14,7 @@ "data\\src\\repositories\\InMemory\\AXOpen.Data.InMemory.csproj", "data\\src\\repositories\\Json\\AXOpen.Data.Json.csproj", "data\\src\\repositories\\MongoDb\\AXOpen.Data.MongoDb.csproj", - "data\\src\\repositories\\RavenDb\\AXOpen.Data.RavenDb\\AXOpen.Data.RavenDb.csproj", + "data\\src\\repositories\\RavenDb\\AXOpen.Data.RavenDb\\AXOpen.Data.RavenDb.csproj", "probers\\src\\AXOpen.Probers\\ix_ax_axopen_probers.csproj", "utils\\src\\AXOpen.Utils\\ix_ax_axopen_utils.csproj" ] diff --git a/src/AXOpen.sln b/src/AXOpen.sln index ae63e5431..14e9f900d 100644 --- a/src/AXOpen.sln +++ b/src/AXOpen.sln @@ -128,11 +128,29 @@ 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}") = "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}") = ".config", ".config", "{2B02D701-3632-4D58-9B5B-E43D9E556ACB}" ProjectSection(SolutionItems) = preProject templates.simple\.config\dotnet-tools.json = templates.simple\.config\dotnet-tools.json EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "components.cognex.vision", "components.cognex.vision", "{31669443-69E7-4D8F-9800-E71887684792}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7A82F34B-A479-47D4-8FB6-F9A66FE6591A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{E2BFDC17-38C1-43AD-9CB5-4FA440D2DEEA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_cognex_vision", "components.cognex.vision\src\AXOpen.Cognex.Vision\ix_ax_axopen_cognex_vision.csproj", "{38B11CA7-A8CB-4B95-B123-92D3559CC1D2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "axopen_cognex_vision_blazor", "components.cognex.vision\src\AXOpen.Cognex.Vision.Blazor\axopen_cognex_vision_blazor.csproj", "{4D4B57A7-55C4-4AE2-8991-250937389412}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "axopen_cognex_vision_tests", "components.cognex.vision\tests\AXOpen.Cognex.Vision.Tests\axopen_cognex_vision_tests.csproj", "{D3094A68-880C-4637-8F90-6034951E141B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -267,6 +285,22 @@ 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 + {38B11CA7-A8CB-4B95-B123-92D3559CC1D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38B11CA7-A8CB-4B95-B123-92D3559CC1D2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38B11CA7-A8CB-4B95-B123-92D3559CC1D2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38B11CA7-A8CB-4B95-B123-92D3559CC1D2}.Release|Any CPU.Build.0 = Release|Any CPU + {4D4B57A7-55C4-4AE2-8991-250937389412}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4D4B57A7-55C4-4AE2-8991-250937389412}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4D4B57A7-55C4-4AE2-8991-250937389412}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4D4B57A7-55C4-4AE2-8991-250937389412}.Release|Any CPU.Build.0 = Release|Any CPU + {D3094A68-880C-4637-8F90-6034951E141B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3094A68-880C-4637-8F90-6034951E141B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3094A68-880C-4637-8F90-6034951E141B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3094A68-880C-4637-8F90-6034951E141B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -322,7 +356,14 @@ 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} + {5107F409-9BF4-4066-A73D-DABBCBEA096C} = {7B7AAED6-B6BF-46B5-80FF-0AE11B4D0039} + {863F8789-8441-492F-B5B1-D647B4EE370E} = {5107F409-9BF4-4066-A73D-DABBCBEA096C} {2B02D701-3632-4D58-9B5B-E43D9E556ACB} = {0F11518E-CCE1-4B0E-A56D-66D8968EC717} + {7A82F34B-A479-47D4-8FB6-F9A66FE6591A} = {31669443-69E7-4D8F-9800-E71887684792} + {E2BFDC17-38C1-43AD-9CB5-4FA440D2DEEA} = {31669443-69E7-4D8F-9800-E71887684792} + {38B11CA7-A8CB-4B95-B123-92D3559CC1D2} = {7A82F34B-A479-47D4-8FB6-F9A66FE6591A} + {4D4B57A7-55C4-4AE2-8991-250937389412} = {7A82F34B-A479-47D4-8FB6-F9A66FE6591A} + {D3094A68-880C-4637-8F90-6034951E141B} = {E2BFDC17-38C1-43AD-9CB5-4FA440D2DEEA} 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/AxoComponent_Status.st b/src/components.abstractions/ctrl/src/AxoComponent_Status.st new file mode 100644 index 000000000..0cd8382b2 --- /dev/null +++ b/src/components.abstractions/ctrl/src/AxoComponent_Status.st @@ -0,0 +1,17 @@ +USING AXOpen.Core; + +NAMESPACE AXOpen.Components.Abstractions + CLASS PUBLIC AxoComponent_Status + VAR PUBLIC + {#ix-attr:[Container(Layout.Stack)]} + {#ix-set:AttributeName = "ActionDescription: |[[1]ActionDescription]|"} + {#ix-attr:[WarningLevel(600)]} + {#ix-attr:[ErrorLevel(700)]} + Action : AXOpen.Core.AxoTextList; + {#ix-set:AttributeName = "ErrorDescription: |[[1]ErrorDescription]|"} + {#ix-attr:[WarningLevel(600)]} + {#ix-attr:[ErrorLevel(700)]} + Error : AXOpen.Core.AxoTextList; + END_VAR + END_CLASS +END_NAMESPACE \ No newline at end of file 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/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..0e53f2d24 --- /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.cognex.vision/ctrl/.gitignore b/src/components.cognex.vision/ctrl/.gitignore new file mode 100644 index 000000000..0228acd94 --- /dev/null +++ b/src/components.cognex.vision/ctrl/.gitignore @@ -0,0 +1,8 @@ +.apax +.env +bin + +obj +testresult + +*.apax.tgz diff --git a/src/components.cognex.vision/ctrl/AXSharp.config.json b/src/components.cognex.vision/ctrl/AXSharp.config.json new file mode 100644 index 000000000..655bdb431 --- /dev/null +++ b/src/components.cognex.vision/ctrl/AXSharp.config.json @@ -0,0 +1 @@ +{"OutputProjectFolder":"..\\src\\AXOpen.Cognex.Vision"} \ No newline at end of file diff --git a/src/components.cognex.vision/ctrl/apax.yml b/src/components.cognex.vision/ctrl/apax.yml new file mode 100644 index 000000000..8732ee17a --- /dev/null +++ b/src/components.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/components.cognex.vision/ctrl/package-lock.json b/src/components.cognex.vision/ctrl/package-lock.json new file mode 100644 index 000000000..a1067c7ca --- /dev/null +++ b/src/components.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/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/AxoDataman.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/AxoDataman.st new file mode 100644 index 000000000..f7759b1da --- /dev/null +++ b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/AxoDataman.st @@ -0,0 +1,418 @@ +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 + /// + /// Restores this instance. This method must be implemented in derived class. + /// + {#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 = "<#Clear result data#>"} + _clearResultDataTask : AxoDatamanClearResultData; + + + {#ix-attr:[Container(Layout.Wrap)]} + {#ix-attr:[ComponentDetails("Config")]} + Config : AxoDataman_Config; + + {#ix-attr:[Container(Layout.Wrap)]} + {#ix-attr:[ComponentDetails("Status")]} + {#ix-attr:[ReadOnly()]} + Status : AxoDataman_Status; + + {#ix-attr:[CompilerOmits()]} + 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 + Status.Action.Id := UINT#0; + Status.Error.Id := UINT#0; + + _clearResultDataTask.Restore(); + _readTask.Restore(); + + Results.Code := UINT#0; + Results.Extended := UINT#0; + Results.Id := UINT#0; + Results.Length := UINT#0; + Results.Data := ''; + + _AcquisitionControl.TriggerEnable := _ResultsStatus.ErrorDetected; + _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; + + IF NOT _ResultsStatus.ErrorDetected THEN + Status.Action.Id := UINT#300; + _restoreTask.DoneWhen(TRUE); + END_IF; + END_METHOD + + /// + /// Custom logic for the manual control. + /// + METHOD PROTECTED OVERRIDE ManualControl + ; + END_METHOD + + METHOD PRIVATE UpdateInputs : BOOL + VAR_INPUT + refAcquisitionStatus : REF_TO ARRAY[0..2] OF BYTE; + refResultsStatus : REF_TO BYTE; + refSoftEventStatus : REF_TO BYTE; + refResultData : REF_TO ARRAY[*] OF BYTE; + END_VAR + _AcquisitionStatus.TriggerReady := refAcquisitionStatus^[0].%X0; + _AcquisitionStatus.TriggerAcknowledge := refAcquisitionStatus^[0].%X1; + _AcquisitionStatus.MissedAcquisition := refAcquisitionStatus^[0].%X3; + _AcquisitionStatus.TriggerID.%B1 := refAcquisitionStatus^[1]; + _AcquisitionStatus.TriggerID.%B0 := refAcquisitionStatus^[2]; + + _ResultsStatus.Decoding := refResultsStatus^.%X0; + _ResultsStatus.DecodeComplete := refResultsStatus^.%X1; + _ResultsStatus.ResultsBufferOverrun := refResultsStatus^.%X2; + _ResultsStatus.ResultsAvailable := refResultsStatus^.%X3; + _ResultsStatus.ErrorDetected := refResultsStatus^.%X7; + + _SoftEventStatus.TrainCodeAcknowledge := refSoftEventStatus^.%X0; + _SoftEventStatus.TrainMatchStringAcknowledge := refSoftEventStatus^.%X1; + _SoftEventStatus.TrainFocusAcknowledge := refSoftEventStatus^.%X2; + _SoftEventStatus.TrainBrightnessAcknowledge := refSoftEventStatus^.%X3; + _SoftEventStatus.UntrainAcknowledge := refSoftEventStatus^.%X4; + _SoftEventStatus.ExecuteDmccAcknowledge := refSoftEventStatus^.%X5; + _SoftEventStatus.Reserved06 := refSoftEventStatus^.%X6; + _SoftEventStatus.SetMatchStringAcknowledge := refSoftEventStatus^.%X7; + + + IF (LOWER_BOUND(refResultData^,1) = 0) THEN + IF (UPPER_BOUND(refResultData^,1) = 23) THEN + Status.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_16B; + ELSIF (UPPER_BOUND(refResultData^,1) = 39) THEN + Status.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_32B; + ELSIF (UPPER_BOUND(refResultData^,1) = 71) THEN + Status.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_64B; + ELSIF (UPPER_BOUND(refResultData^,1) = 135) THEN + Status.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_128B; + ELSIF (UPPER_BOUND(refResultData^,1) = 253) THEN + Status.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_246B; + ELSE + Status.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_SIZE_INVALID; + Status.Error.Id := UINT#708; + UpdateInputs := FALSE; + END_IF; + ELSE + Status.Error.Id := UINT#709; + UpdateInputs := FALSE; + Status.ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_SIZE_INVALID; + END_IF; + + IF(Status.ResultDataSize <> eAxoDataman_ResultDataSize#RESULT_DATA_SIZE_INVALID) THEN + Results.Id.%B1 := refResultData^[0]; + Results.Id.%B0 := refResultData^[1]; + Results.Code.%B1 := refResultData^[2]; + Results.Code.%B0 := refResultData^[3]; + Results.Extended.%B1 := refResultData^[4]; + Results.Extended.%B0 := refResultData^[5]; + Results.Length.%B1 := refResultData^[6]; + Results.Length.%B0 := refResultData^[7]; + UpdateInputs := TRUE; + END_IF; + + END_METHOD + + METHOD PRIVATE UpdateOutputs : BOOL + VAR_INPUT + refAcquisitionControl : REF_TO BYTE; + refResultsControl : REF_TO BYTE; + refSoftEventControl : REF_TO BYTE; + refUserData : REF_TO ARRAY[*] OF BYTE; + END_VAR + + refAcquisitionControl^.%X0 := _AcquisitionControl.TriggerEnable; + refAcquisitionControl^.%X1 := _AcquisitionControl.Trigger; + + refResultsControl^.%X0 := _ResultsControl.EnableResultBuffering; + refResultsControl^.%X1 := _ResultsControl.ResultsAcknowledge; + + refSoftEventControl^.%X0 := _SoftEventControl.TrainCode; + refSoftEventControl^.%X1 := _SoftEventControl.TrainMatchString; + refSoftEventControl^.%X2 := _SoftEventControl.TrainFocus; + refSoftEventControl^.%X3 := _SoftEventControl.TrainBrightness; + refSoftEventControl^.%X4 := _SoftEventControl.Untrain; + refSoftEventControl^.%X5 := _SoftEventControl.ExecuteDMCC; + refSoftEventControl^.%X6 := _SoftEventControl.Reserved06; + refSoftEventControl^.%X7 := _SoftEventControl.SetMatchString; + + IF (LOWER_BOUND(refUserData^,1) = 0) THEN + IF (UPPER_BOUND(refUserData^,1) = 19) THEN + Status.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_16B; + ELSIF (UPPER_BOUND(refUserData^,1) = 35) THEN + Status.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_32B; + ELSIF (UPPER_BOUND(refUserData^,1) = 67) THEN + Status.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_64B; + ELSIF (UPPER_BOUND(refUserData^,1) = 131) THEN + Status.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_128B; + ELSIF (UPPER_BOUND(refUserData^,1) = 253) THEN + Status.UserDataSize := eAxoDataman_UserDataSize#USER_DATA_250B; + ELSE + Status.Error.Id := UINT#710; + UpdateOutputs := FALSE; + END_IF; + ELSE + Status.Error.Id := UINT#711; + UpdateOutputs := FALSE; + END_IF; + + IF(Status.UserDataSize <> eAxoDataman_UserDataSize#USER_DATA_SIZE_INVALID) THEN + refUserData^[0] := User.Option.%B1; + refUserData^[1] := User.Option.%B0; + refUserData^[2] := User.Length.%B1; + refUserData^[3] := User.Length.%B0; + UpdateOutputs := TRUE; + END_IF; + END_METHOD + + METHOD PRIVATE IsValidReferences: BOOL + VAR_INPUT + refAcquisitionControl : REF_TO BYTE; + refAcquisitionStatus : REF_TO ARRAY[0..2] OF BYTE; + refResultsControl : REF_TO BYTE; + refResultsStatus : REF_TO BYTE; + refSoftEventControl : REF_TO BYTE; + refSoftEventStatus : REF_TO BYTE; + refResultData : REF_TO ARRAY[*] OF BYTE; + refUserData : REF_TO ARRAY[*] OF BYTE; + END_VAR + IsValidReferences := FALSE; + IF refAcquisitionControl = NULL THEN + Status.Error.Id := UINT#701; + ELSIF refAcquisitionStatus = NULL THEN + Status.Error.Id := UINT#702; + ELSIF refResultsControl = NULL THEN + Status.Error.Id := UINT#703; + ELSIF refSoftEventControl = NULL THEN + Status.Error.Id := UINT#704; + ELSIF refSoftEventStatus = NULL THEN + Status.Error.Id := UINT#705; + ELSIF refResultData = NULL THEN + Status.Error.Id := UINT#706; + ELSIF refUserData = NULL THEN + Status.Error.Id := UINT#707; + ELSE + IsValidReferences := TRUE; + END_IF; + END_METHOD + + METHOD PRIVATE ContinuousReading + VAR_INPUT + refStatus : REF_TO AxoDataman_Status; + refResults : REF_TO AxoDataman_Results; + refResultData : REF_TO ARRAY[*] OF BYTE; + END_VAR + + IF _ResultsStatus.ResultsAvailable AND NOT _ResultsControl.ResultsAcknowledge AND Results.Code > UINT#0 AND Results.Length > UINT#0 THEN + IF refResults^.Length > TO_UINT(refStatus^.ResultDataSize) THEN + Status.Action.Id := UINT#701; + Status.Error.Id := UINT#712; + ELSE + System.SerDe.Deserialize(UINT#7, refResultData^, refResults^.Data); + Status.Action.Id := UINT#307; + END_IF; + END_IF; + + _ResultsControl.ResultsAcknowledge := _ResultsStatus.ResultsAvailable; + END_METHOD + + METHOD PROTECTED OVERRIDE Open + SUPER.Open(); + END_METHOD + + METHOD PUBLIC Run + VAR_INPUT + parent : IAxoObject; + refAcquisitionControl : REF_TO BYTE; + refAcquisitionStatus : REF_TO ARRAY[0..2] OF BYTE; + refResultsControl : REF_TO BYTE; + refResultsStatus : REF_TO BYTE; + refSoftEventControl : REF_TO BYTE; + refSoftEventStatus : REF_TO BYTE; + refResultData : REF_TO ARRAY[*] OF BYTE; + refUserData : REF_TO ARRAY[*] OF BYTE; + END_VAR + IF parent = NULL THEN + Status.Error.Id := UINT#700; + RETURN; + END_IF; + IF NOT THIS.IsValidReferences(refAcquisitionControl,refAcquisitionStatus,refResultsControl,refResultsStatus,refSoftEventControl,refSoftEventStatus,refResultData,refUserData) THEN + RETURN; + END_IF; + THIS.Initialize(parent); + THIS.Open(); + THIS.Execute(refAcquisitionControl,refAcquisitionStatus,refResultsControl,refResultsStatus,refSoftEventControl,refSoftEventStatus,refResultData,refUserData); + THIS.Close(); + END_METHOD + + METHOD PUBLIC Run + VAR_INPUT + parent : IAxoContext; + refAcquisitionControl : REF_TO BYTE; + refAcquisitionStatus : REF_TO ARRAY[0..2] OF BYTE; + refResultsControl : REF_TO BYTE; + refResultsStatus : REF_TO BYTE; + refSoftEventControl : REF_TO BYTE; + refSoftEventStatus : REF_TO BYTE; + refResultData : REF_TO ARRAY[*] OF BYTE; + refUserData : REF_TO ARRAY[*] OF BYTE; + END_VAR + IF parent = NULL THEN + Status.Error.Id := UINT#700; + RETURN; + END_IF; + IF NOT THIS.IsValidReferences(refAcquisitionControl,refAcquisitionStatus,refResultsControl,refResultsStatus,refSoftEventControl,refSoftEventStatus,refResultData,refUserData) THEN + RETURN; + END_IF; + THIS.Initialize(parent); + THIS.Open(); + THIS.Execute(refAcquisitionControl,refAcquisitionStatus,refResultsControl,refResultsStatus,refSoftEventControl,refSoftEventStatus,refResultData,refUserData); + THIS.Close(); + END_METHOD + + METHOD PRIVATE Execute + VAR_INPUT + refAcquisitionControl : REF_TO BYTE; + refAcquisitionStatus : REF_TO ARRAY[0..2] OF BYTE; + refResultsControl : REF_TO BYTE; + refResultsStatus : REF_TO BYTE; + refSoftEventControl : REF_TO BYTE; + refSoftEventStatus : REF_TO BYTE; + refResultData : REF_TO ARRAY[*] OF BYTE; + refUserData : REF_TO ARRAY[*] OF BYTE; + END_VAR + + _restoreTask.Initialize(THIS); + _clearResultDataTask.Initialize(THIS); + _readTask.Initialize(THIS); + + THIS.UpdateInputs(refAcquisitionStatus,refResultsStatus,refSoftEventStatus,refResultData); + THIS.UpdateSignalStates(); + + IF Config.ContinuousReading THEN + THIS.ContinuousReading(REF(Status), REF(Results),refResultData); + END_IF; + + //*************RESTORE******************** + _taskDisabled := FALSE; + _restoreTask.IsDisabled := _taskDisabled; + IF _restoreTask.Execute() THEN + THIS.Restore(); + END_IF; + //**************************************** + + //*************CLEAR*DATA***************** + _taskDisabled := _taskDisabled OR _restoreTask.IsBusy(); + _clearResultDataTask.IsDisabled := _taskDisabled; + _clearResultDataTask.Run(REF(_AcquisitionControl),REF(_AcquisitionStatus),REF(_ResultsControl),REF(_ResultsStatus),REF(Config),REF(Status),REF(Results)); + //**************************************** + + + //*************READ*********************** + _taskDisabled := _taskDisabled OR _clearResultDataTask.IsBusy(); + _readTask.IsDisabled := _taskDisabled; + _readTask.Run(REF(_AcquisitionControl),REF(_AcquisitionStatus),REF(_ResultsControl),REF(_ResultsStatus),REF(Config),REF(Status),REF(Results),refResultData); + //**************************************** + + THIS.UpdateOutputs(refAcquisitionControl,refResultsControl,refSoftEventControl,refUserData); + END_METHOD + + METHOD PROTECTED OVERRIDE Close + SUPER.Close(); + END_METHOD + /// + /// Clears the result data. + /// + METHOD PUBLIC ClearResultData : IAxoTaskState + ClearResultData :=_clearResultDataTask.Invoke();; + END_METHOD + /// + /// Triggers the reading sequence and waits for results. + /// + 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; + + END_METHOD + END_CLASS + +END_NAMESPACE \ No newline at end of file diff --git a/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanClearResultData.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanClearResultData.st new file mode 100644 index 000000000..687210fd8 --- /dev/null +++ b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanClearResultData.st @@ -0,0 +1,122 @@ +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; + END_VAR + + VAR PRIVATE + _infoTime : LTIME := LT#2S; + _errorTime : LTIME := LT#5S; + _Status : REF_TO AxoDataman_Status; + END_VAR + + METHOD PUBLIC Run + VAR_INPUT + refAcquisitionControl : REF_TO AxoDataman_AcquisitionControl; + refAcquisitionStatus : REF_TO AxoDataman_AcquisitionStatus; + refResultsControl : REF_TO AxoDataman_ResultsControl; + refResultsStatus : REF_TO AxoDataman_ResultsStatus; + refConfig : REF_TO AxoDataman_Config; + refStatus : REF_TO AxoDataman_Status; + refResults : REF_TO AxoDataman_Results; + refResultData : REF_TO ARRAY[*] OF BYTE; + END_VAR + + VAR + _index : INT; + END_VAR + + _infoTime := refConfig^.InfoTime; + _errorTime := refConfig^.ErrorTime; + _Status := refStatus; + IF THIS.Execute() THEN + IF _progress = 0 THEN + refStatus^.Action.Id := UINT#302; + refStatus^.Error.Id := UINT#0; + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + + IF _progress = 1 THEN + refAcquisitionControl^.TriggerEnable := FALSE; + refAcquisitionControl^.Trigger := FALSE; + refResultsControl^.ResultsAcknowledge := TRUE; + refResults^.Id := UINT#0; + refResults^.Code := UINT#0; + refResults^.Extended := UINT#0; + refResults^.Length := UINT#0; + + refResults^.Data := ''; + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + + IF _progress = 2 THEN + IF _infoTimer.output THEN + refStatus^.Error.Id := UINT#600; + END_IF; + IF NOT refResultsStatus^.ResultsAvailable THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 3 THEN + refResultsControl^.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 + _Status^.Action.Id := UINT#308; + _Status^.Error.Id := UINT#0; + _progress := 0; + THIS.CallTimers(FALSE); + END_METHOD + + METHOD PROTECTED OVERRIDE OnAbort + IF _Status <> NULL THEN + _Status^.Action.Id := UINT#600; + END_IF; + END_METHOD + + METHOD PROTECTED OVERRIDE OnDone + IF _Status <> NULL THEN + _Status^.Action.Id := UINT#303; + END_IF; + END_METHOD + + METHOD PROTECTED OVERRIDE OnError + IF _Status <> NULL THEN + _Status^.Action.Id := UINT#700; + END_IF; + END_METHOD + + METHOD PROTECTED OVERRIDE OnStart + IF _Status <> NULL THEN + _Status^.Action.Id := UINT#301; + END_IF; + END_METHOD + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanRead.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanRead.st new file mode 100644 index 000000000..5e8822f9e --- /dev/null +++ b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/Tasks/AxoDatamanRead.st @@ -0,0 +1,188 @@ +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; + END_VAR + + VAR PRIVATE + _infoTime : LTIME := LT#2S; + _errorTime : LTIME := LT#5S; + _Status : REF_TO AxoDataman_Status; + END_VAR + + METHOD PUBLIC Run + VAR_INPUT + refAcquisitionControl : REF_TO AxoDataman_AcquisitionControl; + refAcquisitionStatus : REF_TO AxoDataman_AcquisitionStatus; + refResultsControl : REF_TO AxoDataman_ResultsControl; + refResultsStatus : REF_TO AxoDataman_ResultsStatus; + refConfig : REF_TO AxoDataman_Config; + refStatus : REF_TO AxoDataman_Status; + refResults : REF_TO AxoDataman_Results; + refResultData : REF_TO ARRAY[*] OF BYTE; + END_VAR + + VAR + _index : INT; + END_VAR + + _infoTime := refConfig^.InfoTime; + _errorTime := refConfig^.ErrorTime; + _Status := refStatus; + + IF THIS.Execute() THEN + IF _progress = 0 THEN + refStatus^.Action.Id := UINT#305; + refStatus^.Error.Id := UINT#0; + THIS.CallTimers(FALSE); + IF refResultsStatus^.ErrorDetected THEN + _progress := 20; + ELSE + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 1 THEN + refAcquisitionControl^.TriggerEnable := TRUE; + refAcquisitionControl^.Trigger := FALSE; + refResultsControl^.EnableResultBuffering := FALSE; + refResultsControl^.ResultsAcknowledge := refResultsStatus^.ResultsAvailable; + IF _infoTimer.output THEN + refStatus^.Error.Id := UINT#600; + END_IF; + IF NOT refResultsStatus^.ResultsAvailable THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 2 THEN + IF _infoTimer.output THEN + refStatus^.Error.Id := UINT#601; + END_IF; + IF refAcquisitionStatus^.TriggerReady THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 3 THEN + refAcquisitionControl^.Trigger := TRUE; + IF _infoTimer.output THEN + refStatus^.Error.Id := UINT#602; + END_IF; + IF refAcquisitionStatus^.TriggerAcknowledge THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 4 THEN + IF _infoTimer.output THEN + refStatus^.Error.Id := UINT#603; + END_IF; + IF refResultsStatus^.ResultsAvailable THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 5 THEN + IF refResults^.Code = UINT#0 OR refResults^.Length=UINT#0 OR refResults^.Length > TO_UINT(refStatus^.ResultDataSize) THEN + THIS.ThrowWhen(TRUE); + IF refResults^.Length > TO_UINT(refStatus^.ResultDataSize) THEN + refStatus^.Error.Id := UINT#712; + END_IF; + ELSE + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 6 THEN + System.SerDe.Deserialize(UINT#7, refResultData^, refResults^.Data); + refAcquisitionControl^.Trigger := FALSE; + refResultsControl^.EnableResultBuffering := FALSE; + refResultsControl^.ResultsAcknowledge := TRUE; + THIS.DoneWhen(TRUE); + _progress := 0; + END_IF; + + IF _progress = 20 THEN + refAcquisitionControl^.TriggerEnable :=FALSE; + refAcquisitionControl^.Trigger := FALSE; + refResultsControl^.EnableResultBuffering := FALSE; + refResultsControl^.ResultsAcknowledge := FALSE; + IF NOT refAcquisitionStatus^.TriggerReady THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 21 THEN + refAcquisitionControl^.TriggerEnable :=TRUE; + IF NOT refResultsStatus^.ErrorDetected THEN + THIS.CallTimers(FALSE); + _progress := _progress + 1; + END_IF; + END_IF; + + IF _progress = 22 THEN + refAcquisitionControl^.TriggerEnable :=FALSE; + IF _infoTimer.elapsedTime >= T#1s THEN + THIS.CallTimers(FALSE); + _progress := 1; + END_IF; + 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 + _Status^.Action.Id := UINT#309; + _Status^.Error.Id := UINT#0; + _progress := 0; + THIS.CallTimers(FALSE); + END_METHOD + + METHOD PROTECTED OVERRIDE OnAbort + IF _Status <> NULL THEN + _Status^.Action.Id := UINT#601; + END_IF; + END_METHOD + + METHOD PROTECTED OVERRIDE OnDone + IF _Status <> NULL THEN + _Status^.Action.Id := UINT#306; + END_IF; + END_METHOD + + METHOD PROTECTED OVERRIDE OnError + IF _Status <> NULL THEN + _Status^.Action.Id := UINT#701; + END_IF; + END_METHOD + + METHOD PROTECTED OVERRIDE OnStart + IF _Status <> NULL THEN + _Status^.Action.Id := UINT#304; + END_IF; + END_METHOD + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionControl.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionControl.st new file mode 100644 index 000000000..c7180e31b --- /dev/null +++ b/src/components.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/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionStatus.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_AcquisitionStatus.st new file mode 100644 index 000000000..1ff1ae920 --- /dev/null +++ b/src/components.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/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Config.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Config.st new file mode 100644 index 000000000..65bdcbeea --- /dev/null +++ b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Config.st @@ -0,0 +1,11 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + {#ix-attr:[Container(Layout.Stack)]} + AxoDataman_Config : + STRUCT + 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/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Results.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Results.st new file mode 100644 index 000000000..2f0ce7ff7 --- /dev/null +++ b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Results.st @@ -0,0 +1,16 @@ +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + TYPE + AxoDataman_Results : + STRUCT + {#ix-attr:[CompilerOmits()]} + Id: UINT; + {#ix-attr:[CompilerOmits()]} + Code: UINT; + {#ix-attr:[CompilerOmits()]} + Extended: UINT; + {#ix-attr:[CompilerOmits()]} + Length : UINT; + Data : STRING[246]; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsControl.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsControl.st new file mode 100644 index 000000000..2b80b85f2 --- /dev/null +++ b/src/components.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/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsStatus.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_ResultsStatus.st new file mode 100644 index 000000000..f31c43954 --- /dev/null +++ b/src/components.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/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SignalStates.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SignalStates.st new file mode 100644 index 000000000..d8da1286a --- /dev/null +++ b/src/components.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 + {#ix-set:AttributeName = "<#Signal states#>"} + {#ix-attr:[Container(Layout.Wrap)]} + AxoDataman_SignalStates : + STRUCT + {#ix-set:AttributeName = "<#Trigger enable#>"} + TriggerEnable : BOOL; + {#ix-set:AttributeName = "<#Trigger#>"} + Trigger : BOOL; + + {#ix-set:AttributeName = "<#Enable result buffering#>"} + EnableResultBuffering : BOOL; + {#ix-set:AttributeName = "<#Result acknowledge#>"} + ResultsAcknowledge : BOOL; + + {#ix-set:AttributeName = "<#Trigger ready#>"} + TriggerReady : BOOL; + {#ix-set:AttributeName = "<#Trigger acknowledge#>"} + TriggerAcknowledge : BOOL; + {#ix-set:AttributeName = "<#Acquiring#>"} + Acquiring : BOOL; + {#ix-set:AttributeName = "<#Missed acquisition#>"} + MissedAcquisition : BOOL; + {#ix-set:AttributeName = "<#Trigger ID#>"} + TriggerID : UINT; + + {#ix-set:AttributeName = "<#Decoding#>"} + Decoding : BOOL; + {#ix-set:AttributeName = "<#Decode complete#>"} + DecodeComplete : BOOL; + {#ix-set:AttributeName = "<#Result buffer overrun#>"} + ResultsBufferOverrun : BOOL; + {#ix-set:AttributeName = "<#Results available#>"} + ResultsAvailable : BOOL; + {#ix-set:AttributeName = "<#Error detected#>"} + ErrorDetected : BOOL; + + {#ix-set:AttributeName = "<#Result ID#>"} + ResultID : UINT; + {#ix-set:AttributeName = "<#Result code#>"} + ResultCode : UINT; + {#ix-set:AttributeName = "<#Result extended#>"} + ResultExtended : UINT; + {#ix-set:AttributeName = "<#Result length#>"} + ResultLength : UINT; + END_STRUCT; + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventControl.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventControl.st new file mode 100644 index 000000000..d987ac64d --- /dev/null +++ b/src/components.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/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventStatus.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_SoftEventStatus.st new file mode 100644 index 000000000..2d8e3a7bd --- /dev/null +++ b/src/components.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/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Status.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Status.st new file mode 100644 index 000000000..fe5aad461 --- /dev/null +++ b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_Status.st @@ -0,0 +1,12 @@ +USING AXOpen.Core; +NAMESPACE AXOpen.Cognex.Vision.v_6_0_0_0 + {#ix-attr:[Container(Layout.Stack)]} + CLASS AxoDataman_Status EXTENDS AXOpen.Components.Abstractions.AxoComponent_Status + VAR PUBLIC + SignalStatus : AxoDataman_SignalStates; + ResultDataSize : eAxoDataman_ResultDataSize := eAxoDataman_ResultDataSize#RESULT_DATA_SIZE_INVALID; + {#ix-attr:[CompilerOmits()]} + UserDataSize : eAxoDataman_UserDataSize := eAxoDataman_UserDataSize#USER_DATA_SIZE_INVALID; + END_VAR + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_User.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/AxoDataman_User.st new file mode 100644 index 000000000..1a9480698 --- /dev/null +++ b/src/components.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/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_ResultDataSize.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_ResultDataSize.st new file mode 100644 index 000000000..4488150e5 --- /dev/null +++ b/src/components.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/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_UserDataSize.st b/src/components.cognex.vision/ctrl/src/AxoDataman/v_6_0_0/TypeStructuresAndEnums/eAxoDataman_UserDataSize.st new file mode 100644 index 000000000..5bb8a9b56 --- /dev/null +++ b/src/components.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/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/Properties/AssemblyInfo.cs b/src/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..7fc953296 --- /dev/null +++ b/src/components.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/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/_Imports.razor b/src/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/_Imports.razor new file mode 100644 index 000000000..9ec08f956 --- /dev/null +++ b/src/components.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/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/axopen_cognex_vision_blazor.csproj b/src/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/axopen_cognex_vision_blazor.csproj new file mode 100644 index 000000000..7e660039f --- /dev/null +++ b/src/components.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/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/package-lock.json b/src/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/package-lock.json new file mode 100644 index 000000000..a1067c7ca --- /dev/null +++ b/src/components.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/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/wwwroot/background.png b/src/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/wwwroot/background.png new file mode 100644 index 000000000..e15a3bde6 Binary files /dev/null and b/src/components.cognex.vision/src/AXOpen.Cognex.Vision.Blazor/wwwroot/background.png differ diff --git a/src/components.cognex.vision/src/AXOpen.Cognex.Vision/AxoDataman/v_6_0_0/AxoDataman.cs b/src/components.cognex.vision/src/AXOpen.Cognex.Vision/AxoDataman/v_6_0_0/AxoDataman.cs new file mode 100644 index 000000000..bc5a17301 --- /dev/null +++ b/src/components.cognex.vision/src/AXOpen.Cognex.Vision/AxoDataman/v_6_0_0/AxoDataman.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using AXOpen.Components.Abstractions; +namespace AXOpen.Cognex.Vision.v_6_0_0_0 +{ + public partial class AxoDataman + { + } + + public partial class AxoDataman_Status : AxoComponent_Status + { + Dictionary errorDescriptionDict = new Dictionary(); + Dictionary actionDescriptionDict = new Dictionary(); + + public string ErrorDescription + { + get + { + if(errorDescriptionDict == null) { errorDescriptionDict = new Dictionary(); } + if(errorDescriptionDict.Count == 0) + { + errorDescriptionDict.Add(0 , " "); + errorDescriptionDict.Add(600, "Waiting for the signal ResultsAvailable to be reseted!"); + errorDescriptionDict.Add(601, "Waiting for the signal TriggerReady to be set!"); + errorDescriptionDict.Add(602, "Waiting for the signal TriggerAcknowledge to be set!"); + errorDescriptionDict.Add(603, "Waiting for the signal ResultsAvailable to be set!"); + + + errorDescriptionDict.Add(700 ,"Error: Parent has NULL reference!"); + errorDescriptionDict.Add(701 ,"Error: AcquisitionControl has NULL reference!"); + errorDescriptionDict.Add(702 ,"Error: AcquisitionStatus has NULL reference!"); + errorDescriptionDict.Add(703 ,"Error: ResultsControl has NULL reference!"); + errorDescriptionDict.Add(704 ,"Error: SoftEventControl has NULL reference!"); + errorDescriptionDict.Add(705 ,"Error: SoftEventStatus has NULL reference!"); + errorDescriptionDict.Add(706 ,"Error: ResultData has NULL reference!"); + errorDescriptionDict.Add(707 ,"Error: UserData has NULL reference!"); + errorDescriptionDict.Add(708 ,"Error: ResultData has invalid size!"); + errorDescriptionDict.Add(709 ,"Error: ResultData-lower bound index is not zero!"); + errorDescriptionDict.Add(710 ,"Error: UserData has invalid size!"); + errorDescriptionDict.Add(711 ,"Error: UserData-lower bound index is not zero!"); + errorDescriptionDict.Add(712 ,"Error: The ResultData length exceeds the configured hardware structure's length!"); + + } + string errorDescription = " "; + if (errorDescriptionDict.TryGetValue(Error.Id.LastValue, out errorDescription)) + { + return errorDescription; + } + else + + { + return " "; + } + } + } + + public string ActionDescription + { + get + { + if (actionDescriptionDict == null) { actionDescriptionDict = new Dictionary(); } + if (actionDescriptionDict.Count == 0) + { + actionDescriptionDict.Add(0, " "); + actionDescriptionDict.Add(300, "Restore executed."); + actionDescriptionDict.Add(301, "Clearing of the result data started."); + actionDescriptionDict.Add(302, "Clearing of the result data running."); + actionDescriptionDict.Add(303, "Clearing of the result data was completed successfully."); + actionDescriptionDict.Add(304, "Reading started."); + actionDescriptionDict.Add(305, "Reading running."); + actionDescriptionDict.Add(306, "Reading was completed successfully."); + actionDescriptionDict.Add(307, "Continous reading active: New data read."); + actionDescriptionDict.Add(308, "Clearing of the result data restored."); + actionDescriptionDict.Add(309, "Reading restored."); + + + actionDescriptionDict.Add(600 ,"Clearing of the result data was aborted, while not yet completed!"); + actionDescriptionDict.Add(601 ,"Reading was aborted, while not yet completed!"); + + actionDescriptionDict.Add(700 ,"Clearing of the result data finished with error!"); + actionDescriptionDict.Add(701 ,"Reading finished with error!"); + + } + string actionDescription = " "; + if(actionDescriptionDict.TryGetValue(Action.Id.LastValue, out actionDescription)) + { + return actionDescription; + } + else + { + return " "; + } + + } + } + } +} diff --git a/src/components.cognex.vision/src/AXOpen.Cognex.Vision/Properties/AssemblyInfo.cs b/src/components.cognex.vision/src/AXOpen.Cognex.Vision/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..cb7f895ae --- /dev/null +++ b/src/components.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/components.cognex.vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.Designer.cs b/src/components.cognex.vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.Designer.cs new file mode 100644 index 000000000..53c5e8fe4 --- /dev/null +++ b/src/components.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/components.cognex.vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.resx b/src/components.cognex.vision/src/AXOpen.Cognex.Vision/Resources/PlcStringResources.resx new file mode 100644 index 000000000..0182b2b53 --- /dev/null +++ b/src/components.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/components.cognex.vision/src/AXOpen.Cognex.Vision/ix_ax_axopen_cognex_vision.csproj b/src/components.cognex.vision/src/AXOpen.Cognex.Vision/ix_ax_axopen_cognex_vision.csproj new file mode 100644 index 000000000..d45d802c3 --- /dev/null +++ b/src/components.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/components.cognex.vision/tests/AXOpen.Cognex.Vision.Tests/Usings.cs b/src/components.cognex.vision/tests/AXOpen.Cognex.Vision.Tests/Usings.cs new file mode 100644 index 000000000..8c927eb74 --- /dev/null +++ b/src/components.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/components.cognex.vision/tests/AXOpen.Cognex.Vision.Tests/axopen_cognex_vision_tests.csproj b/src/components.cognex.vision/tests/AXOpen.Cognex.Vision.Tests/axopen_cognex_vision_tests.csproj new file mode 100644 index 000000000..abb040de7 --- /dev/null +++ b/src/components.cognex.vision/tests/AXOpen.Cognex.Vision.Tests/axopen_cognex_vision_tests.csproj @@ -0,0 +1,254 @@ + + + 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.cognex.vision/tests/AXOpen.Cognex.Vision.Tests/xunit.runner.json b/src/components.cognex.vision/tests/AXOpen.Cognex.Vision.Tests/xunit.runner.json new file mode 100644 index 000000000..7c6944a1d --- /dev/null +++ b/src/components.cognex.vision/tests/AXOpen.Cognex.Vision.Tests/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "parallelizeTestCollections": false, + "maxParallelThreads": -1 +} diff --git a/src/core/ctrl/src/AxoComponent/AxoComponent.st b/src/core/ctrl/src/AxoComponent/AxoComponent.st index 95ae5ea73..30ccd249a 100644 --- a/src/core/ctrl/src/AxoComponent/AxoComponent.st +++ b/src/core/ctrl/src/AxoComponent/AxoComponent.st @@ -40,8 +40,8 @@ NAMESPACE AXOpen.Core END_VAR VAR PUBLIC - {attribute addProperty Name "<#Is manually controllable#>"} - {attribute clr [ReadOnly()]} + {#ix-set:AttributeName = "<#Is manually controllable#>"} + {#ix-attr:[ReadOnly()]} _isManuallyControllable : BOOL; END_VAR diff --git a/src/core/ctrl/src/AxoTextList/AxoTextList.st b/src/core/ctrl/src/AxoTextList/AxoTextList.st new file mode 100644 index 000000000..8a8fc393e --- /dev/null +++ b/src/core/ctrl/src/AxoTextList/AxoTextList.st @@ -0,0 +1,7 @@ +NAMESPACE AXOpen.Core + CLASS PUBLIC AxoTextList + VAR PUBLIC + Id : UINT; + END_VAR + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor index 0273a4fcd..8c793db52 100644 --- a/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor +++ b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor @@ -20,36 +20,37 @@
@if (@Component._isManuallyControllable.Cyclic) { - + currentPresentation = "Command-Control"; } else { - + currentPresentation = "Status-Display"; } +
@if (containsDetailsAttribute) {
- - @foreach (var detailsTab in DetailsTabs) - { - - + @foreach (var detailsTab in DetailsTabs) + { + + - - } - + + } + + }
} diff --git a/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor.cs b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor.cs index 965f7fd7f..0a8c671b4 100644 --- a/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor.cs +++ b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor.cs @@ -15,6 +15,15 @@ public partial class AxoComponentView : IDisposable [Parameter] public bool IsControllable { get; set; } + public override void AddToPolling(ITwinElement element, int pollingInterval = 250) + { + if (element is AxoComponent axoComponent) + { + axoComponent._isManuallyControllable.StartPolling(pollingInterval, this); + PolledElements.Add(axoComponent._isManuallyControllable); + } + } + private IEnumerable GetAllTabNames(ITwinObject twinObject) { return twinObject.GetKids().Where(p => p.GetAttribute() != null) diff --git a/src/core/src/AXOpen.Core.Blazor/AxoTextList/AxoTextListView.razor b/src/core/src/AXOpen.Core.Blazor/AxoTextList/AxoTextListView.razor new file mode 100644 index 000000000..bd35b1199 --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/AxoTextList/AxoTextListView.razor @@ -0,0 +1,11 @@ +@namespace AXOpen.Core +@using AXSharp.Connector; +@using Microsoft.AspNetCore.Components.Authorization +@inherits RenderableComplexComponentBase +@implements IDisposable; + +
+
+ @_text +
+
\ No newline at end of file diff --git a/src/core/src/AXOpen.Core.Blazor/AxoTextList/AxoTextListView.razor.cs b/src/core/src/AXOpen.Core.Blazor/AxoTextList/AxoTextListView.razor.cs new file mode 100644 index 000000000..5c3b41e32 --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/AxoTextList/AxoTextListView.razor.cs @@ -0,0 +1,66 @@ +using AXSharp.Connector; + +namespace AXOpen.Core +{ + public partial class AxoTextListView : IDisposable + { + private uint _warningLevel => this.Component.GetAttribute() != null ? this.Component.GetAttribute().Level : 0; + private uint _errorLevel => this.Component.GetAttribute() != null ? this.Component.GetAttribute().Level : 0; + + private string _cardClass + { + get + { + if(_warningLevel>0 && _errorLevel > _warningLevel) + { + if (Component.Id.Cyclic < _warningLevel) + return "card bg-primary text-light mb-1"; + else if (Component.Id.Cyclic >= _errorLevel) + return "card bg-danger text-white mb-1"; + else + return "card bg-warning text-black mb-1"; + } + else + return "card bg-primary text-light mb-1"; + + + } + } + + protected override void OnInitialized() + { + base.OnInitialized(); + UpdateValuesOnChange(Component); + } + + private string _text => string.IsNullOrEmpty(Component.AttributeName) ? Component.GetSymbolTail() : Component.AttributeName; + + + } + + public class AxoTextListCommandView : AxoTextListView + { + public AxoTextListCommandView() + { + } + } + public class AxoTextListControlView : AxoTextListView + { + public AxoTextListControlView() + { + } + } + + public class AxoTextListStatusView : AxoTextListView + { + public AxoTextListStatusView() + { + } + } + public class AxoTextListDisplayView : AxoTextListView + { + public AxoTextListDisplayView() + { + } + } +} diff --git a/src/core/src/AXOpen.Core/AxoTextList/AxoTextList.cs b/src/core/src/AXOpen.Core/AxoTextList/AxoTextList.cs new file mode 100644 index 000000000..91b0672cf --- /dev/null +++ b/src/core/src/AXOpen.Core/AxoTextList/AxoTextList.cs @@ -0,0 +1,35 @@ +using System; + +namespace AXOpen.Core +{ + public partial class AxoTextList + { + + } + public class WarningLevelAttribute : Attribute + { + public WarningLevelAttribute() + { + } + public WarningLevelAttribute(uint level) + { + Level = level; + } + + public uint Level { get; } + } + + public class ErrorLevelAttribute : Attribute + { + public ErrorLevelAttribute() + { + } + public ErrorLevelAttribute(uint level) + { + Level = level; + } + + public uint Level { get; } + } + +} diff --git a/src/integrations/ctrl/apax.yml b/src/integrations/ctrl/apax.yml index 35481d816..28a1edf14 100644 --- a/src/integrations/ctrl/apax.yml +++ b/src/integrations/ctrl/apax.yml @@ -1,10 +1,6 @@ name: "axopen.integrations" version: '0.1.4-alpha.79' type: app -targets: - - "1500" - - plcsim - - axunit-llvm devDependencies: "@ax/sdk": ^4.0.3 "@ax/sld": ^0.15.9 @@ -12,17 +8,16 @@ 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.cognex.vision": '0.1.4-alpha.79' + "@ax/system-serde": ^2.0.2 variables: - APAX_BUILD_ARGS: [ -d ] - + APAX_BUILD_ARGS: [-d] scripts: ixc: - dotnet tool restore - dotnet ixc download: - - apax sld --accept-security-disclaimer -t $AXTARGET -i - $AXTARGETPLATFORMINPUT -r --default-server-interface + - apax sld --accept-security-disclaimer -t $AXTARGET -i $AXTARGETPLATFORMINPUT -r --default-server-interface check+download: | if [ $AXTARGET ]; then if [ $AXTARGETPLATFORMINPUT ]; then @@ -42,11 +37,23 @@ scripts: - apax install - apax build - apax download + update-targets: | + if [ $AXBUILDTARGET_1 ]; then + yq -i "del(.targets)" apax.yml + yq -i ".targets[0] = strenv(AXBUILDTARGET_1)" apax.yml + if [ $AXBUILDTARGET_2 ]; then + yq -i ".targets[1] = strenv(AXBUILDTARGET_2)" apax.yml + fi + if [ $AXBUILDTARGET_3 ]; then + yq -i ".targets[2] = strenv(AXBUILDTARGET_3)" apax.yml + fi + fi + prebuild: + - apax update-targets postbuild: - apax ixc watch: - - dotnet watch --project - ..\\src\\AXOpen.Integrations.Blazor\\axopen_integrations_blazor.csproj + - dotnet watch --project ..\\src\\AXOpen.Integrations.Blazor\\axopen_integrations_blazor.csproj rr: - apax build - apax download @@ -57,3 +64,5 @@ scripts: - apax rr da: - apax do-it-all +targets: + - plcsim diff --git a/src/integrations/ctrl/dataman_continous.mon b/src/integrations/ctrl/dataman_continous.mon new file mode 100644 index 000000000..cab278886 --- /dev/null +++ b/src/integrations/ctrl/dataman_continous.mon @@ -0,0 +1,5 @@ +AxoCognexVisionDatamanExampleContext.MyDataman.Config.ContinuousReading +AxoCognexVisionDatamanExampleContext.MyDataman._ResultsStatus.ResultsAvailable +AxoCognexVisionDatamanExampleContext.MyDataman. _ResultsControl.ResultsAcknowledge +AxoCognexVisionDatamanExampleContext.MyDataman.Results.Code +AxoCognexVisionDatamanExampleContext.MyDataman.Results.Length diff --git a/src/integrations/ctrl/default.mon b/src/integrations/ctrl/default.mon index 716925bb6..6ff8e23af 100644 --- a/src/integrations/ctrl/default.mon +++ b/src/integrations/ctrl/default.mon @@ -1,8 +1,13 @@ -I_am_alive -AxoMessengers._messenger1.Risen -AxoMessengers._messenger1.Fallen -AxoMessengers._messenger1.Acknowledged -AxoMessengers._messenger2.Risen -AxoMessengers._messenger2.Fallen -AxoMessengers._messenger2.Acknowledged - \ No newline at end of file +#I_am_alive +#AxoMessengers._messenger1.Risen +#AxoMessengers._messenger1.Fallen +#AxoMessengers._messenger1.Acknowledged +#AxoMessengers._messenger2.Risen +#AxoMessengers._messenger2.Fallen +#AxoMessengers._messenger2.Acknowledged +AxoCognexVisionDatamanExampleContext.MyDataman._AcquisitionStatus +AxoCognexVisionDatamanExampleContext.MyDataman._ResultsStatus +AxoCognexVisionDatamanExampleContext.MyDataman._SoftEventStatus +AxoCognexVisionDatamanExampleContext.MyDataman._AcquisitionControl +AxoCognexVisionDatamanExampleContext.MyDataman._ResultsControl +AxoCognexVisionDatamanExampleContext.MyDataman._SoftEventControl diff --git a/src/integrations/ctrl/raw_hw.mon b/src/integrations/ctrl/raw_hw.mon new file mode 100644 index 000000000..91e6ddf68 --- /dev/null +++ b/src/integrations/ctrl/raw_hw.mon @@ -0,0 +1,8 @@ +HwInputs._10a1_Acquisition_Status_1 +HwInputs._10a1_Results_Status_1 +HwInputs._10a1_Soft_Event_Control_1 +#HwInputs._10a1_Result_Data_128_bytes_1 +HwOutputs._10a1_Acquisition_Control_1 +HwOutputs._10a1_Results_Control_1 +HwOutputs._10a1_Soft_Event_Control_1 +#HwOutputs._10a1_User_Data_128_bytes_1 \ No newline at end of file diff --git a/src/integrations/ctrl/raw_plc.mon b/src/integrations/ctrl/raw_plc.mon new file mode 100644 index 000000000..3d17ad74f --- /dev/null +++ b/src/integrations/ctrl/raw_plc.mon @@ -0,0 +1,13 @@ +#I_am_alive +#AxoMessengers._messenger1.Risen +#AxoMessengers._messenger1.Fallen +#AxoMessengers._messenger1.Acknowledged +#AxoMessengers._messenger2.Risen +#AxoMessengers._messenger2.Fallen +#AxoMessengers._messenger2.Acknowledged +PlcInputs._10a1_Acquisition_Status_1 +PlcInputs._10a1_Results_Status_1 +PlcInputs._10a1_Soft_Event_Control_1 +PlcOutputs._10a1_Acquisition_Control_1 +PlcOutputs._10a1_Results_Control_1 +PlcOutputs._10a1_Soft_Event_Control_1 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..34e264c3e --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/AxoCognexVisionDatamanExample.st @@ -0,0 +1,66 @@ +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"} + MyDataman1 : AXOpen.Cognex.Vision.v_6_0_0_0.AxoDataman; + {#ix-set:AttributeName = "reader_st2"} + MyDataman2 : AXOpen.Cognex.Vision.v_6_0_0_0.AxoDataman; + {#ix-set:AttributeName = "<#Activate manual control#>"} + ActivateManualControl : BOOL; + PlcInputs : REF_TO PlcInputs; + PlcOutputs : REF_TO PlcOutputs; + myString : STRING; + END_VAR + + METHOD PROTECTED OVERRIDE Main + // Example of the activation of the manual control. + IF ActivateManualControl THEN + MyDataman1.ActivateManualControl(); + MyDataman2.ActivateManualControl(); + END_IF; + // Calling the main method `Run` with respective input and output variables. + // + MyDataman1.Run( parent := THIS, + refAcquisitionControl := REF(PlcOutputs^._10a1_Acquisition_Control_1), + refAcquisitionStatus := REF(PlcInputs^._10a1_Acquisition_Status_1), + refResultsControl := REF(PlcOutputs^._10a1_Results_Control_1), + refResultsStatus := REF(PlcInputs^._10a1_Results_Status_1), + refSoftEventControl := REF(PlcOutputs^._10a1_Soft_Event_Control_1), + refSoftEventStatus := REF(PlcInputs^._10a1_Soft_Event_Control_1), + refResultData := REF(PlcInputs^._10a1_Result_Data_128_bytes_1), + refUserData := REF(PlcOutputs^._10a1_User_Data_128_bytes_1)); + // + MyDataman2.Run( parent := THIS, + refAcquisitionControl := REF(PlcOutputs^.reader_st2_Acquisition_Control_1), + refAcquisitionStatus := REF(PlcInputs^.reader_st2_Acquisition_Status_1), + refResultsControl := REF(PlcOutputs^.reader_st2_Results_Control_1), + refResultsStatus := REF(PlcInputs^.reader_st2_Results_Status_1), + refSoftEventControl := REF(PlcOutputs^.reader_st2_Soft_Event_Control_1), + refSoftEventStatus := REF(PlcInputs^.reader_st2_Results_Status_1), + refResultData := REF(PlcInputs^.reader_st2_Result_Data_64_bytes_1), + refUserData := REF(PlcOutputs^.reader_st2_User_Data_64_bytes_1)); + + END_METHOD + + METHOD DocuExample + // + IF MyDataman1.Read().IsDone() THEN + //Process the result data + myString := MyDataman1.Results.Data; + END_IF; + // + + // + IF MyDataman1.ClearResultData().IsDone() THEN + //Data inside MyDataman1.Results.Data is cleared + ; + END_IF; + // + 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..0826b1aa7 --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/CopyInputs.st @@ -0,0 +1,224 @@ +FUNCTION CopyInputs + VAR_EXTERNAL + HwInputs : HwInputs; + PlcInputs : PlcInputs; + END_VAR + 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]; + PlcInputs.reader_st2_Acquisition_Status_1[0] := HwInputs.reader_st2_Acquisition_Status_1[0]; + PlcInputs.reader_st2_Acquisition_Status_1[1] := HwInputs.reader_st2_Acquisition_Status_1[1]; + PlcInputs.reader_st2_Acquisition_Status_1[2] := HwInputs.reader_st2_Acquisition_Status_1[2]; + PlcInputs.reader_st2_Results_Status_1 := HwInputs.reader_st2_Results_Status_1; + PlcInputs.reader_st2_Soft_Event_Control_1 := HwInputs.reader_st2_Soft_Event_Control_1; + PlcInputs.reader_st2_Result_Data_64_bytes_1[0] := HwInputs.reader_st2_Result_Data_64_bytes_1[0]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[1] := HwInputs.reader_st2_Result_Data_64_bytes_1[1]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[2] := HwInputs.reader_st2_Result_Data_64_bytes_1[2]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[3] := HwInputs.reader_st2_Result_Data_64_bytes_1[3]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[4] := HwInputs.reader_st2_Result_Data_64_bytes_1[4]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[5] := HwInputs.reader_st2_Result_Data_64_bytes_1[5]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[6] := HwInputs.reader_st2_Result_Data_64_bytes_1[6]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[7] := HwInputs.reader_st2_Result_Data_64_bytes_1[7]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[8] := HwInputs.reader_st2_Result_Data_64_bytes_1[8]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[9] := HwInputs.reader_st2_Result_Data_64_bytes_1[9]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[10] := HwInputs.reader_st2_Result_Data_64_bytes_1[10]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[11] := HwInputs.reader_st2_Result_Data_64_bytes_1[11]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[12] := HwInputs.reader_st2_Result_Data_64_bytes_1[12]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[13] := HwInputs.reader_st2_Result_Data_64_bytes_1[13]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[14] := HwInputs.reader_st2_Result_Data_64_bytes_1[14]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[15] := HwInputs.reader_st2_Result_Data_64_bytes_1[15]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[16] := HwInputs.reader_st2_Result_Data_64_bytes_1[16]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[17] := HwInputs.reader_st2_Result_Data_64_bytes_1[17]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[18] := HwInputs.reader_st2_Result_Data_64_bytes_1[18]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[19] := HwInputs.reader_st2_Result_Data_64_bytes_1[19]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[20] := HwInputs.reader_st2_Result_Data_64_bytes_1[20]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[21] := HwInputs.reader_st2_Result_Data_64_bytes_1[21]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[22] := HwInputs.reader_st2_Result_Data_64_bytes_1[22]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[23] := HwInputs.reader_st2_Result_Data_64_bytes_1[23]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[24] := HwInputs.reader_st2_Result_Data_64_bytes_1[24]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[25] := HwInputs.reader_st2_Result_Data_64_bytes_1[25]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[26] := HwInputs.reader_st2_Result_Data_64_bytes_1[26]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[27] := HwInputs.reader_st2_Result_Data_64_bytes_1[27]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[28] := HwInputs.reader_st2_Result_Data_64_bytes_1[28]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[29] := HwInputs.reader_st2_Result_Data_64_bytes_1[29]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[30] := HwInputs.reader_st2_Result_Data_64_bytes_1[30]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[31] := HwInputs.reader_st2_Result_Data_64_bytes_1[31]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[32] := HwInputs.reader_st2_Result_Data_64_bytes_1[32]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[33] := HwInputs.reader_st2_Result_Data_64_bytes_1[33]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[34] := HwInputs.reader_st2_Result_Data_64_bytes_1[34]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[35] := HwInputs.reader_st2_Result_Data_64_bytes_1[35]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[36] := HwInputs.reader_st2_Result_Data_64_bytes_1[36]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[37] := HwInputs.reader_st2_Result_Data_64_bytes_1[37]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[38] := HwInputs.reader_st2_Result_Data_64_bytes_1[38]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[39] := HwInputs.reader_st2_Result_Data_64_bytes_1[39]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[40] := HwInputs.reader_st2_Result_Data_64_bytes_1[40]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[41] := HwInputs.reader_st2_Result_Data_64_bytes_1[41]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[42] := HwInputs.reader_st2_Result_Data_64_bytes_1[42]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[43] := HwInputs.reader_st2_Result_Data_64_bytes_1[43]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[44] := HwInputs.reader_st2_Result_Data_64_bytes_1[44]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[45] := HwInputs.reader_st2_Result_Data_64_bytes_1[45]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[46] := HwInputs.reader_st2_Result_Data_64_bytes_1[46]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[47] := HwInputs.reader_st2_Result_Data_64_bytes_1[47]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[48] := HwInputs.reader_st2_Result_Data_64_bytes_1[48]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[49] := HwInputs.reader_st2_Result_Data_64_bytes_1[49]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[50] := HwInputs.reader_st2_Result_Data_64_bytes_1[50]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[51] := HwInputs.reader_st2_Result_Data_64_bytes_1[51]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[52] := HwInputs.reader_st2_Result_Data_64_bytes_1[52]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[53] := HwInputs.reader_st2_Result_Data_64_bytes_1[53]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[54] := HwInputs.reader_st2_Result_Data_64_bytes_1[54]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[55] := HwInputs.reader_st2_Result_Data_64_bytes_1[55]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[56] := HwInputs.reader_st2_Result_Data_64_bytes_1[56]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[57] := HwInputs.reader_st2_Result_Data_64_bytes_1[57]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[58] := HwInputs.reader_st2_Result_Data_64_bytes_1[58]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[59] := HwInputs.reader_st2_Result_Data_64_bytes_1[59]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[60] := HwInputs.reader_st2_Result_Data_64_bytes_1[60]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[61] := HwInputs.reader_st2_Result_Data_64_bytes_1[61]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[62] := HwInputs.reader_st2_Result_Data_64_bytes_1[62]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[63] := HwInputs.reader_st2_Result_Data_64_bytes_1[63]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[64] := HwInputs.reader_st2_Result_Data_64_bytes_1[64]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[65] := HwInputs.reader_st2_Result_Data_64_bytes_1[65]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[66] := HwInputs.reader_st2_Result_Data_64_bytes_1[66]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[67] := HwInputs.reader_st2_Result_Data_64_bytes_1[67]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[68] := HwInputs.reader_st2_Result_Data_64_bytes_1[68]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[69] := HwInputs.reader_st2_Result_Data_64_bytes_1[69]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[70] := HwInputs.reader_st2_Result_Data_64_bytes_1[70]; + PlcInputs.reader_st2_Result_Data_64_bytes_1[71] := HwInputs.reader_st2_Result_Data_64_bytes_1[71]; +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..74838859d --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/CopyOutputs.st @@ -0,0 +1,212 @@ +FUNCTION CopyOutputs + VAR_EXTERNAL + HwOutputs : HwOutputs; + PlcOutputs : PlcOutputs; + END_VAR + 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]; + HwOutputs.reader_st2_Acquisition_Control_1 := PlcOutputs.reader_st2_Acquisition_Control_1; + HwOutputs.reader_st2_Results_Control_1 := PlcOutputs.reader_st2_Results_Control_1; + HwOutputs.reader_st2_Soft_Event_Control_1 := PlcOutputs.reader_st2_Soft_Event_Control_1; + HwOutputs.reader_st2_User_Data_64_bytes_1[0] := PlcOutputs.reader_st2_User_Data_64_bytes_1[0]; + HwOutputs.reader_st2_User_Data_64_bytes_1[1] := PlcOutputs.reader_st2_User_Data_64_bytes_1[1]; + HwOutputs.reader_st2_User_Data_64_bytes_1[2] := PlcOutputs.reader_st2_User_Data_64_bytes_1[2]; + HwOutputs.reader_st2_User_Data_64_bytes_1[3] := PlcOutputs.reader_st2_User_Data_64_bytes_1[3]; + HwOutputs.reader_st2_User_Data_64_bytes_1[4] := PlcOutputs.reader_st2_User_Data_64_bytes_1[4]; + HwOutputs.reader_st2_User_Data_64_bytes_1[5] := PlcOutputs.reader_st2_User_Data_64_bytes_1[5]; + HwOutputs.reader_st2_User_Data_64_bytes_1[6] := PlcOutputs.reader_st2_User_Data_64_bytes_1[6]; + HwOutputs.reader_st2_User_Data_64_bytes_1[7] := PlcOutputs.reader_st2_User_Data_64_bytes_1[7]; + HwOutputs.reader_st2_User_Data_64_bytes_1[8] := PlcOutputs.reader_st2_User_Data_64_bytes_1[8]; + HwOutputs.reader_st2_User_Data_64_bytes_1[9] := PlcOutputs.reader_st2_User_Data_64_bytes_1[9]; + HwOutputs.reader_st2_User_Data_64_bytes_1[10] := PlcOutputs.reader_st2_User_Data_64_bytes_1[10]; + HwOutputs.reader_st2_User_Data_64_bytes_1[11] := PlcOutputs.reader_st2_User_Data_64_bytes_1[11]; + HwOutputs.reader_st2_User_Data_64_bytes_1[12] := PlcOutputs.reader_st2_User_Data_64_bytes_1[12]; + HwOutputs.reader_st2_User_Data_64_bytes_1[13] := PlcOutputs.reader_st2_User_Data_64_bytes_1[13]; + HwOutputs.reader_st2_User_Data_64_bytes_1[14] := PlcOutputs.reader_st2_User_Data_64_bytes_1[14]; + HwOutputs.reader_st2_User_Data_64_bytes_1[15] := PlcOutputs.reader_st2_User_Data_64_bytes_1[15]; + HwOutputs.reader_st2_User_Data_64_bytes_1[16] := PlcOutputs.reader_st2_User_Data_64_bytes_1[16]; + HwOutputs.reader_st2_User_Data_64_bytes_1[17] := PlcOutputs.reader_st2_User_Data_64_bytes_1[17]; + HwOutputs.reader_st2_User_Data_64_bytes_1[18] := PlcOutputs.reader_st2_User_Data_64_bytes_1[18]; + HwOutputs.reader_st2_User_Data_64_bytes_1[19] := PlcOutputs.reader_st2_User_Data_64_bytes_1[19]; + HwOutputs.reader_st2_User_Data_64_bytes_1[20] := PlcOutputs.reader_st2_User_Data_64_bytes_1[20]; + HwOutputs.reader_st2_User_Data_64_bytes_1[21] := PlcOutputs.reader_st2_User_Data_64_bytes_1[21]; + HwOutputs.reader_st2_User_Data_64_bytes_1[22] := PlcOutputs.reader_st2_User_Data_64_bytes_1[22]; + HwOutputs.reader_st2_User_Data_64_bytes_1[23] := PlcOutputs.reader_st2_User_Data_64_bytes_1[23]; + HwOutputs.reader_st2_User_Data_64_bytes_1[24] := PlcOutputs.reader_st2_User_Data_64_bytes_1[24]; + HwOutputs.reader_st2_User_Data_64_bytes_1[25] := PlcOutputs.reader_st2_User_Data_64_bytes_1[25]; + HwOutputs.reader_st2_User_Data_64_bytes_1[26] := PlcOutputs.reader_st2_User_Data_64_bytes_1[26]; + HwOutputs.reader_st2_User_Data_64_bytes_1[27] := PlcOutputs.reader_st2_User_Data_64_bytes_1[27]; + HwOutputs.reader_st2_User_Data_64_bytes_1[28] := PlcOutputs.reader_st2_User_Data_64_bytes_1[28]; + HwOutputs.reader_st2_User_Data_64_bytes_1[29] := PlcOutputs.reader_st2_User_Data_64_bytes_1[29]; + HwOutputs.reader_st2_User_Data_64_bytes_1[30] := PlcOutputs.reader_st2_User_Data_64_bytes_1[30]; + HwOutputs.reader_st2_User_Data_64_bytes_1[31] := PlcOutputs.reader_st2_User_Data_64_bytes_1[31]; + HwOutputs.reader_st2_User_Data_64_bytes_1[32] := PlcOutputs.reader_st2_User_Data_64_bytes_1[32]; + HwOutputs.reader_st2_User_Data_64_bytes_1[33] := PlcOutputs.reader_st2_User_Data_64_bytes_1[33]; + HwOutputs.reader_st2_User_Data_64_bytes_1[34] := PlcOutputs.reader_st2_User_Data_64_bytes_1[34]; + HwOutputs.reader_st2_User_Data_64_bytes_1[35] := PlcOutputs.reader_st2_User_Data_64_bytes_1[35]; + HwOutputs.reader_st2_User_Data_64_bytes_1[36] := PlcOutputs.reader_st2_User_Data_64_bytes_1[36]; + HwOutputs.reader_st2_User_Data_64_bytes_1[37] := PlcOutputs.reader_st2_User_Data_64_bytes_1[37]; + HwOutputs.reader_st2_User_Data_64_bytes_1[38] := PlcOutputs.reader_st2_User_Data_64_bytes_1[38]; + HwOutputs.reader_st2_User_Data_64_bytes_1[39] := PlcOutputs.reader_st2_User_Data_64_bytes_1[39]; + HwOutputs.reader_st2_User_Data_64_bytes_1[40] := PlcOutputs.reader_st2_User_Data_64_bytes_1[40]; + HwOutputs.reader_st2_User_Data_64_bytes_1[41] := PlcOutputs.reader_st2_User_Data_64_bytes_1[41]; + HwOutputs.reader_st2_User_Data_64_bytes_1[42] := PlcOutputs.reader_st2_User_Data_64_bytes_1[42]; + HwOutputs.reader_st2_User_Data_64_bytes_1[43] := PlcOutputs.reader_st2_User_Data_64_bytes_1[43]; + HwOutputs.reader_st2_User_Data_64_bytes_1[44] := PlcOutputs.reader_st2_User_Data_64_bytes_1[44]; + HwOutputs.reader_st2_User_Data_64_bytes_1[45] := PlcOutputs.reader_st2_User_Data_64_bytes_1[45]; + HwOutputs.reader_st2_User_Data_64_bytes_1[46] := PlcOutputs.reader_st2_User_Data_64_bytes_1[46]; + HwOutputs.reader_st2_User_Data_64_bytes_1[47] := PlcOutputs.reader_st2_User_Data_64_bytes_1[47]; + HwOutputs.reader_st2_User_Data_64_bytes_1[48] := PlcOutputs.reader_st2_User_Data_64_bytes_1[48]; + HwOutputs.reader_st2_User_Data_64_bytes_1[49] := PlcOutputs.reader_st2_User_Data_64_bytes_1[49]; + HwOutputs.reader_st2_User_Data_64_bytes_1[50] := PlcOutputs.reader_st2_User_Data_64_bytes_1[50]; + HwOutputs.reader_st2_User_Data_64_bytes_1[51] := PlcOutputs.reader_st2_User_Data_64_bytes_1[51]; + HwOutputs.reader_st2_User_Data_64_bytes_1[52] := PlcOutputs.reader_st2_User_Data_64_bytes_1[52]; + HwOutputs.reader_st2_User_Data_64_bytes_1[53] := PlcOutputs.reader_st2_User_Data_64_bytes_1[53]; + HwOutputs.reader_st2_User_Data_64_bytes_1[54] := PlcOutputs.reader_st2_User_Data_64_bytes_1[54]; + HwOutputs.reader_st2_User_Data_64_bytes_1[55] := PlcOutputs.reader_st2_User_Data_64_bytes_1[55]; + HwOutputs.reader_st2_User_Data_64_bytes_1[56] := PlcOutputs.reader_st2_User_Data_64_bytes_1[56]; + HwOutputs.reader_st2_User_Data_64_bytes_1[57] := PlcOutputs.reader_st2_User_Data_64_bytes_1[57]; + HwOutputs.reader_st2_User_Data_64_bytes_1[58] := PlcOutputs.reader_st2_User_Data_64_bytes_1[58]; + HwOutputs.reader_st2_User_Data_64_bytes_1[59] := PlcOutputs.reader_st2_User_Data_64_bytes_1[59]; + HwOutputs.reader_st2_User_Data_64_bytes_1[60] := PlcOutputs.reader_st2_User_Data_64_bytes_1[60]; + HwOutputs.reader_st2_User_Data_64_bytes_1[61] := PlcOutputs.reader_st2_User_Data_64_bytes_1[61]; + HwOutputs.reader_st2_User_Data_64_bytes_1[62] := PlcOutputs.reader_st2_User_Data_64_bytes_1[62]; + HwOutputs.reader_st2_User_Data_64_bytes_1[63] := PlcOutputs.reader_st2_User_Data_64_bytes_1[63]; + HwOutputs.reader_st2_User_Data_64_bytes_1[64] := PlcOutputs.reader_st2_User_Data_64_bytes_1[64]; + HwOutputs.reader_st2_User_Data_64_bytes_1[65] := PlcOutputs.reader_st2_User_Data_64_bytes_1[65]; + HwOutputs.reader_st2_User_Data_64_bytes_1[66] := PlcOutputs.reader_st2_User_Data_64_bytes_1[66]; + HwOutputs.reader_st2_User_Data_64_bytes_1[67] := PlcOutputs.reader_st2_User_Data_64_bytes_1[67]; +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..499dff12e --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/HwInputs.st @@ -0,0 +1,12 @@ +TYPE + HwInputs : STRUCT + _10a1_Acquisition_Status_1 AT %B82 : ARRAY[0..2] OF BYTE; + _10a1_Results_Status_1 AT %B85 : BYTE; + _10a1_Soft_Event_Control_1 AT %B86 : BYTE; + _10a1_Result_Data_128_bytes_1 AT %B87 : ARRAY[0..135] OF BYTE; + reader_st2_Acquisition_Status_1 AT %B300 : ARRAY[0..2] OF BYTE; + reader_st2_Results_Status_1 AT %B303 : BYTE; + reader_st2_Soft_Event_Control_1 AT %B304 : BYTE; + reader_st2_Result_Data_64_bytes_1 AT %B305 : ARRAY[0..71] 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..d58fe24d8 --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/HwOutputs.st @@ -0,0 +1,12 @@ +TYPE + HwOutputs : STRUCT + _10a1_Acquisition_Control_1 AT %B72 : BYTE; + _10a1_Results_Control_1 AT %B73 : BYTE; + _10a1_Soft_Event_Control_1 AT %B74 : BYTE; + _10a1_User_Data_128_bytes_1 AT %B75 : ARRAY[0..131] OF BYTE; + reader_st2_Acquisition_Control_1 AT %B300 : BYTE; + reader_st2_Results_Control_1 AT %B301 : BYTE; + reader_st2_Soft_Event_Control_1 AT %B302 : BYTE; + reader_st2_User_Data_64_bytes_1 AT %B303 : ARRAY[0..67] 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..ff2f73028 --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/PlcInputs.st @@ -0,0 +1,12 @@ +TYPE + PlcInputs : STRUCT + _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; + reader_st2_Acquisition_Status_1 : ARRAY[0..2] OF BYTE; + reader_st2_Results_Status_1 : BYTE; + reader_st2_Soft_Event_Control_1 : BYTE; + reader_st2_Result_Data_64_bytes_1 : ARRAY[0..71] 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..615bda58b --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.Cognex.Vision/IO/PlcOutputs.st @@ -0,0 +1,12 @@ +TYPE + PlcOutputs : STRUCT + _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; + reader_st2_Acquisition_Control_1 : BYTE; + reader_st2_Results_Control_1 : BYTE; + reader_st2_Soft_Event_Control_1 : BYTE; + reader_st2_User_Data_64_bytes_1 : ARRAY[0..67] OF BYTE; + END_STRUCT; +END_TYPE diff --git a/src/integrations/ctrl/src/Examples/AxoTextList/AxoTextListExample.st b/src/integrations/ctrl/src/Examples/AxoTextList/AxoTextListExample.st new file mode 100644 index 000000000..e929388a6 --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AxoTextList/AxoTextListExample.st @@ -0,0 +1,48 @@ +USING AXOpen.Core; + +NAMESPACE AxoTextListExample + + + CLASS AxoTextListExampleContext EXTENDS AXOpen.Core.AxoContext + VAR PUBLIC + {#ix-set:AttributeName = "Click to increment text list Id"} + _incrementTask : AXOpen.Core.AxoTask; + {#ix-set:AttributeName = "Click to reset text list Id to zero"} + _set2zeroTask : AXOpen.Core.AxoTask; + // + {#ix-set:AttributeName = "Description: |[[1]TextList]|"} + {#ix-attr:[WarningLevel(600)]} + {#ix-attr:[ErrorLevel(700)]} + _myTextList1 : AXOpen.Core.AxoTextList; + // + // + {#ix-set:AttributeName = "|[[1]TextList]|"} + {#ix-attr:[WarningLevel(300)]} + {#ix-attr:[ErrorLevel(500)]} + _myTextList2 : AXOpen.Core.AxoTextList; + // + // + {#ix-set:AttributeName = "Totaly different description without error elevation: |[[1]DifferentTextList]|"} + _myTextList3 : AXOpen.Core.AxoTextList; + // + END_VAR + + METHOD PROTECTED OVERRIDE Main + _incrementTask.Initialize(THIS); + _set2zeroTask.Initialize(THIS); + + IF(_incrementTask.Execute()) THEN + _myTextList1.Id := _myTextList1.Id + UINT#1; + _incrementTask.DoneWhen(_myTextList1.Id>= UINT#1000); + END_IF; + + IF(_set2zeroTask.Execute()) THEN + _incrementTask.Restore(); + _myTextList1.Id := UINT#0; + _set2zeroTask.DoneWhen(TRUE); + END_IF; + _myTextList2.Id := _myTextList1.Id; + _myTextList3.Id := _myTextList1.Id; + END_METHOD + END_CLASS +END_NAMESPACE diff --git a/src/integrations/ctrl/src/Examples/misc/AX_Plc1516V3_CognexDataman.zap18 b/src/integrations/ctrl/src/Examples/misc/AX_Plc1516V3_CognexDataman.zap18 new file mode 100644 index 000000000..f3dbc1ff9 Binary files /dev/null and b/src/integrations/ctrl/src/Examples/misc/AX_Plc1516V3_CognexDataman.zap18 differ diff --git a/src/integrations/ctrl/src/configuration.st b/src/integrations/ctrl/src/configuration.st index 697f71973..d52913748 100644 --- a/src/integrations/ctrl/src/configuration.st +++ b/src/integrations/ctrl/src/configuration.st @@ -26,6 +26,9 @@ CONFIGURATION MyConfiguration AxoMessengersDocu : AxoStaticMessengerDocuExample.Messengers; AxoRtc : AxoRtc.AxoS71500Rtc; AxoDataFragmentExchangeContext : AxoDataFramentsExchangeDocuExample.AxoDataFragmentExchangeContext; + AxoTextListExampleContext : AxoTextListExample.AxoTextListExampleContext; + AxoCognexVisionDatamanExampleContext : AxoCognexVisionDatamanExamples.AxoCognexVisionDatamanExampleContext; + process_data_manager: AxoDataExamples.AxoProcessDataManager; test_data_manager: AxoDataExamples.AxoTestDataManager; AxoLoggers : AxoLoggerExamples.Loggers; @@ -35,4 +38,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..8ca16e060 100644 --- a/src/integrations/ctrl/src/program.st +++ b/src/integrations/ctrl/src/program.st @@ -22,6 +22,8 @@ PROGRAM MyProgram AxoMessengersDocu : AxoStaticMessengerDocuExample.Messengers; AxoDataFragmentExchangeContext : AxoDataFramentsExchangeDocuExample.AxoDataFragmentExchangeContext; + AxoTextListExampleContext : AxoTextListExample.AxoTextListExampleContext; + AxoCognexVisionDatamanExampleContext : AxoCognexVisionDatamanExamples.AxoCognexVisionDatamanExampleContext; AxoLoggers : AxoLoggerExamples.Loggers; @@ -30,6 +32,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 +63,21 @@ PROGRAM MyProgram AxoMessengersDocu.Run(); AxoMessengersDocu.InjectRtc(AxoRtc); AxoDataFragmentExchangeContext.Run(); + + AxoTextListExampleContext.Run(); + + AxoCognexVisionDatamanExampleContext.PlcInputs := REF(PlcInputs); + AxoCognexVisionDatamanExampleContext.PlcOutputs := REF(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 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..8b1638448 --- /dev/null +++ b/src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoCognexVision/AxoCognexVisionDatamanExample.razor @@ -0,0 +1,33 @@ +@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/Pages/AxoTextList/AxoTextListExample.razor b/src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoTextList/AxoTextListExample.razor new file mode 100644 index 000000000..b01ee852c --- /dev/null +++ b/src/integrations/src/AXOpen.Integrations.Blazor/Pages/AxoTextList/AxoTextListExample.razor @@ -0,0 +1,33 @@ +@page "/AxoTextListExample" +@using axopen_integrations +@using AXOpen.Core; + +

AxoTextListExample

+ +
+
+ AxoTextListExample +
+
+
+
+ +
+
+ +
+
+// +
+ +
+
+ +
+
+ +
+//
+
+
+ diff --git a/src/integrations/src/AXOpen.Integrations.Blazor/Program.cs b/src/integrations/src/AXOpen.Integrations.Blazor/Program.cs index d38aa9d36..75a063502 100644 --- a/src/integrations/src/AXOpen.Integrations.Blazor/Program.cs +++ b/src/integrations/src/AXOpen.Integrations.Blazor/Program.cs @@ -34,6 +34,17 @@ public static async Task Main(string[] args) .WriteTo.Console().MinimumLevel.Debug() .CreateLogger())); + Entry.Plc.Connector.SetLoggerConfiguration(new LoggerConfiguration() + .WriteTo + .Console() + .WriteTo + .File($"connector.log", + outputTemplate: "{Timestamp:yyyy-MMM-dd HH:mm:ss} [{Level}] {Message}{NewLine}{Exception}", + fileSizeLimitBytes: 100000) + .MinimumLevel.Debug() + .CreateLogger()); + + Entry.Plc.Connector.ReadWriteCycleDelay = 250; Entry.Plc.Connector.BuildAndStart(); Entry.Plc.Connector.ExceptionBehaviour = CommExceptionBehaviour.Ignore; diff --git a/src/integrations/src/AXOpen.Integrations.Blazor/Shared/NavMenu.razor b/src/integrations/src/AXOpen.Integrations.Blazor/Shared/NavMenu.razor index bc8f94335..9897bdf52 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/AxoTextListExample/AxoTextListExampleContext.cs b/src/integrations/src/AXOpen.Integrations/AxoTextListExample/AxoTextListExampleContext.cs new file mode 100644 index 000000000..d9bb8bf94 --- /dev/null +++ b/src/integrations/src/AXOpen.Integrations/AxoTextListExample/AxoTextListExampleContext.cs @@ -0,0 +1,70 @@ + +using System.Collections.Generic; + +namespace AxoTextListExample +{ + public partial class AxoTextListExampleContext : AXOpen.Core.AxoContext + { + // + Dictionary textList = new Dictionary(); + // + public string TextList + { + get + { + // + if (textList == null) { textList = new Dictionary(); } + if (textList.Count == 0) + { + textList.Add(0, " "); + for (int i = 1; i < 1000; i++) + { + textList.Add((uint)i, "Text list item : " + i.ToString()); + } + + } + // + // + string _textItem = " "; + if (textList.TryGetValue(_myTextList1.Id.LastValue, out _textItem)) + { + return _textItem; + } + else + { + return " "; + } + // + } + } + + Dictionary differentTextList = new Dictionary(); + public string DifferentTextList + { + get + { + if (differentTextList == null) { differentTextList = new Dictionary(); } + if (differentTextList.Count == 0) + { + differentTextList.Add(0, " "); + for (int i = 1; i < 1000; i++) + { + differentTextList.Add((uint)i, "Item from the totally different text list : " + i.ToString()); + } + + } + string differentTextItem = " "; + if (differentTextList.TryGetValue(_myTextList3.Id.LastValue, out differentTextItem)) + { + return differentTextItem; + } + else + + { + return " "; + } + } + } + } + +} diff --git a/src/integrations/src/AXOpen.Integrations/axopen_integrations.csproj b/src/integrations/src/AXOpen.Integrations/axopen_integrations.csproj index be807a3d2..34d627b27 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/axosimple.twin/Entry.cs b/src/templates.simple/axosimple.twin/Entry.cs index 230c75996..8ce14c7b2 100644 --- a/src/templates.simple/axosimple.twin/Entry.cs +++ b/src/templates.simple/axosimple.twin/Entry.cs @@ -17,7 +17,7 @@ namespace axosimple { public static class Entry { - private const string TargetIp = "192.168.0.4"; // <- replace by your IP + private const string TargetIp = "10.10.10.1"; // <- replace by your IP private const string UserName = "Everybody"; //<- replace by user name you have set up in your WebAPI settings private const string Pass = ""; // <- Pass in the password that you have set up for the user. NOT AS PLAIN TEXT! Use user secrets instead. private const bool IgnoreSslErrors = true; // <- When you have your certificates in order set this to false. diff --git a/src/templates.simple/axosimple.twin/Resources/PlcStringResources.resx b/src/templates.simple/axosimple.twin/Resources/PlcStringResources.resx index 0b3906703..b8b155214 100644 --- a/src/templates.simple/axosimple.twin/Resources/PlcStringResources.resx +++ b/src/templates.simple/axosimple.twin/Resources/PlcStringResources.resx @@ -76,14 +76,14 @@ AUTOMAT - src\Examples\PneumaticManipulator.st,140 + src\Examples\PneumaticManipulator.st,142 GROUND - src\Examples\PneumaticManipulator.st,313 + src\Examples\PneumaticManipulator.st,315 SERVICE - src\Examples\PneumaticManipulator.st,367 + src\Examples\PneumaticManipulator.st,369 \ No newline at end of file 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/templates.simple/ctrl/apax.yml b/src/templates.simple/ctrl/apax.yml index 2717ee15f..3474ad32c 100644 --- a/src/templates.simple/ctrl/apax.yml +++ b/src/templates.simple/ctrl/apax.yml @@ -3,29 +3,68 @@ version: '0.1.4-alpha.79' type: app registries: '@ix-ax': https://npm.pkg.github.com/ -targets: - - "1500" - - plcsim - - axunit-llvm devDependencies: "@ax/sdk": ^4.0.3 "@ax/sld": ^0.15.9 dependencies: "@ix-ax/axopen.data": '0.1.4-alpha.79' "@ix-ax/axopen.simatic1500": '0.1.4-alpha.79' - + "@ax/system-serde": ^2.0.2 variables: - APAX_BUILD_ARGS: [ -d ] + APAX_BUILD_ARGS: [-d] scripts: ixc: - dotnet tool restore --no-cache - dotnet ixc - dotnet ixr + prebuild: + - apax update-targets postbuild: apax ixc download: - apax install - apax build # Here you will need to set the argumen -t to your plc OP and -i to platfrom you are dowloading to + # --default-server-interface is a must if you are using WebAPI - - apax sld --accept-security-disclaimer -t 192.168.0.4 -i .\\bin\\plcsim\\ - -r --default-server-interface + - apax sld --accept-security-disclaimer -t $AXTARGET -i $AXTARGETPLATFORMINPUT -r --default-server-interface + watch: + - dotnet watch --project ..\\axosimple.app\\axosimple.hmi.csproj + da: + - apax download + - apax watch + check+download: | + if [ $AXTARGET ]; then + if [ $AXTARGETPLATFORMINPUT ]; then + if ping -n 1 $AXTARGET &> /dev/null; then + echo "Downloading from:" $AXTARGETPLATFORMINPUT "=>" $AXTARGET + apax download + else + echo "Target with IP address:" $AXTARGET "is not accessible. No download is going to be performed!!!" + fi + else + echo "Environment variable AXTARGETPLATFORMINPUT not defined!!!" + fi + else + echo "Environment variable AXTARGET not defined!!!" + fi + update-targets: | + if [ $AXBUILDTARGET_1 ]; then + yq -i "del(.targets)" apax.yml + yq -i ".targets[0] = strenv(AXBUILDTARGET_1)" apax.yml + if [ $AXBUILDTARGET_2 ]; then + yq -i ".targets[1] = strenv(AXBUILDTARGET_2)" apax.yml + fi + if [ $AXBUILDTARGET_3 ]; then + yq -i ".targets[2] = strenv(AXBUILDTARGET_3)" apax.yml + fi + fi + rr: + - apax build + - apax download + - apax watch + fr: + - ..\\scripts\\StartPlcSimAdvCli.exe + - apax install + - apax rr +targets: + - plcsim diff --git a/src/templates.simple/ctrl/monitor.mon b/src/templates.simple/ctrl/monitor.mon index 0ae45142b..f74cb314d 100644 --- a/src/templates.simple/ctrl/monitor.mon +++ b/src/templates.simple/ctrl/monitor.mon @@ -17,4 +17,4 @@ Context.PneumaticManipulator.AutomatSequence._dialog3._edgeDetected Context.PneumaticManipulator.AutomatSequence._dialog3._testClose #Context.PneumaticManipulator.AutomatSequence._dialog1 -#Context.PneumaticManipulator.AutomatSequence._dialog2 \ No newline at end of file +#Context.PneumaticManipulator.AutomatSequence._dialog2 diff --git a/src/templates.simple/ctrl/src/Context.st b/src/templates.simple/ctrl/src/Context.st index b16018454..3680e5518 100644 --- a/src/templates.simple/ctrl/src/Context.st +++ b/src/templates.simple/ctrl/src/Context.st @@ -9,7 +9,7 @@ NAMESPACE axosimple PneumaticManipulator : examples.PneumaticManipulator.CU; PneumaticManipulator2 : examples.PneumaticManipulator.CU; Inputs : REF_TO axosimple.Inputs; - Outputs : REF_TO axosimple.Outputs; + Outputs : REF_TO axosimple.Outputs; END_VAR METHOD PROTECTED OVERRIDE Main diff --git a/src/templates.simple/ctrl/src/Examples/PneumaticManipulator.st b/src/templates.simple/ctrl/src/Examples/PneumaticManipulator.st index 4a5cd4b65..8cf50104e 100644 --- a/src/templates.simple/ctrl/src/Examples/PneumaticManipulator.st +++ b/src/templates.simple/ctrl/src/Examples/PneumaticManipulator.st @@ -16,7 +16,7 @@ NAMESPACE examples.PneumaticManipulator VerticalCylinder : AXOpen.Pneumatics.Cylinder; GripperCylinder : AXOpen.Pneumatics.Cylinder; END_VAR - + METHOD PUBLIC Update VAR_INPUT parent : IAxoObject; @@ -30,6 +30,8 @@ NAMESPACE examples.PneumaticManipulator HorizontalCylinder.Update(THIS, Inputs.B0[0], Inputs.B0[1], Outputs.B0[0], Outputs.B0[1]); VerticalCylinder.Update(THIS, Inputs.B0[2], Inputs.B0[3], Outputs.B0[2], Outputs.B0[3]); GripperCylinder.Update(THIS, Inputs.B0[4], Inputs.B0[5], Outputs.B0[4], Outputs.B0[5]); + + END_METHOD END_CLASS diff --git a/src/templates.simple/ctrl/src/configuration.st b/src/templates.simple/ctrl/src/configuration.st index d080e59bb..f16476983 100644 --- a/src/templates.simple/ctrl/src/configuration.st +++ b/src/templates.simple/ctrl/src/configuration.st @@ -10,4 +10,5 @@ CONFIGURATION MyConfiguration S71500Rtc : AXOpen.S71500.Rtc; ContextLogger : AXOpen.Logging.AxoLogger; END_VAR + END_CONFIGURATION diff --git a/src/templates.simple/ctrl/src/program.st b/src/templates.simple/ctrl/src/program.st index 78f90350a..1fb6fcb95 100644 --- a/src/templates.simple/ctrl/src/program.st +++ b/src/templates.simple/ctrl/src/program.st @@ -7,6 +7,7 @@ PROGRAM MyProgram S71500Rtc : AXOpen.S71500.Rtc; ContextLogger : AXOpen.Logging.AxoLogger; END_VAR + // Never modif this the context needs references to IN/OUT structures before it is used. Context.Inputs := REF(Inputs); Context.Outputs := REF(Outputs); @@ -16,6 +17,4 @@ PROGRAM MyProgram Context.InjectLogger(ContextLogger); // Executes the main context of this application. Context.Run(); - - END_PROGRAM 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