diff --git a/.claude/skills/axo-to-tco-migration/SKILL.md b/.claude/skills/axo-to-tco-migration/SKILL.md new file mode 100644 index 00000000..124b0a8e --- /dev/null +++ b/.claude/skills/axo-to-tco-migration/SKILL.md @@ -0,0 +1,106 @@ +--- +name: axo-to-tco-migration +description: Port (migrate) an AxOpen / AX# vendor component (Axo, Simatic AX `src/components..`) into a TcOpen vendor component (Tco library, TwinCAT 3). Use when the user wants to migrate, port, convert or take over a component from AxOpen / AXOpen / AX# into this repo, or names an `Axo` class as the source. Builds on the tco-vendor-component skill. +--- + +# AxOpen -> TcOpen component migration + +Source: the AxOpen repository, default `d:\MTS\Develop\Inxton\ax\axopen-templates\axopen` (ask if it is not there). +**The AxOpen repository is read-only.** Never edit, build, format, `apax install` or create files in it; copy files *out* of it only. + +Target: a TcOpen vendor component built exactly as described by the **`tco-vendor-component`** skill. Load that skill +first - its scaffold, registration, naming, localization, testing rules and Definition of done apply unchanged. This skill +only adds how to read the AX source and how to translate AX constructs: [references/ax-to-tco-mapping.md](references/ax-to-tco-mapping.md). + +## Placeholder names + +This skill uses one generic name family, aligned with tco-vendor-component. Replace it consistently with the real names. + +| AX placeholder | TcOpen placeholder | +|---|---| +| `components..` | library `Tco` = `TcoTemplate` | +| `AxoTemplate` (class in the `` namespace) | `TcoTemplate[Pn\|Ecat]_v_1_x_x` | +| `AxoTemplate_` | `TcoTemplate__v_1_x_x` (DUTs, tasks, functions) | +| `eAxoTemplate_` | `eTcoTemplate__v_1_x_x` | +| `AxoTemplate_BaseTask` | `TcoTemplateTask_v_1_x_x` (ABSTRACT) | +| `FakeTemplate` harness (`ctrl/test/_harness/`) | `TcoTemplateSimulator` in the test PLC | + +Real examples are listed only at the end ([Examples](#examples-reference-ports)). + +## AX library anatomy + +``` +src/components../ + ctrl/src/AxoTemplate// # component CLASS, Tasks/, TypesStructuresAndEnums/ (or flat) + ctrl/test/ # AxUnit tests, _harness/ (FakeTemplate simulator, S7Harness mocks) + ctrl/assets/ # GSDML / ESI / .hwl.yml hardware templates + src/AXOpen.Components../ # C# twin partials: messenger text lists (code -> text + help) + Resources/PlcStringResources*.resx # translations of every <#...#> PLC text + src/AXOpen.Components...blazor/ # views (what the operator sees) + Resources/Strings*.resx + tests/AXOpen.Components...Tests/ # xUnit (usually messenger completeness) + docs/ # device docs, wiring, device settings, TROUBLES.md +``` + +A usage example usually exists in `src/showcase/app/src/components../`. + +## Names + +- No namespaces in TwinCAT: vendor, version and (when both buses exist) bus go into every name - see the placeholder table. +- Keep the AX version folder as the version suffix (`v_X_Y_x` -> `_v_X_Y_x`). +- Keep enum member names and values exactly. + +## Workflow + +0. **Locate and read everything** of the component (all `.st` in `ctrl/src` and `ctrl/test`, the twin `.cs`, the + blazor view, `docs/`, assets). Use an Explore agent for a large component. Produce an inventory: + classes and members, every task's step ladder, the IO byte/bit map with offsets, every messenger code with text + help, + tests, simulator knobs, hardware template (module/slot shape). +1. **Grill** (tco-vendor-component Step 0, plus): bus (`Pn`/`Ecat`); library/FB names; which AX features to drop + (hardware-ID bootstrap, numeric codes, TaskTimeout are dropped by default - see mapping); whether AX steps are ported 1:1 + (default yes, comment each block `// AX step N`). The interface map is the AX encode/decode code - no manual needed, + but read the AX docs for unverified bits and keep those notes. +2. **Check the AX code before copying it.** AX components have had real bugs (e.g. a task that never reaches Done + because of a wrong step number, a parameter stored but never used). Port the intent, tell the user about each + deviation, record it in the README. +3. **Build** with tco-vendor-component: scaffold, register, IO, DUTs, functions, task base, tasks, component, twin, view. + Translate with the mapping reference. +4. **Tests**: port the AX `FakeTemplate` harness into `TcoTemplateSimulator` (same knobs: fail/silent/stuck masks, + timing counts, fault flags) and port each AxUnit test into an NUnit PLC-executed test. Tests of the AX hardware + bootstrap (`S7Harness`, HW-ID codes) are dropped together with that feature. Codec tests become mapping tests + (write raw bytes into the simulated input image, assert the decoded `_status`; set `_control`, assert output bytes). +5. **Localization**: neutral texts come from the PLC `<#...#>` literals. AX `PlcStringResources..resx` and blazor + `Strings.*.resx` are a translation source when the English text is the same - reuse their wording, then fill the gaps + (cs-CZ never exists in AX). AX help texts (C# messenger list) are merged into the TcOpen message text where useful. +6. **README**: wiring, hardware template/slot table, device settings, byte maps, troubleshooting - from AX `docs/`. + Copy GSDML/ESI from `ctrl/assets` to `assets/` and `TcoTemplateConnector/ddf/`. +7. **Report** to the user: what was dropped, AX bugs fixed, tests that could not be run. + +## Verification without TwinCAT XAE + +- **Library twin**: write a temporary filter in the repo root (`TcoTemplate.tmp.slnf`, `"path": "TcOpen.sln"`) with the + library Connector, the Xae tsproj and the TestsConnector, then + `.\_Vortex\builder\vortex.compiler.console.exe -s .\TcoTemplate.tmp.slnf -n false`. It parses the PLC declarations and + regenerates `_generated/`; `WRN ... unknown type` on library types means a misspelt name. Delete the filter afterwards. +- **Test PLC twin**: the compiler resolves types of *referenced PLC libraries* from the TwinCAT managed library repository + (`C:\TwinCAT\3.1\Components\Plc\Managed Libraries\Vortex.Library\TcoTemplate`). A brand-new library is not there until + it is built and installed from XAE, so the test-connector twin (and the NUnit project) only compile after that - say so. +- **.NET**: the connector packs `_meta\TcoTemplate.library`, which only an XAE build produces. To check that the C# + compiles earlier, put an empty placeholder file there for the build and delete it afterwards (`_meta/` is gitignored). +- ST implementation bodies are not checked by the Vortex compiler - review them, and build in XAE before release. +- In this environment bash heredocs collapse `\\`; write JSON (`.slnf`) with the Write tool or a script file. + +## Extra definition-of-done items + +- [ ] Nothing written to the AxOpen repository (`git -C status` clean). +- [ ] Every AX task, operation and public data member is either ported or listed as dropped in the README. +- [ ] No AX identifiers or syntax left in the TcOpen code: `Axo*` types, `ix-attr`, `ix-set`, `REF_TO`, `LTIME`, `THIS.` (case-sensitive search; doc comments naming the AX origin are fine, and words like `RealTime` / `MaxOutputs` are false hits of a case-insensitive search). +- [ ] Every AX test is ported or listed as not applicable. + +## Examples (reference ports) + +Read them when a detail is unclear. Do not copy vendor names, signal names or texts from them into a new component. + +| AX source | TcOpen port | What it shows | +|---|---|---| +| `components.ateq.measurement`, `AxoG6` `v_3_5_x` | `src/TcoAteqMeasurement`, `TcoAteqG6Pn_v_3_5_x` | cyclic PN with 4+4 modules mapped to one image, command handshake in an abstract task base, AX data classes as STRUCT + FUNCTIONs, simulator ported from `FakeG6`, numeric codes replaced by texts | +| `components.kuka.robotics`, `AxoKss` `v_9_3_x` | `src/TcoKukaRobotics`, `TcoKukaKssPn_v_9_3_x` / `...Ecat...` | 1:1 step port with `// AX step N`, both buses, AX bug fixed (start task never reached Done) | diff --git a/.claude/skills/axo-to-tco-migration/references/ax-to-tco-mapping.md b/.claude/skills/axo-to-tco-migration/references/ax-to-tco-mapping.md new file mode 100644 index 00000000..e75e515c --- /dev/null +++ b/.claude/skills/axo-to-tco-migration/references/ax-to-tco-mapping.md @@ -0,0 +1,108 @@ +# AX -> TcOpen translation table + +Derived from the reference ports listed in SKILL.md (Examples). +Names use the placeholder families of SKILL.md: `AxoTemplate` (AX) and `TcoTemplate` (TcOpen). + +## Component + +| AX | TcOpen | +|---|---| +| `CLASS AxoTemplate EXTENDS AXOpen.Core.AxoComponent` | `FUNCTION_BLOCK TcoTemplatePn_v_1_x_x EXTENDS TcoIo.TcoPnIoComponent` (`TcoIo.TcoEcatComponent`, `TcoCore.TcoComponent` for .NET TCP) | +| `IMPLEMENTS IAxo` (e.g. `IAxoRobotics`) | `IMPLEMENTS TcoAbstractions.ITco`; reuse the `TcoAbstractions` types instead of the AX ones | +| `METHOD PUBLIC Run(inParent : IAxoObject; hwID : UINT)` | FB body with `VAR_IN_OUT inoData : TcoTemplate_IO_v_1_x_x`; parent bound at declaration `(THIS^)` + `FB_init(bInitRetains, bInCopyCode, ParentObject : ITcoObject)` | +| `SUPER.Run(inParent); Messenger.Serve(THIS);` | `IF NOT __ISVALIDREF(inoData) ...RETURN; SUPER^(inPnIoBoxState := ..., inPnIoBoxDiag := ...); _busError := NOT _profinetReady;` | +| `InitHwCheck` / `CheckSubmodule` (`ReadSlotFromHardwareID`, `ReadHardwareIDFromSlot`, `ReadHardwareIOAddress`, size checks) | **dropped** - IO is linked in the System Manager; module sizes are fixed by the IO struct | +| `Config.HWIDs`, `AxoTemplate_HWIDs` | **dropped** | +| `DistributedIO.ReadData(hwID, _module)` per module | one `ARRAY[0..n] OF BYTE AT %I*` per module in `TcoTemplate_Inputs_v_1_x_x` (`In1..InN`, one per module), copied into an image with `MEMCPY` in `UpdateStatus` | +| `DistributedIO.WriteData` | `Out1..OutN AT %Q*` in `_Outputs_`, filled in `UpdateControl` (last statement of the body) | +| `HardwareDiagnosticsTask : AxoHardwareDiagnostics` | **dropped** - PN box state / `_busError` of `TcoPnIoComponent` | +| `Inputs : AxoTemplate_State` + `Status : AxoTemplate_Component_Status` | `_status : TcoTemplate_Status_v_1_x_x` with `ActionDescription` + `State` (+ any extra AX status data) | +| `Outputs : AxoTemplate_Control` | `_control : TcoTemplate_Control_v_1_x_x` | +| public fields `Config`, `Status`, task fields | private `_camelCase` + `PROPERTY Status : REFERENCE TO ...` / `PROPERTY XTask : TcoCore.ITcoTaskStatus` | +| `METHOD ... : IAxoTaskState` | `METHOD ... : TcoCore.ITcoTaskStatus` | +| `RestoreTask.Execute(THIS)` -> `THIS.Restore()` (calls `RestoreTask.DoneWhen(TRUE)` inside) | `IF _restoreTask.Execute() THEN Restore(); _restoreTask.DoneWhen(TRUE); END_IF`; `Restore : ITcoRestorable` = `RestoreTasks()` + safe `_control` | +| `METHOD PROTECTED OVERRIDE ManualControl` | `METHOD PROTECTED ServiceMode` | +| `Status.Action.Id := 50` | `_status.ActionDescription := '<#Restore has been executed.#>'` | + +## Tasks + +| AX (`AxoTask`) | TcOpen (`TcoCore.TcoTask`) | +|---|---| +| `CLASS ABSTRACT AxoTemplate_BaseTask EXTENDS AxoTask` | `FUNCTION_BLOCK ABSTRACT TcoTemplateTask_v_1_x_x EXTENDS TcoCore.TcoTask` | +| `Run(parent, REF(Config), REF(Status), ...)` + `refX : REF_TO T`, NULL checks | `VAR_IN_OUT inoConfig, inoControl, inoStatus (, inoImage ...)` passed every call; step 0 = `CheckReferences()` (`__ISVALIDREF`) | +| `task.SetIsDisabled(cond); task.Run(...)` | `task.Enabled := NOT cond; task(inoConfig := ..., ...)` - **polarity inverted** | +| `IsBusy() / IsDone() / HasError() / IsReady()` | properties `Busy / Done / Error / Ready` | +| `Execute(THIS)`, `Invoke(THIS)`, `Abort()` | `Execute()`, `Invoke()`, `Abort()` | +| `DoneWhen(TRUE)` | `DoneWhen(TRUE)` | +| `ThrowWhen(cond, '<#text#>')` | `ThrowWhen(cond)` has no text: store the text in a task variable first (`Fail(inText)` helper), post it from `OnError` | +| `OnStart / OnDone / OnError / OnAbort` (OVERRIDE, `SUPER.OnX()`) | `OnStart / OnDone / OnError / OnAbort` (no SUPER call needed), each guarded by `IF __ISVALIDREF(inoStatus)` | +| `OnRestore` | override `Restore : ITcoRestorable` (`SUPER^.Restore(); ...`) | +| no auto-restore | task ends with `IF THIS^.Error AND NOT _errorMessage.Pinned THEN THIS^.Restore(); END_IF`; `OnError` pins `_errorMessage` | +| `Duration` | `ElapsedTime` (rarely needed; use timers) | +| `Config.TaskTimeout` + `ThrowWhen(Duration >= ...)` | **dropped** - `Config.ErrorTime` with `_errorTimer` / `ThrowWhen(_errorTimer.Q)` (T#0S = off) | +| `Messenger.Post(Status.ActionInfo, Info)` after `InfoTime` | `Messenger.OnCondition(_infoTimer.Q).Warning/Info(...)` | +| parameters stored on the component before `Invoke` | task-local variable + `InvokeWithParams(...)` or fluent `WithParams(...)`; or `_control` data written by the operation method (cyclic) | +| sequential `IF _progress = N THEN` | same idiom; comment each block `// AX step N` (step numbers may be kept as in AX, e.g. 0/10/20/100) | +| `GoTo(step)` restarting a step timer | `_progress := step; _stepTimer(IN := FALSE);` | +| `AxoRemoteTask` | `TcoCore.TcoRemoteTask` (.NET TCP archetype) | + +## Messenger + +| AX | TcOpen | +|---|---| +| `Messenger : AxoMessenger` field + `Serve(THIS)` | built-in `Messenger`; tasks add `_errorMessage : TcoCore.TcoMessenger(THIS^)` | +| `Messenger.Activate(UINT#n, Error)` + C# `MessengerTextList` (code -> text, help) | `Messenger.Error('<#text#>')` with the AX text (and help when short) inline; **numeric codes dropped** | +| `Status.Error.Id := n` | dropped (or a diagnostic field only when the user asks) | +| categories `Error / Warning / Info / ProgrammingError / Potential` | `Error / Warning / Info / Programming / Warning` | +| `ActivateOnCondition(n, cond, cat)` | `Messenger.OnCondition(cond).(...)` | +| `Messenger.Restore()` | `UnPin()` | + +## Data types and language + +| AX | TcOpen | +|---|---| +| `CLASS` with data + methods (Decode/Encode/Add/Clear) | `STRUCT` DUT + `FUNCTION`s `Tco__v_X_Y_x(VAR_IN_OUT ...)`; FB only if it must keep state between cycles | +| `CLASS` used only as data | `STRUCT` | +| `ARRAY[*] OF BYTE` parameter | fixed bounds (`ARRAY[0..255] OF BYTE`) or `POINTER TO BYTE` + size | +| `REF_TO T`, `^`, `REF(x)`, `NULL` | `VAR_IN_OUT` (preferred), `REFERENCE TO` + `REF=`, `__ISVALIDREF` | +| `THIS.` / `SUPER.` | `THIS^.` / `SUPER^.` | +| method overloads | distinct names | +| `VAR PUBLIC/PROTECTED` | FB `VAR` + properties; inherited `VAR` are visible to subclasses | +| `LTIME`, `LT#5S` | `TIME`, `T#5S` | +| `OnDelayTimer.OnDelay(THIS, sig, t)`, `.output`, `.Restore()` | `TON`: `t(IN := sig, PT := ...)`, `.Q`, `t(IN := FALSE)` | +| `AxoBlinker` | `TcoUtilities.TcoBlinker(THIS^)` (check period) | +| `TO_INT`, `TO_REAL`, `TO_WORD` | explicit `WORD_TO_INT`, `DINT_TO_REAL`, `INT_TO_WORD` ... | +| `UINT#5`, `WORD#16#8000` | plain literals with typed context (`16#8000`) | +| `STRING` (unbounded) | `STRING(n)` - `ActionDescription : STRING(100)`, texts up to 254 | +| `x.%X3`, `%B0` | `x.3`, byte helpers / `SHL` / `TcoUtilities.TcoBytesTo*` (`eTcoDataFormat.LittleEndian`) | + +## Attributes + +| AX | TcOpen | +|---|---| +| `{#ix-set:AttributeName = "<#X#>"}` | `{attribute addProperty Name "<#X#>"}` | +| `{#ix-attr:[ReadOnly()]}` | `{attribute clr [ReadOnly()]}` | +| `{#ix-attr:[RenderIgnore()]}` | `{attribute clr [RenderIgnore()]}` or `{attribute 'hide'}` for internals | +| `{#ix-attr:[ComponentDetails(...)]}`, `[Container(...)]`, `[Group(...)]`, `{S7.extern=...}` | drop - layout is the WPF view's job | +| `///` | `(*~ ... ~*)` | +| enum | `{attribute 'qualified_only'}` + `{attribute 'strict'}` | + +## Tests and UI + +| AX | TcOpen | +|---|---| +| AxUnit `{TestFixture}` / `{Test}` in `ctrl/test` | test PLC test context + NUnit `PlcExectutedTests/` (testing.md of tco-vendor-component) | +| `_harness/Fake.st` simulator | simulator section of the test context `Main`, same knobs as `_sim*` / `_fault*` variables | +| `S7Harness` (HW-ID / ReadData mocks) | none - tests write the unlinked `_io` struct directly | +| xUnit messenger-completeness tests | none (codes dropped); `Test-TcoLocalization.ps1` checks the texts instead | +| Blazor view + tabs | WPF `/Service/ServiceView.xaml` + view model (status badges, values, task buttons, data panels) | + +## Gotchas + +- `Enabled` is the inverse of `SetIsDisabled`; re-read each interlock line. +- Several AX `IF _progress = N` blocks may advance within one cycle - the TcOpen idiom does the same; keep block order. +- AX step numbering: TcOpen adds `CheckReferences`; either insert it as an extra step before AX step 0 or check references in the body before the step blocks. +- Profinet devices with several modules: one `AT %I*` array per module; keep the AX image offsets so the decode code stays 1:1. +- Numbers that are 0-based on the bus and 1-based in AX (e.g. program or recipe numbers): keep the AX conversion in the encode/decode functions. +- AX writes the whole output image every cycle (zeroed then encoded) - do the same in `UpdateControl`. +- Unaligned multi-byte fields: decode via byte helpers, not struct overlays (TwinCAT pack mode). diff --git a/.claude/skills/tco-vendor-component/SKILL.md b/.claude/skills/tco-vendor-component/SKILL.md new file mode 100644 index 00000000..cb72474d --- /dev/null +++ b/.claude/skills/tco-vendor-component/SKILL.md @@ -0,0 +1,91 @@ +--- +name: tco-vendor-component +description: Compose a new TcOpen vendor component (PLC library + Inxton twin + WPF view + tests) or a new firmware version of an existing one. Use when the user wants a new Tco library, a new robot / device / controller generation, a new `_v_X_Y_x` variant, or asks how vendor components in this repo are built. Covers two archetypes - cyclic fieldbus IO (robots, Profinet/EtherCAT) and .NET-side TCP communication. +--- + +# TcOpen vendor component + +A vendor component is one library under `src/TcoTemplate/` made of: + +| Part | Project | Content | +|---|---|---| +| PLC library | `src/XaeTcoTemplate/TcoTemplate/TcoTemplate.plcproj` | component FB, tasks, DUTs | +| Test PLC | `src/XaeTcoTemplate/TcoTemplateTests/TcoTemplateTests.plcproj` | test contexts, simulator, GVL with IO | +| Twin | `src/TcoTemplateConnector/TcoTemplateConnector.csproj` | generated `_generated/` + hand-written `pex/*.cs` partials | +| View | `src/TcoTemplate.Wpf/TcOpen.Inxton.TcoTemplate.Wpf.csproj` | `TcoTemplate_v_1_x_xServiceView.xaml` + view model | +| Tests | `tests/TcoTemplateTestsConnector`, `tests/TcoTemplateUnitTests`, `tests/TcoTemplate.Wpf.Sandbox` | twin of test PLC, NUnit, manual sandbox | + +## Placeholder names + +All files of this skill use one generic name family. Replace it consistently when building a real component: + +| Placeholder | Meaning | Real example (cyclic / TCP reference implementation) | +|---|---|---| +| `TcoTemplate` | library, PLC namespace, C# namespace | `TcoKukaRobotics` / `TcoAimTtiPowerSupply` | +| `TcoTemplate_v_1_x_x` | component FB; `_v_1_x_x` = the real firmware/protocol version `_v___x` | `TcoKukaKssPn_v_9_3_x` / `TcoQl355P_v_1_x_x` | +| `TcoTemplate_Config_v_1_x_x`, `_Control_`, `_State_`, `_Status_` | DUTs | `TcoKukaKss_Status_v_9_3_x` / `TcoQlSeriesSupply_Status_v_1_x_x` | +| `TcoTemplate_Inputs_v_1_x_x`, `_Outputs_`, `TcoTemplate_IO_v_1_x_x` | process image (cyclic) | `TcoKukaKss_Inputs_v_9_3_x`, `TcoKukaKssPn_IO_v_9_3_x` | +| `TcoTemplateTask_v_1_x_x` | abstract task base | `TcoKukaKssTask_v_9_3_x` / `TcoQlSeriesSupplyTask` | +| `TcoTemplate_Task_v_1_x_x` | task per operation | `TcoKukaKss_StopProgramTask_v_9_3_x` / `TcoQlGetCommandTask` | +| `TcoTemplate_GetCommand_v_1_x_x`, `eTcoTemplate_GetCommands_v_1_x_x` | command DUT + enum (TCP) | `TcoQlSeriesSupply_GetControl_v_1_x_x`, `eTcoQWlSeriesSupplyGetCommands_v_1_x_x` | +| `TemplateCommand`, `TemplateCommands`, `eTemplateCommandType` | C# protocol table (TCP) | `QlSeriesCommand`, `QlSeriesCommands`, `eQlCommandType` | +| `TcoTemplateEvents_v_1_x_x` | C# event-code dictionary (cyclic) | `TcoKrc4ControllerEvents_v_5_x_x` | +| `TcoTemplateTestContext`, `eTcoTemplateTests` | test context + test enum | `TcoKukaKssTestContext`, `eTcoKukaKssTests` | + +Naming of a real component: `Tco` for the library (e.g. `TcoKukaRobotics`), `Tco_v_X_Y_x` for the FB. If both buses are ever needed, the FBs get a bus suffix (`TcoTemplatePn_v_1_x_x`, `TcoTemplateEcat_v_1_x_x`). + +Reference implementations to read when a detail is unclear: + +- cyclic: `src/TcoKukaRobotics` - KSS 9.3 generation (`POUs/Prototypes/KSS/`, `DUTs/Kss/`, `POUs/Prototypes/RoboticsTasks/Kss_v_9_3_x/`, test `Tests/TcoKukaKss/`) +- .NET TCP: `src/TcoAimTtiPowerSupply` (`POUs/Prototypes/QLSeries/`, `POUs/Prototypes/Command/`, connector `pex/`, tests `tests/TcoAimTtiPowerSupplyUnitTests/pex/`) + +Do not copy vendor names, signal names or texts from them into a new component. + +## Step 0 - grill before you build + +Do not start until these are answered (use AskUserQuestion, one decision at a time when they depend on each other): + +1. **Vendor, controller, firmware** -> library name and version suffix `_v___x`. New firmware of an existing vendor = new versioned FBs/DUTs/tasks in the existing library, not a new library. +2. **Communication** -> picks the archetype (below). +3. **Bus** (cyclic only): Profinet **or** EtherCAT. Build only the bus the project needs; the other one is added later by copying the FB and swapping base class + IO struct. +4. **Interface map**: byte/bit layout of the process image (vendor manual, GSDML/ESI) or the command protocol (manual). Do not guess bit positions - ask for the document or the table. +5. **Operations**: the list of tasks (start/stop/reset/get/set...) and the handshake of each (which outputs are written, which input confirms completion). + +## Archetype decision + +| The device talks... | Archetype | Read | +|---|---|---| +| through a fixed process image every PLC cycle (Profinet IO, EtherCAT PDO) | **cyclic IO** - all logic in PLC | [references/cyclic-io.md](references/cyclic-io.md) | +| request/response over a TCP socket (SCPI, ASCII, proprietary) | **.NET TCP** - PLC tasks are `TcoRemoteTask` mailboxes, socket code in the C# twin | [references/dotnet-tcp.md](references/dotnet-tcp.md) | +| discrete IO only | neither - see `src/TcoPneumatics` and `docs/Component.md` | - | + +There is **no PLC-side TCP (Tf6310 / Tc2_TcpIp) component** in the repo. If the user wants one, stop and agree the design first; do not invent a pattern silently. + +## Workflow + +Always read [references/plc-conventions.md](references/plc-conventions.md) and [references/project-layout.md](references/project-layout.md) first, then the archetype file, then [references/localization.md](references/localization.md) and [references/testing.md](references/testing.md). + +1. **Scaffold** the library from `src/librarytemplate` and fix the known template gaps (project-layout.md). +2. **Register** it in `TcOpen.sln` and every `*.slnf` (project-layout.md checklist). +3. **DUTs**: `_Config`, `_Status` (with `ActionDescription` + `State`), `_State`, `_Control` (cyclic) or command structs + enums (TCP), IO structs (cyclic). +4. **Task base** (abstract) + one task FB per operation. +5. **Component FB**: members, body (status update -> interlocks -> task calls -> restore -> diagnostics -> control update), `Operations` methods, `Task` properties, `Restore`/`RestoreTasks`, `ServiceMode`. +6. **Twin partials** in `TcoTemplateConnector/pex/` (diagnostics for cyclic; `Initialize()` + socket code for TCP). +7. **Service view** + view model in the Wpf project. +8. **Localize** (localization.md): Vortex build fills the neutral `Localizations.resx`; translate every new PLC and WPF text into `cs-CZ`, `de-DE`, `es-ES`, `sk-SK`; run `scripts/Test-TcoLocalization.ps1` until clean. +9. **Test PLC**: test context with simulator (cyclic) or a test context calling the operations (TCP); add it to `MAIN`. +10. **NUnit tests** (testing.md). +11. **Sandbox** app showing the component in `PresentationType="Service"`. +12. **README.md** of the library (template has `ENTER ...` placeholders) with wiring/IO table and screenshot. + +## Definition of done + +- [ ] Names follow `Tco_v_X_Y_x`; no `%I`/`%Q` inside the component FB; no leftover `TcoTemplate` / `PlcTemplate` placeholders. +- [ ] Every task: messenger warnings while waiting, error timer -> `ThrowWhen`, `OnError` pins the message, `Restore` unpins. +- [ ] Every task restored by `RestoreTasks()`; restore task wired in the body. +- [ ] Projects registered in `TcOpen.sln` + `TcOpen.slnf`, `TcOpen.build.slnf`, `TcOpen.plc.slnf`, `TcOpen.XAEs.slnf`, `TcOpen.test.build.plc.slnf` and the library's own `.slnf`. +- [ ] Unique project GUIDs (not copied from the template). +- [ ] `scripts/Test-TcoLocalization.ps1 -LibraryPath src\TcoTemplate` reports `Errors: 0` for `cs-CZ`, `de-DE`, `es-ES`, `sk-SK`; new translations listed in the PR description. +- [ ] Tests from testing.md exist and pass (`dotnet test` for pure .NET tests; PLC-executed tests need `Tc3Target` and the test PLC running on AMS port 852 - say so if you could not run them). +- [ ] .NET TCP: no swallowed exceptions in remote task actions. +- [ ] No stub files copied from other libraries (e.g. an empty test class with another library's namespace). diff --git a/.claude/skills/tco-vendor-component/references/cyclic-io.md b/.claude/skills/tco-vendor-component/references/cyclic-io.md new file mode 100644 index 00000000..dcbb09e9 --- /dev/null +++ b/.claude/skills/tco-vendor-component/references/cyclic-io.md @@ -0,0 +1,126 @@ +# Archetype A - cyclic fieldbus IO (robots, Profinet / EtherCAT) + +Reference implementation: `src/TcoKukaRobotics`, KSS 9.3 generation. The same pattern is used by the other robotics, vision (Dataman/Insight) and press (EtherCAT) libraries. + +All logic is in the PLC. The C# twin only adds diagnostics; there are no remote tasks. + +## IO structs (in `POUs/Prototypes//IO/`) + +```st +TYPE TcoTemplate_Inputs_v_1_x_x : +STRUCT + Inputs AT %I* : ARRAY[0..63] OF BYTE; // size = configured process image +END_STRUCT +END_TYPE + +TYPE TcoTemplate_IO_v_1_x_x : // Profinet +STRUCT + PnIoBoxState AT %I* : UINT; + PnIoBoxDiag AT %I* : UINT; + PnIoBoxCtrl AT %Q* : UINT; + {attribute addProperty Name "<#IN#>"} + In : TcoTemplate_Inputs_v_1_x_x; + {attribute addProperty Name "<#OUT#>"} + Out : TcoTemplate_Outputs_v_1_x_x; +END_STRUCT +END_TYPE + +TYPE TcoTemplate_IO_v_1_x_x : // EtherCAT: In/Out only +STRUCT + {attribute addProperty Name "<#IN#>"} + In : TcoTemplate_Inputs_v_1_x_x; + {attribute addProperty Name "<#OUT#>"} + Out : TcoTemplate_Outputs_v_1_x_x; +END_STRUCT +END_TYPE +``` + +Raw byte arrays, sized to the configured process image. The application declares an instance in a GVL (`Device1 : TcoTemplate_IO_v_1_x_x;`), links it in the System Manager and passes it as `inoData`. + +## Status / Control mapping + +- `TcoTemplate_State_v_1_x_x`: one named member per device signal (`Ready`, `DrivesReady`, `ProgramActive`, `Error`, `EventId`, ...). +- `TcoTemplate_Control_v_1_x_x`: one named member per PLC request (`ProgramEnable`, `DrivesOn`, `ErrorAck`, `ActionNo`, `Coordinates`, ...). +- `METHOD INTERNAL UpdateStatus` unpacks inputs, called right after `SUPER^`: + + ```st + index := 0; + _status.State.Ready := inoData.In.Inputs[index].0; + _status.State.DrivesReady := inoData.In.Inputs[index].1; + ... + ``` + +- `METHOD INTERNAL UpdateControl` packs `_control` into `inoData.Out.Outputs[...]` - last statement of the body. +- Put the byte/bit map as a comment table in the docu of the component FB and in the README; tests assert it (testing.md). +- Signal names come from the vendor manual of the new device - never reuse another vendor's signal names. + +## Component body specifics + +Profinet (`EXTENDS TcoIo.TcoPnIoComponent`): + +```st +SUPER^(inPnIoBoxState := THIS^.inoData.PnIoBoxState, inPnIoBoxDiag := THIS^.inoData.PnIoBoxDiag); +_busError := NOT _profinetReady; +UpdateStatus(); +``` + +EtherCAT (`EXTENDS TcoIo.TcoEcatComponent`): + +```st +SUPER^(AdsAddr := AdsAddr); +_busError := NOT SUPER^._ecatState.EcatOk; +UpdateStatus(); +``` + +Label `_busError` `<#PN Error#>` or `<#ECat Error#>`. + +Interlocks: + +- start tasks are disabled while any stop task is `Busy`; competing start tasks disable each other +- stop tasks are always `Enabled := TRUE` +- `ResetAllOutputs` only when no task is active (`_someTaskIsActive`) +- safety diagnostics (E-stop, safety switch) are reported only while a task is active, so an unused device does not flood alarms +- controller error: `_errorReportTimer(IN := _status.State.Error, PT := _config.InfoTime)` then `Messenger.OnCondition(_errorReportTimer.Q).Error(... EventId ... ' |[[0]AdvancedDiagnosticMessage]|' ...)` - the `|[[0]Property]|` placeholder is resolved by the twin property + +## Robotics contract + +`IMPLEMENTS TcoAbstractions.ITcoRobotics` (`src/TcoAbstractions/src/XAE/XAE/TcoAbstractions/Robotics/`): `StartAtMain`, `StartMotorsAndProgram`, `StartMovements(TcoRoboticsMovementsParams)`, `StopMovements(eTcoRoboticsStopType)`, `StopMovementsAndProgram(eTcoRoboticsStopType)`. Reuse `TcoRoboticsMovementsParams`, `TcoRoboticsCoordinates`, `eTcoRoboticsStopType`, `eTcoRoboticsDistance` - do not redefine them. + +Usual task set (adapt to the device's handshake): StartAtMain, StartMotors, StartProgram, StartMotorsAndProgram, StartMovements, StartMotorsProgramAndMovements, StopMovements, StopMovementsAndProgram, StopProgram, StopMotors, ResetAllOutputs (+ Restore). `StartMovements` writes ActionNo/tool/workobject/point/speed/coordinates to `_control` and waits for the device to mirror them back (handshake), then for in-position. + +## Single bus + +Build only the bus the project needs. The second bus = copy the FB, add the bus suffix to both names (`TcoTemplatePn_v_1_x_x`, `TcoTemplateEcat_v_1_x_x`), change `EXTENDS`, the `inoData` type, the `SUPER^` call and the bus-error label; everything else (DUTs, tasks, Inputs/Outputs) is shared. + +## Twin (`TcoTemplateConnector/pex/TcoTemplate_v_1_x_x.cs`) + +Only diagnostics, e.g. an event code dictionary and a property used by the messenger placeholder: + +```csharp +namespace TcoTemplate +{ + public partial class TcoTemplate_v_1_x_x + { + public string AdvancedDiagnosticMessage + { + get + { + // parse the event number from _messenger._mime.Text and look it up in TcoTemplateEvents_v_1_x_x.Ids + } + } + } +} +``` + +Event tables live in `pex/TcoTemplateEvents_v_1_x_x.cs` (`public static Dictionary Ids`), filled from the vendor's message list. + +## View (`TcoTemplate.Wpf//Service/`) + +- `TcoTemplate_v_1_x_xServiceView.xaml` + `.xaml.cs` (design-time `DataContext = new TcoTemplate_v_1_x_xServiceViewModel()`), and `TcoTemplate_v_1_x_xServiceViewModel.cs` with `public class TcoTemplate_v_1_x_xViewModel : TcoTemplate_v_1_x_xServiceViewModel {}`. +- View model base: `RenderableViewModel` with `Component { get; }` and `Model => Component`; if the library gets several generations, introduce a generic `TcoTemplateBaseServiceViewModel` (pattern exists in the cyclic reference implementation). +- XAML: `DataContext="{Binding Component}"`, status flags with `vortex:BooleanToVisibilityConverter`, `vortex:RenderableContentControl` bound to each task (`DataContext="{Binding _resetAllOutputsTask}"`), texts from `p:strings` resources - translated per [localization.md](localization.md). +- Only the Service view is required; the renderer picks it for `PresentationType="Service"`. + +## Device description files + +GSDML (Profinet) / ESI (EtherCAT) go to `assets/` and `TcoTemplateConnector/ddf/`; reference them in the README with the module configuration that matches the IO struct sizes. diff --git a/.claude/skills/tco-vendor-component/references/dotnet-tcp.md b/.claude/skills/tco-vendor-component/references/dotnet-tcp.md new file mode 100644 index 00000000..dab53e89 --- /dev/null +++ b/.claude/skills/tco-vendor-component/references/dotnet-tcp.md @@ -0,0 +1,133 @@ +# Archetype B - .NET-side TCP communication + +Reference implementation: `src/TcoAimTtiPowerSupply` (line-based SCPI-like protocol). + +The PLC owns the API and the state machine; each operation is a `TcoCore.TcoRemoteTask` that the C# twin executes. The socket code lives in the twin partial class. + +## How a remote task runs + +1. PLC: `_getCommandTask.WithParams(cmd).Invoke()` -> `TcoRemoteTask` writes `_startSignature`. +2. .NET: `TcoRemoteTask.ExecuteAsync` (`src/TcoCore/src/TcoCoreConnector/pex/TcoRemoteTask/TcoRemoteTask.cs`) sees the new signature and runs the action registered with `InitializeExclusively(...)` on a worker thread. +3. Success -> `_doneSignarure := _startSignature` (sic) -> PLC `DoneWhen(...)` -> task Done. +4. **Exception** -> `_hasException := TRUE`, `_exceptionMessage := ex.Message`, logged via `TcoAppDomain.Current.Logger.Error`, Done is NOT signalled -> PLC `ThrowWhen(TRUE)` + `Messenger.Error(_exceptionMessage)` -> task Error -> `OnError` pins the alarm. +5. If the twin never called `Initialize()`, `_isInitialized` stays FALSE: the PLC task posts `Messenger.Programming('Remote call not initialized.')` and never finishes - the application/sandbox **must** call `component.Initialize()` after `BuildAndStart()`. + +## PLC side + +```st +FUNCTION_BLOCK TcoTemplate_v_1_x_x EXTENDS TcoCore.TcoComponent +VAR + {attribute addProperty Name "<#Status#>"} _status : TcoTemplate_Status_v_1_x_x; + {attribute addProperty Name "<#Config#>"} _config : TcoTemplate_Config_v_1_x_x; + {attribute addProperty Name "<#Get Command#>"} _getCommandTask : TcoTemplate_GetCommandTask_v_1_x_x(THIS^); + {attribute addProperty Name "<#Set Command#>"} _setCommandTask : TcoTemplate_SetCommandTask_v_1_x_x(THIS^); + {attribute addProperty Name "<#Restore#>"} _restoreTask : TcoCore.TcoTask(THIS^); +END_VAR +// body: _getCommandTask(inoConfig := _config, inoStatus := _status); _setCommandTask(...); restore task pattern +``` + +- Config: `InfoTime`, `ErrorTime`, `IpAddress : STRING`, `Port : UINT := `, `Timeout : UINT := 1000` (ms, used for socket send/receive). +- Status: `ActionDescription : STRING(100)` + `State` with the raw `Response`, the parsed values and a `ConvertMessage : STRING` for parse errors. +- Command DUT per direction (`TcoTemplate_GetCommand_v_1_x_x`: `Command : eTcoTemplate_GetCommands_v_1_x_x; Channel`; `TcoTemplate_SetCommand_v_1_x_x`: + `Value`) and command enums whose member names equal the keys of the C# command table. +- Task base `TcoTemplateTask_v_1_x_x EXTENDS TcoCore.TcoRemoteTask` with `VAR_IN_OUT inoConfig, inoStatus`, `_errorMessage : TcoMessenger`, timers, `OnStart/OnDone/OnError/Restore` as in plc-conventions.md (call `SUPER^.OnX()` first - `TcoRemoteTask` has its own). +- Derived tasks hold `_command` and expose `METHOD WithParams : REFERENCE TO TcoTemplate_GetCommandTask_v_1_x_x`. +- Generic operations `GetCommand(inCommand)`/`SetCommand(inCommand)` + typed convenience operations: + + ```st + METHOD PUBLIC GetValue : TcoCore.ITcoTaskStatus + VAR_INPUT inChannel : USINT; END_VAR + VAR_OUTPUT outValue : REAL; END_VAR + VAR command : TcoTemplate_GetCommand_v_1_x_x; END_VAR + --- + outValue := 0; + command.Command := eTcoTemplate_GetCommands_v_1_x_x.Value; + command.Channel := inChannel; + GetValue := GetCommand(inCommand := command); + IF GetValue.Done THEN outValue := Status.State.Value; END_IF + ``` + +## .NET side (`TcoTemplateConnector/pex/TcoTemplate_v_1_x_x.cs`) + +Partial class in the namespace of the PLC library (= twin namespace): + +```csharp +namespace TcoTemplate +{ + public partial class TcoTemplate_v_1_x_x + { + public void Initialize() + { + _getCommandTask.InitializeExclusively(InvokeGetCommand); + _setCommandTask.InitializeExclusively(InvokeSetCommand); + } + + // Exceptions are intentionally not caught here: TcoRemoteTask reports them to the PLC (_hasException) + // and to the logger, and does not signal Done. + internal void InvokeGetCommand() + { + this.Read(); // fresh config + command from PLC + var cmd = FindCommand(eTemplateCommandType.Get, Enum.GetName(typeof(eTcoTemplate_GetCommands_v_1_x_x), _getCommandTask._command.Command.LastValue)); + var message = cmd.Syntax.Replace("", _getCommandTask._command.Channel.LastValue.ToString()); + + using (TcpClient client = new TcpClient(_config.IpAddress.LastValue, _config.Port.LastValue)) + { + client.SendTimeout = _config.Timeout.LastValue; + client.ReceiveTimeout = _config.Timeout.LastValue; + using (NetworkStream stream = client.GetStream()) + using (StreamWriter writer = new StreamWriter(stream)) + using (StreamReader reader = new StreamReader(stream)) + { + writer.WriteLine(message); + writer.Flush(); + var response = reader.ReadLine(); + if (string.IsNullOrWhiteSpace(response)) + throw new IOException($"No response from {_config.IpAddress.LastValue}:{_config.Port.LastValue} to '{message.Trim()}'."); + // parse into _status.State.*.Cyclic ... + _status.State.Write(); // push parsed values to PLC + if (!string.IsNullOrEmpty(_status.State.ConvertMessage.Cyclic)) + throw new FormatException(...); // after Write(), so the operator sees the raw response + } + } + } + + private static TemplateCommand FindCommand(eTemplateCommandType type, string key) + { + var cmd = TemplateCommands.Commands.FirstOrDefault(p => p.Type == type && p.Key == key); + if (cmd == null) + throw new InvalidOperationException($"Command '{key}' of type {type} is not defined in {nameof(TemplateCommands)}."); + return cmd; + } + } +} +``` + +Rules: + +- **Never catch-and-swallow in a remote task action** (no `catch { Console.WriteLine }`). A swallowed exception makes the PLC task report Done for a command that failed. Let it propagate, or catch to add context and rethrow. +- Throw on: unknown command (`FindCommand` instead of `FirstOrDefault` + null dereference), no/empty response, unparsable response, device error replies. +- Always apply `Timeout` to both send and receive; the PLC `ErrorTime` is the outer watchdog. +- Read inputs with `this.Read()` + `.LastValue`; write results to `.Cyclic` then `.Write()` the struct. +- Keep the protocol table in its own class (`pex/TemplateCommand.cs`: `TemplateCommand { Key, Syntax, ResponseSyntax, HelpDescription, Type }`, `static class TemplateCommands { Commands }`, `enum eTemplateCommandType { Get, Set }`) so tests can check that every PLC enum member has an entry. +- Make the invoke methods `internal` and add `[assembly: InternalsVisibleTo("TcoTemplateUnitTests")]` to the connector `Properties/AssemblyInfo.cs` so tests can call them without a PLC. +- Opening a connection per command is fine for slow command rates. For high rates or devices that require a session, keep one client per component, guard it with a lock, and reconnect on failure - agree this with the user first. +- Logging beyond the automatic remote-task logging: `TcOpen.Inxton.TcoAppDomain.Current.Logger`, never `Console`. + +## View + +Service view only (`TcoTemplate_v_1_x_xServiceView.xaml` + `TcoTemplate_v_1_x_xViewModel.cs` / `TcoTemplate_v_1_x_xServiceViewModel`): `tcoCore:TcoComponentView` with the restore task in `ComponentHeader` and GroupBoxes for config (`PresentationType="ControlSlim"`), status (`"DisplaySlim"`) and the command tasks in `ComponentDetails`. View texts in `strings*.resx`, translated per [localization.md](localization.md). + +Exception messages thrown from remote task actions are shown to the operator as-is (`_exceptionMessage`); they are not localized - keep them short and technical (device, address, command, response). + +## Sandbox + +```csharp +var plc = TcoTemplateTests.Entry.TcoTemplateTestsPlc; +TcOpen.Inxton.TcoAppDomain.Current.Builder + .SetPlcDialogs(DialogProxyServiceWpf.Create(new[] { plc.MAIN._wpfContext })) + .SetUpLogger(new TcOpen.Inxton.Logging.SerilogAdapter()) + .SetDispatcher(TcoCore.Wpf.Threading.Dispatcher.Get); +plc.Connector.BuildAndStart(); +plc.MAIN._wpfContextCall.Synchron = true; +plc.MAIN._wpfContext._serviceModeActive.Synchron = true; +plc.MAIN._wpfContext._component.Initialize(); // registers the remote tasks +``` diff --git a/.claude/skills/tco-vendor-component/references/localization.md b/.claude/skills/tco-vendor-component/references/localization.md new file mode 100644 index 00000000..b1fec224 --- /dev/null +++ b/.claude/skills/tco-vendor-component/references/localization.md @@ -0,0 +1,66 @@ +# Localization (language versions) + +Every component ships its texts in the **predefined cultures: `cs-CZ`, `de-DE`, `es-ES`, `sk-SK`** (neutral = English). `es-MX` files exist in some libraries but are not required - do not create or fill them unless asked. + +Translations are written by Claude; list them in the PR description so a native speaker can review. + +## Where texts live + +| Text source | Neutral file (who writes it) | Culture files (who writes them) | +|---|---|---| +| PLC: `'<#Text#>'` in code, `{attribute addProperty Name "<#Text#>"}` on declarations | `Connector/Properties/Localizations.resx` - **generated by the Vortex compiler** on build | `Localizations..resx` - by hand | +| WPF: `{x:Static p:strings.Key}` in XAML | `.Wpf/Properties/strings.resx` - by hand | `strings..resx` - by hand (casing varies, e.g. `strings.sk-Sk.resx`; keep the existing name) | + +`Localizations.Designer.cs` is not used for PLC text lookup; it may stay stale. `strings.Designer.cs` **is** used by `x:Static` - every WPF key needs its property there. + +## Key rule (PLC texts) + +Key = `_` + the literal `<#Text#>` with every non-alphanumeric character replaced by `_`: + +| PLC literal | Key | Value | +|---|---|---| +| `<#Stop program started.#>` | `___Stop_program_started___` | `Stop program started.` | +| `<#Waiting for signal: #>` | `___Waiting_for_signal____` | `Waiting for signal: ` | +| `<# is OFF#>` | `____is_OFF__` | ` is OFF` | +| `<#Emergency stop active#>` | `___Emergency_stop_active__` | `Emergency stop active` | + +- Spaces and punctuation inside `<#…#>` change both key and value: `<#Waiting for signal#>` and `<#Waiting for signal: #>` are two different keys. +- Keep the neutral value's leading/trailing spaces in every translation - fragments are concatenated (`'<#Waiting for signal: #>'` + symbol + `'<# is OFF#>'`). + +## Writing rules + +- Every operator-visible PLC text goes in `<#…#>`; symbols (`_varInfo.Symbol`), numbers and `|[[0]Property]|` placeholders stay outside. +- Prefer one whole sentence per key over concatenated fragments when the word order differs between languages. +- Do not translate the vendor's signal / interface names (as written in the vendor manual, e.g. `ProgramActive`, `IN`, `OUT`); a translation equal to the English value is fine for those. +- Reuse the terminology already in the repo's culture files (grep the culture resx of the same library, then of the other vendor libraries, for the English phrase first). Existing terminology: + + | English | cs-CZ | de-DE | es-ES | sk-SK | + |---|---|---|---|---| + | Waiting for signal | Čekání na signál | Warten auf das Signal | Esperando señal | Čakanie na signál | + | Stop program started. | Zastavení programu spuštěno. | Programm anhalten gestartet. | Detener programa iniciado. | Zastavenie programu spustené. | + | Local emergency stop active | Aktivní lokální nouzové zastavení | Lokaler Not-Halt aktiv | Parada de emergencia local activa | Aktívne lokálne núdzové zastavenie | + +- Translate the meaning, not a typo: if the English source is wrong (e.g. `Start movements stared.` -> means "started"), fix the PLC literal or at least translate the intended meaning, and tell the user. + +## Procedure + +1. Write the PLC texts with `<#…#>`; build with Vortex so `Localizations.resx` gets the new keys. (If the build is not available, add the neutral keys by the key rule - the next Vortex build will keep them.) +2. Run the check: + ```powershell + & .\.claude\skills\tco-vendor-component\scripts\Test-TcoLocalization.ps1 -LibraryPath src\TcoTemplate + ``` +3. For every `MISSING` key add to each culture file, next to the related keys: + ```xml + + Zastavenie programu spustené. + + ``` + Remove `STALE` keys only after confirming the PLC text was really removed/renamed (then translate the new key). +4. WPF texts: add the key to `strings.resx` **and** every `strings..resx`, then add the property to `strings.Designer.cs` (regenerate in Visual Studio - "Run Custom Tool" - or copy an existing property pattern). +5. Re-run the check until it reports `Errors: 0`. Review the `SAME` warnings: acceptable for signal names, otherwise translate. +6. Build the connector/Wpf project and check the satellite assemblies exist: `bin\Debug\net48\{cs-CZ,de-DE,es-ES,sk-SK}\.resources.dll`. + +## File hygiene + +- resx files are UTF-8 (with BOM) and CRLF - keep it; diacritics must survive. The scaffold script writes with `Set-Content` (ANSI on PowerShell 5.1), so check scaffolded resx files. +- Edit by inserting `` elements; do not reorder or reformat existing entries (keeps diffs reviewable). diff --git a/.claude/skills/tco-vendor-component/references/plc-conventions.md b/.claude/skills/tco-vendor-component/references/plc-conventions.md new file mode 100644 index 00000000..ac84809c --- /dev/null +++ b/.claude/skills/tco-vendor-component/references/plc-conventions.md @@ -0,0 +1,159 @@ +# PLC conventions (both archetypes) + +Source of truth: `docs/Component.md` + the reference implementations listed in SKILL.md. All names below use the `TcoTemplate` placeholder family (see SKILL.md, "Placeholder names"). + +## Naming + +| Element | Pattern | +|---|---| +| Component FB | `TcoTemplate_v_1_x_x` (bus suffix only if both buses exist: `TcoTemplatePn_v_1_x_x`) | +| DUTs | `TcoTemplate_Config_v_1_x_x`, `TcoTemplate_Control_v_1_x_x`, `TcoTemplate_State_v_1_x_x`, `TcoTemplate_Status_v_1_x_x` | +| IO DUTs | `TcoTemplate_Inputs_v_1_x_x`, `TcoTemplate_Outputs_v_1_x_x`, `TcoTemplate_IO_v_1_x_x` | +| Task base | `TcoTemplateTask_v_1_x_x` (ABSTRACT) | +| Tasks | `TcoTemplate_Task_v_1_x_x`, e.g. `TcoTemplate_StopProgramTask_v_1_x_x` | +| Private members | `_camelCase`: `_stopProgramTask`, `_config` | +| FB body params | `in...` (VAR_INPUT), `out...` (VAR_OUTPUT), `ino...` (VAR_IN_OUT): `inoData`, `inoConfig` | +| Enums | `eTcoTemplate...`, `{attribute 'qualified_only'}` + `{attribute 'strict'}` | + +- **No `%I*`/`%Q*` inside the component.** IO structs carry the `AT %I*`/`%Q*` and are instantiated in the application (GVL) and passed in as `inoData`. +- Every user-visible member / text is localizable: `{attribute addProperty Name "<#Text#>"}` on declarations and `'<#Text#>'` in strings. Key rule, cultures and translation procedure: [localization.md](localization.md). +- Read-only status in the UI: `{attribute clr [ReadOnly()]}`; hidden internals: `{attribute 'hide'}`. + +## Component FB + +```st +FUNCTION_BLOCK TcoTemplate_v_1_x_x EXTENDS TcoIo.TcoPnIoComponent // base class by archetype, see below +VAR_INPUT + inEnable : BOOL; +END_VAR +VAR_IN_OUT + inoData : TcoTemplate_IO_v_1_x_x; // cyclic only +END_VAR +VAR + {attribute addProperty Name "<#Status#>"} + {attribute clr [ReadOnly()]} + _status : TcoTemplate_Status_v_1_x_x; + {attribute addProperty Name "<#Control#>"} + _control : TcoTemplate_Control_v_1_x_x; // cyclic only + {attribute addProperty Name "<#Config#>"} + _config : TcoTemplate_Config_v_1_x_x; +END_VAR +VAR + {attribute addProperty Name "<#Stop program#>"} + _stopProgramTask : TcoTemplate_StopProgramTask_v_1_x_x(THIS^); + // ... one member per task ... + {attribute addProperty Name "<#Restore#>"} + _restoreTask : TcoCore.TcoTask(THIS^); +END_VAR +VAR + {attribute 'hide'} + _sb : TcoCore.StringBuilder; +END_VAR +``` + +Base class: `TcoCore.TcoComponent` (TCP, discrete), `TcoIo.TcoPnIoComponent` (Profinet), `TcoIo.TcoEcatComponent` (EtherCAT). Robots add `IMPLEMENTS TcoAbstractions.ITcoRobotics` (cyclic-io.md). + +Members of the FB (TwinCAT folders `Operations` and `Task`): + +| Member | Shape | +|---|---| +| Operation method | `METHOD PUBLIC StopProgram : TcoCore.ITcoTaskStatus` -> `StopProgram := _stopProgramTask.Invoke();` (with params: `_task.InvokeWithParams(inX)` or `_task.WithParams(inX).Invoke()`) | +| Task property | `PROPERTY StopProgramTask : TcoCore.ITcoTaskStatus` -> `StopProgramTask := _stopProgramTask;` | +| `Config`/`Status`/`Control` | `PROPERTY Status : REFERENCE TO TcoTemplate_Status_v_1_x_x` -> `Status REF= _status;` | +| `Restore : ITcoRestorable` | `RestoreTasks();` then reset `_control` outputs to safe values | +| `RestoreTasks` (INTERNAL) | `.Restore()` of every task | +| `ServiceMode` (PROTECTED) | override, may be empty | +| `FB_init` | `(bInitRetains, bInCopyCode, ParentObject : ITcoObject)` | + +Body order: + +1. guard `IF NOT __ISVALIDREF(inoData) THEN Messenger.Post('Invalid reference', TcoCore.eMessageCategory.ProgrammingError); RETURN; END_IF` +2. `SUPER^(...)` and bus error (cyclic) +3. `UpdateStatus()` (cyclic) +4. interlocks via `task.Enabled := ...` then `task(inoConfig := _config, inoControl := _control, inoStatus := _status);` for every task +5. restore task: + + ```st + _restoreTask.Enabled := TRUE; + IF _restoreTask.Execute() THEN + Restore(); + _restoreTask.DoneWhen(TRUE); + END_IF + ``` + +6. diagnostics: `Messenger.OnCondition(timer.Q).Error(...)` only while a task is active / after a delay +7. `UpdateControl()` (cyclic) - last, so outputs reflect this cycle's task decisions. + +## Task base (abstract) + +```st +FUNCTION_BLOCK PUBLIC ABSTRACT TcoTemplateTask_v_1_x_x EXTENDS TcoCore.TcoTask // TcoCore.TcoRemoteTask for .NET TCP +VAR_IN_OUT + inoConfig : TcoTemplate_Config_v_1_x_x; + inoControl : TcoTemplate_Control_v_1_x_x; // cyclic only + inoStatus : TcoTemplate_Status_v_1_x_x; +END_VAR +VAR + _errorMessage : TcoCore.TcoMessenger(THIS^); + {attribute 'hide'} _progress : INT := 0; + {attribute 'hide'} _infoTimer : TON; + {attribute 'hide'} _errorTimer : TON; + {attribute 'hide'} _timer : TON; + {attribute 'hide'} _varInfo : __SYSTEM.VAR_INFO; + {attribute 'hide'} _sb : TcoCore.StringBuilder; +END_VAR +``` + +Methods: + +- `CallTimers(inValue : BOOL)` - runs `_errorTimer`/`_infoTimer` with `inoConfig.ErrorTime`/`InfoTime` (a time of `T#0S` disables that timer). +- `CheckReferences : BOOL` - `__ISVALIDREF` of each `ino*`, posts `Messenger.Programming('<#Invalid reference: #>' + symbol).Pin()`. +- `Restore : ITcoRestorable` - `SUPER^.Restore(); _progress := 0; _timer(In:=FALSE); CallTimers(FALSE); Messenger.UnPin(); _errorMessage.UnPin();` + +Config always has `InfoTime : TIME := T#2S; ErrorTime : TIME := T#0S;` (0 = no timeout). Status always has `ActionDescription : STRING(100)` + `State`. + +## Task FB - canonical body + +```st +FUNCTION_BLOCK TcoTemplate_StopProgramTask_v_1_x_x EXTENDS TcoTemplateTask_v_1_x_x +--- +IF Execute() THEN + IF _progress = 0 THEN + IF CheckReferences() THEN + _progress := _progress + 1; + END_IF + END_IF + IF _progress = 1 THEN + inoControl.ProgramEnable := FALSE; // write request + _varInfo := __VARINFO(inoStatus.State.ProgramActive); + THIS^.Messenger.OnCondition(_infoTimer.Q AND inoStatus.State.ProgramActive).Warning(_sb.Clear().Append('<#Waiting for signal: #>').Append(_varInfo.Symbol).Append('<# is OFF#>').ToString()); + IF NOT inoStatus.State.ProgramActive THEN // wait for confirmation + _progress := _progress + 1; + END_IF + END_IF + IF _progress = 2 THEN + DoneWhen(TRUE); + END_IF + CallTimers(TRUE); + THIS^.ThrowWhen(_errorTimer.Q); +END_IF +IF THIS^.Error AND NOT _errorMessage.Pinned THEN + THIS^.Restore(); +END_IF +``` + +`ProgramEnable` / `ProgramActive` stand for the device's real request and confirmation signals. + +Reset `CallTimers(FALSE)` when moving to a step that needs a fresh timeout. Lifecycle overrides (each guarded with `IF __ISVALIDREF(inoStatus) THEN ... END_IF`): + +- `OnStart`: `ActionDescription := '<#Stop program started.#>'; CallTimers(FALSE);` +- `OnDone`: `ActionDescription := '<#Stop program finished successfully.#>'; _progress := 0;` +- `OnAbort`: `ActionDescription := '<#Stop program was aborted.#>';` +- `OnError`: `ActionDescription := description; _errorMessage.Error(_sb.Clear().Append(description).Append(' To restore acknowledge this alarm.').ToString()).Pin();` +- `Restore`: `SUPER^.Restore();` + +Parameters: a task-local variable plus `METHOD INTERNAL InvokeWithParams : ITcoTaskStatus` (`_x := inX; InvokeWithParams := THIS^.Invoke();`), or a fluent `METHOD WithParams : REFERENCE TO TcoTemplate_Task_v_1_x_x` (`_command := inCommand; WithParams REF= THIS^;`) used as `_task.WithParams(cmd).Invoke()`. + +## Docs comments + +Component and important methods carry `(*~ ... ~*)` blocks - describe the device, the interface size and the differences against the previous firmware version there. diff --git a/.claude/skills/tco-vendor-component/references/project-layout.md b/.claude/skills/tco-vendor-component/references/project-layout.md new file mode 100644 index 00000000..a4962b84 --- /dev/null +++ b/.claude/skills/tco-vendor-component/references/project-layout.md @@ -0,0 +1,80 @@ +# Project layout, scaffolding, registration + +## Target tree + +```text +src/TcoTemplate/ + README.md + TcoTemplate.slnf + assets/ # screenshots, GSDML/ESI files + src/ + XaeTcoTemplate/XaeTcoTemplate.tsproj + TcoTemplate/TcoTemplate.plcproj # the library + DUTs// # TcoTemplate_Config/_Control/_State/_Status_v_1_x_x + POUs/Prototypes// # TcoTemplate_v_1_x_x + POUs/Prototypes//IO/ # TcoTemplate_Inputs/_Outputs/_IO_v_1_x_x (cyclic) + POUs/Prototypes//_v_1_x_x/ # TcoTemplateTask_v_1_x_x + TcoTemplate_Task_v_1_x_x + TcoTemplateTests/TcoTemplateTests.plcproj # test PLC (ADS port 852) + GVLs/GVL.TcGVL # IO instances linked to hardware + POUs/MAIN.TcPOU + Tests/TcoTemplate/TcoTemplateTestContext.TcPOU, eTcoTemplateTests.TcDUT + TcoTemplateConnector/TcoTemplateConnector.csproj + Entry.cs, pex/*.cs, Properties/AssemblyInfo.cs, Properties/Localizations*.resx, ddf/ (device files) + TcoTemplate.Wpf/TcOpen.Inxton.TcoTemplate.Wpf.csproj + /Service/TcoTemplate_v_1_x_xServiceView.xaml(.cs), TcoTemplate_v_1_x_xServiceViewModel.cs, Properties/strings*.resx + tests/ + TcoTemplateTestsConnector/ # twin of the test PLC + TcoTemplateUnitTests/ # NUnit: TestSetupFixture, ConnectorFixture, MockRootObject, PlcExectutedTests/, pex/ + TcoTemplate.Wpf.Sandbox/ # WPF exe +``` + +One folder per controller generation; the firmware lives in the `_v_X_Y_x` suffix of every FB, DUT and task of that generation. + +## Scaffold + +```powershell +cd D:\MTS\Develop\Inxton\TcOpen\src\librarytemplate # must be run from here: target = parent folder +.\scaffoldnewlibrary.ps1 -libraryName TcoTemplate # real library name here; no '.' or spaces; -baseDirectory is ignored +``` + +The script copies the template, replaces the literal `PlcTemplate` in file contents and names, then deletes the copied `.ps1` and `.slnf`. Fix afterwards: + +1. **Project GUIDs are NOT regenerated.** Give new GUIDs to every tsproj, plcproj and csproj (`ProjectGuid`) and to the PLC project instances inside the tsproj, then use the new ones in `TcOpen.sln`. Duplicate GUIDs break the solution. +2. **Recreate `src/TcoTemplate/TcoTemplate.slnf`** - copy an existing library's `.slnf` (e.g. `src/TcoKukaRobotics/TcoKukaRobotics.slnf`) and rename paths (`"path": "..\\..\\TcOpen.sln"`). +3. Delete copied `bin/`, `obj/`, `_generated/` content, if any. +4. Script uses `Set-Content` (ANSI on PowerShell 5.1): re-check non-ASCII characters in `.resx` and source files - resx must stay UTF-8 or the cs/de/es/sk translations break (see [localization.md](localization.md)). +5. Remove the template sample (`fbSampleComponent`, `SampleComponent/`, `SampleContext`, Wpf `_Sample/`, `SampleComponentTests`) once the real component exists. +6. Fill in `README.md` placeholders (`ENTER ...`). + +## Registration checklist (repo root) + +| File | Add | +|---|---| +| `TcOpen.sln` | solution folder `TcoTemplate` with nested `src` and `tests` folders, all projects, and configuration mappings for every solution configuration incl. TwinCAT platforms and `ReleaseDevelop` (copy the block of an existing vendor library and replace GUIDs) | +| `TcOpen.slnf` | all projects | +| `TcOpen.build.slnf` | .NET projects: Connector, Wpf, TestsConnector, UnitTests, Sandbox (built by msbuild, packed by `dotnet pack` in `pipelines/build.ps1`) | +| `TcOpen.plc.slnf` | Connector, Xae tsproj, TestsConnector (Vortex compiler runs on this; `CopyPlcLibs` copies the `*.library` next to each tsproj to `plcLibs/`) | +| `TcOpen.XAEs.slnf` | Xae tsproj | +| `TcOpen.test.build.plc.slnf` | Xae tsproj | + +Existing typos - do not copy them: `src\\TcoTcoTixonFeeding\\...` in `TcOpen.test.build.plc.slnf`, the Mitsubishi line with a missing `\\` in `TcOpen.XAEs.slnf`. + +Optional: test tuple in `pipelines/build.ps1` (no vendor library is there today), reference in `src/_packaging/TcOpen.Group*/*.csproj`. + +## Project metadata + +- **plcproj**: library category `TcOpen` (from `TcOpen.libcat.xml`), `Company` = `Vortex.Library`; placeholder references `TcoCore`, `TcoIo`, `TcoAbstractions`, `TcoUtilities` (+ Tc2/Tc3 system libraries as needed). +- **Connector csproj**: `net48;net5.0`, `PackageId` `TcOpen.TcoTemplateConnector`, project references to TcoAbstractions/TcoUtilities/TcoCore/TcoIo connectors, packs `_meta\TcoTemplate.library`, `.json`, `version.info` into `lib`, empty `_generated\` folder entry (filled by the Vortex build). +- **Wpf csproj**: `Microsoft.NET.Sdk.WindowsDesktop`, `net48;net5.0-windows`, `Inxton.Package.Vortex.Essentials.Wpf`, references `TcoCore.Wpf` + the connector. `Properties/AssemblyInfo.cs` must contain `[assembly: RenderableAssembly()]` or the renderer will not find the views. +- **Versions**: `AssemblyVersion`/`AssemblyFileVersion`/`AssemblyInformationalVersion` in `Properties/AssemblyInfo.cs` with `GenerateAssemblyInfo=false`; global version from `GitVersion.yml`. +- **Entry.cs**: `Tc3ConnectorAdapter.Create(Environment.GetEnvironmentVariable("Tc3Target"), 851, true)` (library) / port 852 (tests connector). + +## Building .NET projects from the command line + +`dotnet build`/`dotnet test` of a single csproj fails with `*Undefined*_Vortex\builder` unless `SolutionDir` is set: + +```bash +dotnet test src/TcoTemplate/tests/TcoTemplateUnitTests/TcoTemplateUnitTests.csproj -f net48 "-p:SolutionDir=D:\\MTS\\Develop\\Inxton\\TcOpen\\" +``` + +Twin code in `_generated/` is produced by the Vortex compiler from the PLC project; after changing PLC declarations the twin must be regenerated (Vortex build in Visual Studio / `TcOpen.plc.slnf`) before C# can use the new members. A C# error like "name `_messenger` does not exist" in a `pex/` partial usually means the twin of a new FB was not generated yet. diff --git a/.claude/skills/tco-vendor-component/references/testing.md b/.claude/skills/tco-vendor-component/references/testing.md new file mode 100644 index 00000000..cffe2d57 --- /dev/null +++ b/.claude/skills/tco-vendor-component/references/testing.md @@ -0,0 +1,103 @@ +# Testing + +Minimum bar for a new component: **cyclic** -> simulator test context in the test PLC + NUnit PLC-executed tests per task; **.NET TCP** -> pure .NET NUnit tests against a fake TCP server (no PLC) + a test context exercising the operations. + +Reference implementations: cyclic `src/TcoKukaRobotics` (test context `Tests/TcoKukaKss/`, NUnit `tests/TcoKukaRoboticsUnitTests/PlcExectutedTests/`), TCP `src/TcoAimTtiPowerSupply` (`tests/TcoAimTtiPowerSupplyUnitTests/pex/`). + +## Shared NUnit scaffolding (`tests/TcoTemplateUnitTests/`) + +- `TcoTemplateUnitTests.csproj`: `net5.0;net48`, NUnit 3.13.2, NUnit3TestAdapter, Microsoft.NET.Test.Sdk, JunitXml.TestLogger; references the connector and the tests connector. +- `TestSetupFixture` (`[SetUpFixture]`): `TargetAmsId = Environment.GetEnvironmentVariable("Tc3Target")`, `TargetAmsPort = 852`. +- `ConnectorFixture.Connector`: lazily `Tc3ConnectorAdapter.Create(TargetAmsId, TargetAmsPort, true)`, `ReadWriteCycleDelay = 100`, `BuildAndStart()`. +- `MockRootObject`: dummy-connector parent that lets you instantiate any twin without a PLC: `new TcoTemplate_v_1_x_x(new MockRootObject(), string.Empty, string.Empty)`; `.Synchron` reads/writes work in memory. +- Folders: `PlcExectutedTests/` (needs PLC; existing spelling) and `pex/` (pure .NET). +- Run: `dotnet test -f net48 "-p:SolutionDir=D:\\MTS\\Develop\\Inxton\\TcOpen\\"`. PLC-executed tests need the test PLC activated on `Tc3Target`; if it is not available, say so instead of claiming they pass. + +## Cyclic: simulator test context (test PLC) + +`Tests/TcoTemplate/TcoTemplateTestContext.TcPOU` + `eTcoTemplateTests.TcDUT`: + +```st +FUNCTION_BLOCK TcoTemplateTestContext EXTENDS TcoCore._internals_TcoContext +VAR + _sut : TcoTemplate.TcoTemplate_v_1_x_x(THIS^); + _io : TcoTemplate.TcoTemplate_IO_v_1_x_x; // NOT linked - the simulator drives it + _sim : TcoTemplate.TcoTemplate_State_v_1_x_x; // device-side signals, set from NUnit + _simulate : BOOL; // TRUE = minimal controller model reacts to outputs + _simProgramBlocked : BOOL; // fault injection flags + _taskDone : BOOL; + _taskError : BOOL; +END_VAR +``` + +`METHOD PROTECTED Main`, every cycle: + +1. **Simulator** (when `_simulate`): derive `_sim.*` from `_io.Out.Outputs[...]` like the real controller (interface activation, drives on/off, error acknowledge, program start, handshake mirroring). Keep it minimal - only what the tasks wait for. Fault flags block a reaction so timeout/error paths can be tested. +2. **Input image**: write `_sim.*` into `_io.In.Inputs[...]` using exactly the documented bit map. +3. `_sut(inoData := _io);` +4. `CASE _testId OF` - one case per test enum member: + + ```st + eTcoTemplateTests.Restore: + _sut.Restore(); _sut._messenger.Clear(); _taskDone := FALSE; _taskError := FALSE; + ProbeDoneWhen(TRUE); + eTcoTemplateTests.Run: + ; + eTcoTemplateTests.StartProgram: + _taskDone := _sut.StartProgram().Done; + _taskError := _sut.StartProgramTask.Error; + ProbeDoneWhen(_taskDone OR _taskError); + ``` + +Test enum: `{attribute 'qualified_only'} {attribute 'strict'}`, `None := 0, Restore := 10, Run := 20, := 30, ...`. Add the context to test `MAIN` (`_templateTestContext : TcoTemplateTestContext;`) and call `_templateTestContext.ProbeRun();` every cycle. + +## Cyclic: NUnit (`PlcExectutedTests/TcoTemplate_v_1_x_xTests.cs`) + +```csharp +TcoTemplateTestContext sut = ConnectorFixture.Connector.MAIN._templateTestContext; + +[SetUp] +public void TestSetup() +{ + sut._simulate.Synchron = false; + ResetDeviceSide(); // all _sim.* to defaults + sut.ExecuteProbeRun((int)eTcoTemplateTests.Restore); + sut.ExecuteProbeRun(2, (int)eTcoTemplateTests.Run); +} + +[Test, Timeout(10000)] +public void InputsAreMappedToState() +{ + sut._sim.Ready.Synchron = true; + sut.ExecuteProbeRun(2, (int)eTcoTemplateTests.Run); + Assert.IsTrue(sut._sut._status.State.Ready.Synchron); +} +``` + +Required test groups: + +- **Mapping**: every input bit/byte -> `_status.State`, every `_control` member -> output bit/byte (catches bit-map mistakes). +- **Per task, happy path**: healthy device (`HealthyDevice()` sets safety signals + `_simulate = true`), run the task case until done, assert `_taskDone` and the outputs it left. +- **Per task, error path**: block the simulator (fault flag) with a short `ErrorTime`, assert `_taskError` and that `Restore` clears it. +- **Interlocks / special behaviour** (e.g. start blocked while a stop task is busy, outputs set on mode edges). + +## .NET TCP: fake server tests (`pex/TcoTemplate_v_1_x_xTests.cs`) - no PLC needed + +- Instantiate the twin on `MockRootObject`, call `Initialize()`, point `_config.IpAddress`/`Port` at a `TcpListener` on `IPAddress.Loopback`, port 0, set a short `Timeout`. +- Set the command via `_command.*.Synchron`, call the internal `InvokeGetCommand()`/`InvokeSetCommand()` directly (they are the remote task actions). +- Fake server: accept one connection, read one line into `Received`, then answer by `Reply` (text = reply line, `string.Empty` = close, `null` = stay silent). + +Required cases: + +- request formatting (assert `Received`) and response parsing into `_status.State` for each response syntax +- unreachable device -> `SocketException` +- silent device -> `IOException` (receive timeout) +- closed without response -> `IOException` +- unparsable/error reply -> exception, raw response still written to status +- every PLC command enum member has an entry in `TemplateCommands.Commands` + +Exceptions thrown from the action are what `TcoRemoteTask` turns into a PLC task error, so asserting the throw is asserting the PLC-visible behaviour. + +## Sandbox (`tests/TcoTemplate.Wpf.Sandbox`) + +Manual check of the Service view against the test PLC: `MainWindow` with `vortex:RenderableContentControl DataContext="{Binding MAIN._wpfContext._component}" PresentationType="Service"`; `_wpfContextCall` and `_serviceModeActive` set `TRUE` at start-up. diff --git a/.claude/skills/tco-vendor-component/scripts/Test-TcoLocalization.ps1 b/.claude/skills/tco-vendor-component/scripts/Test-TcoLocalization.ps1 new file mode 100644 index 00000000..e4d8c601 --- /dev/null +++ b/.claude/skills/tco-vendor-component/scripts/Test-TcoLocalization.ps1 @@ -0,0 +1,90 @@ +<# +.SYNOPSIS + Checks that every neutral resx of a TcOpen library has all keys translated in the predefined cultures. + +.DESCRIPTION + Scans \src for neutral Properties\Localizations.resx (PLC texts generated by the Vortex compiler) + and Properties\strings.resx (hand-made WPF texts), skipping bin/obj. For each culture it reports: + MISSING FILE - culture resx does not exist + MISSING - key in neutral, not in culture (error) + STALE - key in culture, not in neutral (error) + SAME - culture value equals the neutral value (warning only; may be a legitimate term) + Exit code 1 when any error was found. + +.EXAMPLE + powershell -File .claude\skills\tco-vendor-component\scripts\Test-TcoLocalization.ps1 -LibraryPath src\TcoTemplate +#> +param( + [Parameter(Mandatory = $true)] + [string]$LibraryPath, + [string[]]$Cultures = @('cs-CZ', 'de-DE', 'es-ES', 'sk-SK'), + [switch]$NoWarnings +) + +function Read-Resx([string]$path) { + $xml = New-Object System.Xml.XmlDocument + $xml.Load($path) + $result = [ordered]@{} + foreach ($node in $xml.SelectNodes('/root/data')) { + # resources only: skip file references / non-string types + if ($node.GetAttribute('type') -or $node.GetAttribute('mimetype')) { continue } + $valueNode = $node.SelectSingleNode('value') + $result[$node.GetAttribute('name')] = if ($valueNode) { $valueNode.InnerText } else { '' } + } + return $result +} + +$srcPath = Join-Path $LibraryPath 'src' +if (-not (Test-Path $srcPath)) { $srcPath = $LibraryPath } + +$neutralFiles = Get-ChildItem -Path $srcPath -Recurse -File -Include 'Localizations.resx', 'strings.resx' | + Where-Object { $_.FullName -notmatch '\\(bin|obj)\\' -and $_.Directory.Name -eq 'Properties' } + +if (-not $neutralFiles) { + Write-Host "No neutral Localizations.resx / strings.resx found under $srcPath" + exit 1 +} + +$errors = 0 +$warnings = 0 + +foreach ($neutral in $neutralFiles) { + $relative = $neutral.FullName.Substring((Resolve-Path $LibraryPath).Path.Length).TrimStart('\') + Write-Host "" + Write-Host "== $relative" + $neutralData = Read-Resx $neutral.FullName + $baseName = [System.IO.Path]::GetFileNameWithoutExtension($neutral.Name) + + foreach ($culture in $Cultures) { + # culture file names are not consistently cased (e.g. strings.sk-Sk.resx) + $cultureFile = Get-ChildItem -Path $neutral.DirectoryName -File | + Where-Object { $_.Name -ieq "$baseName.$culture.resx" } | Select-Object -First 1 + + if (-not $cultureFile) { + Write-Host " [$culture] MISSING FILE $baseName.$culture.resx" + $errors++ + continue + } + + $cultureData = Read-Resx $cultureFile.FullName + $missing = @($neutralData.Keys | Where-Object { -not $cultureData.Contains($_) }) + $stale = @($cultureData.Keys | Where-Object { -not $neutralData.Contains($_) }) + $same = @($neutralData.Keys | Where-Object { $cultureData.Contains($_) -and $neutralData[$_] -ne '' -and $cultureData[$_] -ceq $neutralData[$_] }) + + foreach ($key in $missing) { Write-Host " [$culture] MISSING $key = '$($neutralData[$key])'" } + foreach ($key in $stale) { Write-Host " [$culture] STALE $key" } + if (-not $NoWarnings) { + foreach ($key in $same) { Write-Host " [$culture] SAME $key = '$($neutralData[$key])'" } + } + $errors += $missing.Count + $stale.Count + $warnings += $same.Count + + if ($missing.Count + $stale.Count -eq 0) { + Write-Host " [$culture] OK ($($cultureData.Count) keys)" + } + } +} + +Write-Host "" +Write-Host "Errors: $errors Warnings (SAME): $warnings" +if ($errors -gt 0) { exit 1 } else { exit 0 } diff --git a/TcOpen.XAEs.slnf b/TcOpen.XAEs.slnf index bf7cb9d5..284008bb 100644 --- a/TcOpen.XAEs.slnf +++ b/TcOpen.XAEs.slnf @@ -20,6 +20,7 @@ "src\\TcoRexrothPress\\src\\XAE\\XAE\\XAETcoRexrothPress.tsproj", "src\\TcoMitsubishiRobotics\src\\XaeTcoMitsubishiRobotics\\XaeTcoMitsubishiRobotics.tsproj", "src\\TcoAimTtiPowerSupply\\src\\XaeTcoAimTtiPowerSupply\\XaeTcoAimTtiPowerSupply.tsproj", + "src\\TcoAteqMeasurement\\src\\XaeTcoAteqMeasurement\\XaeTcoAteqMeasurement.tsproj", "src\\TcoUrRobotics\\src\\XaeTcoUrRobotics\\XaeTcoUrRobotics.tsproj", "src\\TcoKukaRobotics\\src\\XaeTcoKukaRobotics\\XaeTcoKukaRobotics.tsproj", "src\\TcoTixonFeeding\\src\\XaeTcoTixonFeeding\\XaeTcoTixonFeeding.tsproj" diff --git a/TcOpen.build.slnf b/TcOpen.build.slnf index 7cb1e1f6..0d02561f 100644 --- a/TcOpen.build.slnf +++ b/TcOpen.build.slnf @@ -121,6 +121,10 @@ "src\\TcoAimTtiPowerSupply\\src\\TcoAimTtiPowerSupplyConnector\\TcoAimTtiPowerSupplyConnector.csproj", "src\\TcoAimTtiPowerSupply\\tests\\TcoAimTtiPowerSupplyTestsConnector\\TcoAimTtiPowerSupplyTestsConnector.csproj", "src\\TcoAimTtiPowerSupply\\tests\\TcoAimTtiPowerSupplyUnitTests\\TcoAimTtiPowerSupplyUnitTests.csproj", + "src\\TcoAteqMeasurement\\src\\TcoAteqMeasurement.Wpf\\TcOpen.Inxton.TcoAteqMeasurement.Wpf.csproj", + "src\\TcoAteqMeasurement\\src\\TcoAteqMeasurementConnector\\TcoAteqMeasurementConnector.csproj", + "src\\TcoAteqMeasurement\\tests\\TcoAteqMeasurementTestsConnector\\TcoAteqMeasurementTestsConnector.csproj", + "src\\TcoAteqMeasurement\\tests\\TcoAteqMeasurementUnitTests\\TcoAteqMeasurementUnitTests.csproj", "src\\TcoUrRobotics\\src\\TcoUrRobotics.Wpf\\TcOpen.Inxton.TcoUrRobotics.Wpf.csproj", "src\\TcoUrRobotics\\src\\TcoUrRoboticsConnector\\TcoUrRoboticsConnector.csproj", "src\\TcoUrRobotics\\tests\\TcoUrRoboticsTestsConnector\\TcoUrRoboticsTestsConnector.csproj", diff --git a/TcOpen.plc.slnf b/TcOpen.plc.slnf index 965bc2e0..5b68db90 100644 --- a/TcOpen.plc.slnf +++ b/TcOpen.plc.slnf @@ -57,6 +57,9 @@ "src\\TcoAimTtiPowerSupply\\src\\TcoAimTtiPowerSupplyConnector\\TcoAimTtiPowerSupplyConnector.csproj", "src\\TcoAimTtiPowerSupply\\src\\XaeTcoAimTtiPowerSupply\\XaeTcoAimTtiPowerSupply.tsproj", "src\\TcoAimTtiPowerSupply\\tests\\TcoAimTtiPowerSupplyTestsConnector\\TcoAimTtiPowerSupplyTestsConnector.csproj", + "src\\TcoAteqMeasurement\\src\\TcoAteqMeasurementConnector\\TcoAteqMeasurementConnector.csproj", + "src\\TcoAteqMeasurement\\src\\XaeTcoAteqMeasurement\\XaeTcoAteqMeasurement.tsproj", + "src\\TcoAteqMeasurement\\tests\\TcoAteqMeasurementTestsConnector\\TcoAteqMeasurementTestsConnector.csproj", "src\\TcoUrRobotics\\src\\TcoUrRoboticsConnector\\TcoUrRoboticsConnector.csproj", "src\\TcoUrRobotics\\src\\XaeTcoUrRobotics\\XaeTcoUrRobotics.tsproj", "src\\TcoUrRobotics\\tests\\TcoUrRoboticsTestsConnector\\TcoUrRoboticsTestsConnector.csproj", diff --git a/TcOpen.sln b/TcOpen.sln index a8022189..70a7b333 100644 --- a/TcOpen.sln +++ b/TcOpen.sln @@ -537,6 +537,24 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TcoKukaRoboticsUnitTests", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TcoKukaRobotics.Wpf.Sandbox", "src\TcoKukaRobotics\tests\TcoKukaRobotics.Wpf.Sandbox\TcoKukaRobotics.Wpf.Sandbox.csproj", "{F0B9D98E-E39E-4F6F-B03A-2CB58ED5C2F2}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TcoAteqMeasurement", "TcoAteqMeasurement", "{60E4661D-CC0B-4F22-9423-8B187B8F0B36}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{FDED3302-4402-46A2-88C4-77FD6EBA4E1D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{2FF04981-67D9-4B38-9550-4FC411F58505}" +EndProject +Project("{B1E792BE-AA5F-4E3C-8C82-674BF9C0715B}") = "XaeTcoAteqMeasurement", "src\TcoAteqMeasurement\src\XaeTcoAteqMeasurement\XaeTcoAteqMeasurement.tsproj", "{116B21A7-5DD7-453D-9D05-DF7661FD770B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TcOpen.Inxton.TcoAteqMeasurement.Wpf", "src\TcoAteqMeasurement\src\TcoAteqMeasurement.Wpf\TcOpen.Inxton.TcoAteqMeasurement.Wpf.csproj", "{5D0358E0-A806-4FA8-90CC-1E7354841551}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TcoAteqMeasurementConnector", "src\TcoAteqMeasurement\src\TcoAteqMeasurementConnector\TcoAteqMeasurementConnector.csproj", "{E4428AB8-F679-4901-B92E-9A87266E5A73}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TcoAteqMeasurementTestsConnector", "src\TcoAteqMeasurement\tests\TcoAteqMeasurementTestsConnector\TcoAteqMeasurementTestsConnector.csproj", "{3321AA59-305E-434D-B6EE-D96D9467F2B0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TcoAteqMeasurementUnitTests", "src\TcoAteqMeasurement\tests\TcoAteqMeasurementUnitTests\TcoAteqMeasurementUnitTests.csproj", "{164828EF-4F52-4493-87EE-ABBD49748D45}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TcoAteqMeasurement.Wpf.Sandbox", "src\TcoAteqMeasurement\tests\TcoAteqMeasurement.Wpf.Sandbox\TcoAteqMeasurement.Wpf.Sandbox.csproj", "{E520D02F-37AD-4DEB-956C-2DBD7B903D99}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution src\TcoData\tests\TcoData.Tests.Shared\TcoData.Tests.Shared.projitems*{3bf071a6-13a1-46a5-8fd5-87c8cee94896}*SharedItemsImports = 13 @@ -5371,6 +5389,184 @@ Global {F0B9D98E-E39E-4F6F-B03A-2CB58ED5C2F2}.ReleaseDevelop|TwinCAT RT (x64).Build.0 = Release|Any CPU {F0B9D98E-E39E-4F6F-B03A-2CB58ED5C2F2}.ReleaseDevelop|TwinCAT RT (x86).ActiveCfg = Release|Any CPU {F0B9D98E-E39E-4F6F-B03A-2CB58ED5C2F2}.ReleaseDevelop|TwinCAT RT (x86).Build.0 = Release|Any CPU + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x86) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x86) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.ReleaseDevelop|Any CPU.ActiveCfg = Release|TwinCAT RT (x86) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.ReleaseDevelop|Any CPU.Build.0 = Release|TwinCAT RT (x86) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.ReleaseDevelop|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.ReleaseDevelop|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.ReleaseDevelop|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.ReleaseDevelop|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.ReleaseDevelop|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.ReleaseDevelop|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.ReleaseDevelop|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) + {116B21A7-5DD7-453D-9D05-DF7661FD770B}.ReleaseDevelop|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Debug|TwinCAT RT (x64).Build.0 = Debug|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Debug|TwinCAT RT (x86).Build.0 = Debug|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Release|Any CPU.Build.0 = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Release|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Release|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Release|TwinCAT RT (x64).Build.0 = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Release|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.Release|TwinCAT RT (x86).Build.0 = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.ReleaseDevelop|Any CPU.ActiveCfg = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.ReleaseDevelop|Any CPU.Build.0 = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.ReleaseDevelop|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.ReleaseDevelop|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.ReleaseDevelop|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.ReleaseDevelop|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.ReleaseDevelop|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.ReleaseDevelop|TwinCAT RT (x64).Build.0 = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.ReleaseDevelop|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {5D0358E0-A806-4FA8-90CC-1E7354841551}.ReleaseDevelop|TwinCAT RT (x86).Build.0 = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Debug|TwinCAT RT (x64).Build.0 = Debug|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Debug|TwinCAT RT (x86).Build.0 = Debug|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Release|Any CPU.Build.0 = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Release|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Release|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Release|TwinCAT RT (x64).Build.0 = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Release|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.Release|TwinCAT RT (x86).Build.0 = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.ReleaseDevelop|Any CPU.ActiveCfg = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.ReleaseDevelop|Any CPU.Build.0 = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.ReleaseDevelop|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.ReleaseDevelop|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.ReleaseDevelop|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.ReleaseDevelop|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.ReleaseDevelop|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.ReleaseDevelop|TwinCAT RT (x64).Build.0 = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.ReleaseDevelop|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {E4428AB8-F679-4901-B92E-9A87266E5A73}.ReleaseDevelop|TwinCAT RT (x86).Build.0 = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Debug|TwinCAT RT (x64).Build.0 = Debug|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Debug|TwinCAT RT (x86).Build.0 = Debug|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Release|Any CPU.Build.0 = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Release|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Release|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Release|TwinCAT RT (x64).Build.0 = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Release|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.Release|TwinCAT RT (x86).Build.0 = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.ReleaseDevelop|Any CPU.ActiveCfg = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.ReleaseDevelop|Any CPU.Build.0 = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.ReleaseDevelop|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.ReleaseDevelop|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.ReleaseDevelop|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.ReleaseDevelop|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.ReleaseDevelop|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.ReleaseDevelop|TwinCAT RT (x64).Build.0 = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.ReleaseDevelop|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {3321AA59-305E-434D-B6EE-D96D9467F2B0}.ReleaseDevelop|TwinCAT RT (x86).Build.0 = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Debug|Any CPU.Build.0 = Debug|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Debug|TwinCAT RT (x64).Build.0 = Debug|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Debug|TwinCAT RT (x86).Build.0 = Debug|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Release|Any CPU.ActiveCfg = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Release|Any CPU.Build.0 = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Release|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Release|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Release|TwinCAT RT (x64).Build.0 = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Release|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.Release|TwinCAT RT (x86).Build.0 = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.ReleaseDevelop|Any CPU.ActiveCfg = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.ReleaseDevelop|Any CPU.Build.0 = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.ReleaseDevelop|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.ReleaseDevelop|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.ReleaseDevelop|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.ReleaseDevelop|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.ReleaseDevelop|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.ReleaseDevelop|TwinCAT RT (x64).Build.0 = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.ReleaseDevelop|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {164828EF-4F52-4493-87EE-ABBD49748D45}.ReleaseDevelop|TwinCAT RT (x86).Build.0 = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Debug|TwinCAT RT (x64).Build.0 = Debug|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Debug|TwinCAT RT (x86).Build.0 = Debug|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Release|Any CPU.Build.0 = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Release|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Release|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Release|TwinCAT RT (x64).Build.0 = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Release|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.Release|TwinCAT RT (x86).Build.0 = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.ReleaseDevelop|Any CPU.ActiveCfg = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.ReleaseDevelop|Any CPU.Build.0 = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.ReleaseDevelop|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.ReleaseDevelop|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.ReleaseDevelop|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.ReleaseDevelop|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.ReleaseDevelop|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.ReleaseDevelop|TwinCAT RT (x64).Build.0 = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.ReleaseDevelop|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {E520D02F-37AD-4DEB-956C-2DBD7B903D99}.ReleaseDevelop|TwinCAT RT (x86).Build.0 = Release|Any CPU {1A8AEF48-E46A-4F71-9A81-CC4F1E86A442}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x86) {1A8AEF48-E46A-4F71-9A81-CC4F1E86A442}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) {1A8AEF48-E46A-4F71-9A81-CC4F1E86A442}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) @@ -5659,6 +5855,14 @@ Global {EE4D9C5B-F47A-4FA1-8C39-33D736B40F89} = {6496DE2F-CDAD-42EE-B108-549F441A0A48} {6274BC29-030B-46EC-9642-8C2F64673185} = {6496DE2F-CDAD-42EE-B108-549F441A0A48} {F0B9D98E-E39E-4F6F-B03A-2CB58ED5C2F2} = {6496DE2F-CDAD-42EE-B108-549F441A0A48} + {FDED3302-4402-46A2-88C4-77FD6EBA4E1D} = {60E4661D-CC0B-4F22-9423-8B187B8F0B36} + {2FF04981-67D9-4B38-9550-4FC411F58505} = {60E4661D-CC0B-4F22-9423-8B187B8F0B36} + {116B21A7-5DD7-453D-9D05-DF7661FD770B} = {FDED3302-4402-46A2-88C4-77FD6EBA4E1D} + {5D0358E0-A806-4FA8-90CC-1E7354841551} = {FDED3302-4402-46A2-88C4-77FD6EBA4E1D} + {E4428AB8-F679-4901-B92E-9A87266E5A73} = {FDED3302-4402-46A2-88C4-77FD6EBA4E1D} + {3321AA59-305E-434D-B6EE-D96D9467F2B0} = {2FF04981-67D9-4B38-9550-4FC411F58505} + {164828EF-4F52-4493-87EE-ABBD49748D45} = {2FF04981-67D9-4B38-9550-4FC411F58505} + {E520D02F-37AD-4DEB-956C-2DBD7B903D99} = {2FF04981-67D9-4B38-9550-4FC411F58505} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D3448A2B-59D1-4DD2-AE4B-0EFF7BC92E81} diff --git a/TcOpen.slnf b/TcOpen.slnf index 5ed2cbe7..ad537205 100644 --- a/TcOpen.slnf +++ b/TcOpen.slnf @@ -83,6 +83,12 @@ "src\\TcoAimTtiPowerSupply\\tests\\TcoAimTtiPowerSupply.Wpf.Sandbox\\TcoAimTtiPowerSupply.Wpf.Sandbox.csproj", "src\\TcoAimTtiPowerSupply\\tests\\TcoAimTtiPowerSupplyTestsConnector\\TcoAimTtiPowerSupplyTestsConnector.csproj", "src\\TcoAimTtiPowerSupply\\tests\\TcoAimTtiPowerSupplyUnitTests\\TcoAimTtiPowerSupplyUnitTests.csproj", + "src\\TcoAteqMeasurement\\src\\TcoAteqMeasurement.Wpf\\TcOpen.Inxton.TcoAteqMeasurement.Wpf.csproj", + "src\\TcoAteqMeasurement\\src\\TcoAteqMeasurementConnector\\TcoAteqMeasurementConnector.csproj", + "src\\TcoAteqMeasurement\\src\\XaeTcoAteqMeasurement\\XaeTcoAteqMeasurement.tsproj", + "src\\TcoAteqMeasurement\\tests\\TcoAteqMeasurement.Wpf.Sandbox\\TcoAteqMeasurement.Wpf.Sandbox.csproj", + "src\\TcoAteqMeasurement\\tests\\TcoAteqMeasurementTestsConnector\\TcoAteqMeasurementTestsConnector.csproj", + "src\\TcoAteqMeasurement\\tests\\TcoAteqMeasurementUnitTests\\TcoAteqMeasurementUnitTests.csproj", "src\\TcoUrRobotics\\src\\TcoUrRobotics.Wpf\\TcOpen.Inxton.TcoUrRobotics.Wpf.csproj", "src\\TcoUrRobotics\\src\\TcoUrRoboticsConnector\\TcoUrRoboticsConnector.csproj", "src\\TcoUrRobotics\\src\\XaeTcoUrRobotics\\XaeTcoUrRobotics.tsproj", diff --git a/TcOpen.test.build.plc.slnf b/TcOpen.test.build.plc.slnf index ae55da9d..679878ff 100644 --- a/TcOpen.test.build.plc.slnf +++ b/TcOpen.test.build.plc.slnf @@ -39,6 +39,7 @@ "src\\TcoMitsubishiRobotics\\src\\XaeTcoMitsubishiRobotics\\XaeTcoMitsubishiRobotics.tsproj", "src\\TcoAimTtiPowerSupply\\src\\XaeTcoAimTtiPowerSupply\\XaeTcoAimTtiPowerSupply.tsproj", + "src\\TcoAteqMeasurement\\src\\XaeTcoAteqMeasurement\\XaeTcoAteqMeasurement.tsproj", "src\\TcoUrRobotics\\src\\XaeTcoUrRobotics\\XaeTcoUrRobotics.tsproj", diff --git a/src/TcoAimTtiPowerSupply/src/TcoAimTtiPowerSupplyConnector/Properties/AssemblyInfo.cs b/src/TcoAimTtiPowerSupply/src/TcoAimTtiPowerSupplyConnector/Properties/AssemblyInfo.cs index 7426d411..ee4d988e 100644 --- a/src/TcoAimTtiPowerSupply/src/TcoAimTtiPowerSupplyConnector/Properties/AssemblyInfo.cs +++ b/src/TcoAimTtiPowerSupply/src/TcoAimTtiPowerSupplyConnector/Properties/AssemblyInfo.cs @@ -1,6 +1,9 @@ using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +[assembly: InternalsVisibleTo("TcoAimTtiPowerSupplyUnitTests")] + // In SDK-style projects such as this one, several assembly attributes that were historically // defined in this file are now automatically added during build and populated with // values defined in project properties. For details of which attributes are included diff --git a/src/TcoAimTtiPowerSupply/src/TcoAimTtiPowerSupplyConnector/pex/TcoQl355P_v_1_x_x.cs b/src/TcoAimTtiPowerSupply/src/TcoAimTtiPowerSupplyConnector/pex/TcoQl355P_v_1_x_x.cs index dcc3b1b6..026d6013 100644 --- a/src/TcoAimTtiPowerSupply/src/TcoAimTtiPowerSupplyConnector/pex/TcoQl355P_v_1_x_x.cs +++ b/src/TcoAimTtiPowerSupply/src/TcoAimTtiPowerSupplyConnector/pex/TcoQl355P_v_1_x_x.cs @@ -22,139 +22,120 @@ public void Initialize() } - private void InvokeSetCommand() + // Exceptions are intentionally not caught here: TcoRemoteTask reports them to the PLC (_hasException) + // and to the logger, and does not signal Done. + internal void InvokeSetCommand() { this.Read(); - try + var cmd = FindCommand(eQlCommandType.SetCommand, Enum.GetName(typeof(eTcoQWlSeriesSupplySetCommands_v_1_x_x), _setCommandTask._command.Command.LastValue)); + var message = cmd.Syntax.Replace("", _setCommandTask._command.NValue.LastValue.ToString()).Replace("", _setCommandTask._command.NrfValue.LastValue.ToString(" 00.00", System.Globalization.CultureInfo.InvariantCulture)); + + using (TcpClient client = new TcpClient(_config.IpAddress.LastValue, _config.Port.LastValue)) { + client.SendTimeout = _config.Timeout.LastValue; + client.ReceiveTimeout = _config.Timeout.LastValue; - using (TcpClient client = new TcpClient(_config.IpAddress.LastValue, _config.Port.LastValue)) + using (NetworkStream stream = client.GetStream()) + using (StreamWriter writer = new StreamWriter(stream)) { - client.SendTimeout = _config.Timeout.LastValue; - client.ReceiveTimeout = _config.Timeout.LastValue; - - using (NetworkStream stream = client.GetStream()) - using (StreamWriter writer = new StreamWriter(stream)) - using (StreamReader reader = new StreamReader(stream)) - { - - string nVal = null; - // Send a string to the server - var cmd = QlSeriesCommands.Commands.Where(p => p.Type == eQlCommandType.SetCommand).Where(q => q.Key == Enum.GetName(typeof(eTcoQWlSeriesSupplySetCommands_v_1_x_x), _setCommandTask._command.Command.LastValue)).FirstOrDefault(); - var message = cmd.Syntax.Replace("", _setCommandTask._command.NValue.LastValue.ToString()).Replace("", _setCommandTask._command.NrfValue.LastValue.ToString(" 00.00", System.Globalization.CultureInfo.InvariantCulture)); - - writer.WriteLine(message); - writer.Flush(); // Flush the buffer to ensure data is sent immediately - - //Console.WriteLine("Sent: " + message); - - //// Receive a response from the server - //var response = reader.ReadLine(); - //_status.State.Resposne.Cyclic = response; - //_status.State.Write(); - //Console.WriteLine("Recieved: " + response); - } + // Set commands have no response. + writer.WriteLine(message); + writer.Flush(); // Flush the buffer to ensure data is sent immediately } } - catch (Exception ex) - { - Console.WriteLine("Error: " + ex.Message); - } } - - - private void InvokeGetCommand() + internal void InvokeGetCommand() { this.Read(); - try + var cmd = FindCommand(eQlCommandType.GetCommand, Enum.GetName(typeof(eTcoQWlSeriesSupplyGetCommands_v_1_x_x), _getCommandTask._command.Command.LastValue)); + var message = cmd.Syntax.Replace("", _getCommandTask._command.NValue.LastValue.ToString()); + + using (TcpClient client = new TcpClient(_config.IpAddress.LastValue, _config.Port.LastValue)) { + client.SendTimeout = _config.Timeout.LastValue; + client.ReceiveTimeout = _config.Timeout.LastValue; - using (TcpClient client = new TcpClient(_config.IpAddress.LastValue, _config.Port.LastValue)) + using (NetworkStream stream = client.GetStream()) + using (StreamWriter writer = new StreamWriter(stream)) + using (StreamReader reader = new StreamReader(stream)) { - client.SendTimeout = _config.Timeout.LastValue; - client.ReceiveTimeout = _config.Timeout.LastValue; + writer.WriteLine(message); + writer.Flush(); // Flush the buffer to ensure data is sent immediately - using (NetworkStream stream = client.GetStream()) - using (StreamWriter writer = new StreamWriter(stream)) - using (StreamReader reader = new StreamReader(stream)) + // Receive a response from the server + var response = reader.ReadLine(); + if (string.IsNullOrWhiteSpace(response)) { - - string nVal = null; - // Send a string to the server - var cmd = QlSeriesCommands.Commands.Where(p => p.Type == eQlCommandType.GetCommand).Where(q => q.Key == Enum.GetName(typeof(eTcoQWlSeriesSupplyGetCommands_v_1_x_x), _getCommandTask._command.Command.LastValue)).FirstOrDefault(); - var message = cmd.Syntax.Replace("", _getCommandTask._command.NValue.LastValue.ToString()); - - - writer.WriteLine(message); - writer.Flush(); // Flush the buffer to ensure data is sent immediately - - + throw new IOException($"No response from power supply {_config.IpAddress.LastValue}:{_config.Port.LastValue} to '{message.Trim()}'."); + } - // Receive a response from the server - var response = reader.ReadLine(); + _status.State.Nr1Value.Cyclic = 0; + _status.State.Nr2Value.Cyclic = 0; + _status.State.NValue.Cyclic = 0; + _status.State.ConvertMessage.Cyclic = string.Empty; + _status.State.Resposne.Cyclic = response; - _status.State.Nr1Value.Cyclic = 0; - _status.State.Nr2Value.Cyclic = 0; - _status.State.NValue.Cyclic = 0; - _status.State.ConvertMessage.Cyclic =string.Empty ; - _status.State.Resposne.Cyclic = response; + if (!string.IsNullOrEmpty(cmd.ResponseSyntax)) + { + if (cmd.ResponseSyntax == "") + { + short result; + if (short.TryParse(response, NumberStyles.Any, CultureInfo.InvariantCulture, out result)) + _status.State.Nr1Value.Cyclic = result; + else + _status.State.ConvertMessage.Cyclic = "Unable to convert " + response; + } - if (!string.IsNullOrEmpty(cmd.ResponseSyntax)) + else if (cmd.ResponseSyntax == "V" || cmd.ResponseSyntax == "A") { - - if (cmd.ResponseSyntax == "") - { - short result; - if (short.TryParse(response, NumberStyles.Any, CultureInfo.InvariantCulture, out result)) - _status.State.Nr1Value.Cyclic = result; - else - _status.State.ConvertMessage.Cyclic = "Unable to convert " + response; - } - - else if (cmd.ResponseSyntax == "V" || cmd.ResponseSyntax == "A") - { - float result; - var splitted = response.Split('A', 'V'); - if (float.TryParse(splitted[0], NumberStyles.Any, CultureInfo.InvariantCulture, out result)) - _status.State.Nr2Value.Cyclic = result; - else - _status.State.ConvertMessage.Cyclic = "Unable to convert " + splitted[0]; - } - - //"V " - else - { - var splitted = response.Split(' '); - short nResult; - string nValue = new String(splitted[0].Where(Char.IsDigit).ToArray()); - if (short.TryParse(nValue, NumberStyles.Any, CultureInfo.InvariantCulture, out nResult)) - _status.State.NValue.Cyclic = (byte)nResult; - else - _status.State.ConvertMessage.Cyclic = "Unable to convert " + splitted[1]; - - float result; - if (float.TryParse(splitted[1], NumberStyles.Any, CultureInfo.InvariantCulture, out result)) - _status.State.Nr2Value.Cyclic = result; - else - _status.State.ConvertMessage.Cyclic = "Unable to convert " + splitted[1]; - } - + float result; + var splitted = response.Split('A', 'V'); + if (float.TryParse(splitted[0], NumberStyles.Any, CultureInfo.InvariantCulture, out result)) + _status.State.Nr2Value.Cyclic = result; + else + _status.State.ConvertMessage.Cyclic = "Unable to convert " + splitted[0]; + } + //"V " + else + { + var splitted = response.Split(' '); + short nResult; + string nValue = new String(splitted[0].Where(Char.IsDigit).ToArray()); + if (short.TryParse(nValue, NumberStyles.Any, CultureInfo.InvariantCulture, out nResult)) + _status.State.NValue.Cyclic = (byte)nResult; + else + _status.State.ConvertMessage.Cyclic = "Unable to convert " + splitted[0]; + + float result; + if (splitted.Length > 1 && float.TryParse(splitted[1], NumberStyles.Any, CultureInfo.InvariantCulture, out result)) + _status.State.Nr2Value.Cyclic = result; + else + _status.State.ConvertMessage.Cyclic = "Unable to convert " + response; } + } - _status.State.Write(); - + _status.State.Write(); + if (!string.IsNullOrEmpty(_status.State.ConvertMessage.Cyclic)) + { + throw new FormatException($"Unexpected response '{response}' to '{message.Trim()}': {_status.State.ConvertMessage.Cyclic}"); } } } - catch (Exception ex) + } + + private static QlSeriesCommand FindCommand(eQlCommandType type, string key) + { + var cmd = QlSeriesCommands.Commands.FirstOrDefault(p => p.Type == type && p.Key == key); + if (cmd == null) { - Console.WriteLine("Error: " + ex.Message); + throw new InvalidOperationException($"Command '{key}' of type {type} is not defined in {nameof(QlSeriesCommands)}."); } + return cmd; } } diff --git a/src/TcoAimTtiPowerSupply/tests/TcoAimTtiPowerSupplyUnitTests/PlcExectutedTests/TcoIrc5Tests.cs b/src/TcoAimTtiPowerSupply/tests/TcoAimTtiPowerSupplyUnitTests/PlcExectutedTests/TcoIrc5Tests.cs deleted file mode 100644 index 89e092c5..00000000 --- a/src/TcoAimTtiPowerSupply/tests/TcoAimTtiPowerSupplyUnitTests/PlcExectutedTests/TcoIrc5Tests.cs +++ /dev/null @@ -1,19 +0,0 @@ -// #define WITH_HARDWARE -using NUnit.Framework; -using System; -using System.Text; -using System.Threading; - - -namespace TcoDrivesBeckhoffUnitTests.PlcExecutedTests -{ - - public class TcoIrc5Tests - { - - //TcoDriveSimpleTestContext tc = ConnectorFixture.Connector.MAIN._tcoDriveSimpleTestContext; - - - } -} - diff --git a/src/TcoAimTtiPowerSupply/tests/TcoAimTtiPowerSupplyUnitTests/pex/TcoQl355P_v_1_x_xTests.cs b/src/TcoAimTtiPowerSupply/tests/TcoAimTtiPowerSupplyUnitTests/pex/TcoQl355P_v_1_x_xTests.cs new file mode 100644 index 00000000..94d0a674 --- /dev/null +++ b/src/TcoAimTtiPowerSupply/tests/TcoAimTtiPowerSupplyUnitTests/pex/TcoQl355P_v_1_x_xTests.cs @@ -0,0 +1,237 @@ +using NUnit.Framework; +using System; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Threading; +using System.Threading.Tasks; +using TcoAimTtiPowerSupply; + +namespace TcoAimTtiPowerSupplyUnitTests.PexTests +{ + /// + /// Tests of the .NET side of TcoQl355P_v_1_x_x against a fake power supply on localhost. No PLC is required. + /// The remote task actions are called directly; exceptions thrown from them are what TcoRemoteTask reports to the PLC. + /// + [TestFixture] + public class TcoQl355P_v_1_x_xTests + { + private TcoQl355P_v_1_x_x sut; + private FakeQlSupply supply; + + [SetUp] + public void Setup() + { + sut = new TcoQl355P_v_1_x_x(new MockRootObject(), string.Empty, string.Empty); + sut.Initialize(); + supply = new FakeQlSupply(); + sut._config.IpAddress.Synchron = IPAddress.Loopback.ToString(); + sut._config.Port.Synchron = (ushort)supply.Port; + sut._config.Timeout.Synchron = 500; + } + + [TearDown] + public void TearDown() + { + supply.Dispose(); + } + + private void Get(eTcoQWlSeriesSupplyGetCommands_v_1_x_x command, byte n) + { + sut._getCommandTask._command.Command.Synchron = (short)command; + sut._getCommandTask._command.NValue.Synchron = n; + sut.InvokeGetCommand(); + } + + private void Set(eTcoQWlSeriesSupplySetCommands_v_1_x_x command, byte n, float nrf) + { + sut._setCommandTask._command.Command.Synchron = (short)command; + sut._setCommandTask._command.NValue.Synchron = n; + sut._setCommandTask._command.NrfValue.Synchron = nrf; + sut.InvokeSetCommand(); + } + + [Test] + [Timeout(5000)] + public void GetReadbackVoltageParsesNr2() + { + supply.Reply = "12.34V"; + + Get(eTcoQWlSeriesSupplyGetCommands_v_1_x_x.VO, 1); + + Assert.AreEqual("V1O?", supply.Received.Trim()); + Assert.AreEqual(12.34f, sut._status.State.Nr2Value.Synchron, 0.001f); + Assert.AreEqual("12.34V", sut._status.State.Resposne.Synchron); + Assert.AreEqual(string.Empty, sut._status.State.ConvertMessage.Synchron); + } + + [Test] + [Timeout(5000)] + public void GetSetVoltageParsesOutputAndNr2() + { + supply.Reply = "V2 5.00"; + + Get(eTcoQWlSeriesSupplyGetCommands_v_1_x_x.V, 2); + + Assert.AreEqual("V2?", supply.Received.Trim()); + Assert.AreEqual(2, sut._status.State.NValue.Synchron); + Assert.AreEqual(5.0f, sut._status.State.Nr2Value.Synchron, 0.001f); + } + + [Test] + [Timeout(5000)] + public void GetOutputStatusParsesNr1() + { + supply.Reply = "1"; + + Get(eTcoQWlSeriesSupplyGetCommands_v_1_x_x.OP, 1); + + Assert.AreEqual("OP1?", supply.Received.Trim()); + Assert.AreEqual(1, sut._status.State.Nr1Value.Synchron); + } + + [Test] + [Timeout(5000)] + public void SetVoltageSendsFormattedCommand() + { + Set(eTcoQWlSeriesSupplySetCommands_v_1_x_x.V, 1, 5.5f); + + Assert.AreEqual("V1 05.50", supply.WaitForReceived()); + } + + [Test] + [Timeout(5000)] + public void GetThrowsWhenSupplyIsUnreachable() + { + supply.Dispose(); + + Assert.Throws(() => Get(eTcoQWlSeriesSupplyGetCommands_v_1_x_x.VO, 1)); + } + + [Test] + [Timeout(5000)] + public void SetThrowsWhenSupplyIsUnreachable() + { + supply.Dispose(); + + Assert.Throws(() => Set(eTcoQWlSeriesSupplySetCommands_v_1_x_x.V, 1, 5.0f)); + } + + [Test] + [Timeout(5000)] + public void GetThrowsWhenSupplyDoesNotRespond() + { + supply.Reply = null; // keep the connection open without answering + + Assert.Throws(() => Get(eTcoQWlSeriesSupplyGetCommands_v_1_x_x.VO, 1)); + } + + [Test] + [Timeout(5000)] + public void GetThrowsWhenSupplyClosesWithoutResponse() + { + supply.Reply = string.Empty; // close the connection without answering + + Assert.Throws(() => Get(eTcoQWlSeriesSupplyGetCommands_v_1_x_x.VO, 1)); + } + + [Test] + [Timeout(5000)] + public void GetThrowsOnUnparsableResponse() + { + supply.Reply = "garbage"; + + Assert.Throws(() => Get(eTcoQWlSeriesSupplyGetCommands_v_1_x_x.VO, 1)); + Assert.AreEqual("garbage", sut._status.State.Resposne.Synchron); + StringAssert.StartsWith("Unable to convert", sut._status.State.ConvertMessage.Synchron); + } + + [Test] + public void EveryGetCommandIsDefined() + { + foreach (var name in Enum.GetNames(typeof(eTcoQWlSeriesSupplyGetCommands_v_1_x_x))) + { + Assert.IsTrue(QlSeriesCommands.Commands.Any(c => c.Type == eQlCommandType.GetCommand && c.Key == name), $"Get command '{name}' is missing in {nameof(QlSeriesCommands)}."); + } + } + + [Test] + public void EverySetCommandIsDefined() + { + foreach (var name in Enum.GetNames(typeof(eTcoQWlSeriesSupplySetCommands_v_1_x_x))) + { + Assert.IsTrue(QlSeriesCommands.Commands.Any(c => c.Type == eQlCommandType.SetCommand && c.Key == name), $"Set command '{name}' is missing in {nameof(QlSeriesCommands)}."); + } + } + + /// + /// Line based fake of the QL series LAN interface. Accepts one connection, reads one line and answers with : + /// a text is sent as a line, closes the connection, null keeps it open without answering. + /// + private sealed class FakeQlSupply : IDisposable + { + private readonly TcpListener listener; + private readonly Task serverTask; + private readonly ManualResetEventSlim received = new ManualResetEventSlim(); + private readonly CancellationTokenSource cts = new CancellationTokenSource(); + private bool disposed; + + public FakeQlSupply() + { + listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + Port = ((IPEndPoint)listener.LocalEndpoint).Port; + serverTask = Task.Run(Serve); + } + + public int Port { get; } + + public string Reply { get; set; } = string.Empty; + + public string Received { get; private set; } + + public string WaitForReceived() + { + Assert.IsTrue(received.Wait(2000), "The fake supply did not receive any command."); + return Received; + } + + private async Task Serve() + { + try + { + using (var client = await listener.AcceptTcpClientAsync()) + using (var stream = client.GetStream()) + using (var reader = new StreamReader(stream)) + using (var writer = new StreamWriter(stream) { AutoFlush = true }) + { + Received = await reader.ReadLineAsync(); + received.Set(); + if (Reply == null) + { + await Task.Delay(Timeout.Infinite, cts.Token); + } + else if (Reply != string.Empty) + { + await writer.WriteLineAsync(Reply); + } + } + } + catch (Exception) when (disposed) + { + // listener stopped by Dispose + } + } + + public void Dispose() + { + if (disposed) return; + disposed = true; + cts.Cancel(); + listener.Stop(); + try { serverTask.Wait(1000); } catch (AggregateException) { } + } + } + } +} diff --git a/src/TcoAteqMeasurement/README.md b/src/TcoAteqMeasurement/README.md new file mode 100644 index 00000000..d9970ed8 --- /dev/null +++ b/src/TcoAteqMeasurement/README.md @@ -0,0 +1,142 @@ +# TcoAteqMeasurement + +## Introduction + +**TcoAteqMeasurement** contains TcOpen components for ATEQ measurement instruments. + +| Component | Device | Interface | +|---|---|---| +| `TcoAteqG6Pn_v_3_5_x` | ATEQ G6 leak tester, fieldbus software 3.5 (Hilscher comX 51 PROFINET, firmware V3.5.35+ / G6 fieldbus software newer than 2.103) | PROFINET, fieldbus mode 5 "Standard": 4 x 64 input bytes, 4 x 64 output bytes | + +The component is a port of the AXOpen component `AxoG6` (`AXOpen.Components.Ateq.Measurement.v_3_5_x`). Manual: ATEQ *G6 Series - Profinet* (FG_G6_PROFINET_EN_02, 2020-06-17). + +What it does: + +- reset, program selection, complete test cycle (select, start, wait for cycle end, read and check the last result), read last result, special cycles +- read parameters of the selected program: any list of 1-35 identifiers, the preset set (times, test type, fill and reject levels) or one selected parameter +- live state: echo / error words, current program, results in FIFO, status bits, step, real-time pressure and flow with units + +Not supported (same as AX): reading or resetting the results FIFO, writing parameters, configuration and function bits, program names, any fieldbus mode other than Standard. + +## General TcOpen Prerequisites + +**Check general requisits for TcOpen [here](https://github.com/TcOpenGroup/TcOpen#prerequisites).** + +## Instrument and hardware + +- On the instrument, *CONFIGURATION > AUTOMATISM > FIELDBUS*: **ACCESS = 5 Standard**, **ADDRESS** = PROFINET device name (convention `ateqg6` + 3 digits, e.g. `ateqg6001`). +- Connectors X1 P1 / X1 P2: M12 D-coded, 4 pins. +- Device description: [`assets/GSDML-V2.32-HILSCHER-COMX 51XX-RE PNS-20160502.xml`](assets/) (VendorID `0x011E`, DeviceID `0x0117`). Copy it into `..\Config\Io\Profinet\` of the TwinCAT installation before opening Visual Studio. +- Use the DAP **`DIM 24`** and this module configuration: + +| Slot | Module | Mapped to | +|---|---|---| +| 1 | `64byteinput` | `In.In1` - input image 00h..3Fh | +| 2 | `64byteinput` | `In.In2` - input image 40h..7Fh | +| 3 | `64byteinput` | `In.In3` - input image 80h..BFh | +| 4 | `64byteinput` | `In.In4` - input image C0h..FFh | +| 5 | `64byteoutput` | `Out.Out1` - output image 00h..3Fh | +| 6 | `64byteoutput` | `Out.Out2` - output image 40h..7Fh | +| 7 | `64byteoutput` | `Out.Out3` - output image 80h..BFh | +| 8 | `64byteoutput` | `Out.Out4` - output image C0h..FFh | + +`PnIoBoxState` / `PnIoBoxDiag` / `PnIoBoxCtrl` of `TcoAteqG6Pn_IO_v_3_5_x` are linked to the device box variables, like in the other Profinet components. + +### Data layout + +All data are little-endian; measured values and parameters are LONG x1000; program numbers are 0-based on the bus and 1-based in the component (as shown on the instrument display). + +| Input | Content | Output | Content | +|---|---|---|---| +| 00h | command echo | 00h | command word | +| 02h | command error word (FFFFh = command running, 0 = ok, bit = failed command) | 06h | program number | +| 06h | current program | 08h | special cycle id | +| 08h | results in FIFO | 09h | special cycle instruction | +| 0Ah | test type (not verified) | 20h | parameter request: count + up to 35 identifiers | +| 0Ch | status bits (0 pass, 1 fail test, 2 fail reference, 3 alarm, 4 pressure error, 5 cycle end, 6 recoverable, 7 calibration, 9 ATR, 15 key) | | | +| 0Eh | step (FFFFh = none, 0 pre-fill ... 5 dump) | | | +| 10h..1Fh | real-time pressure, pressure unit, flow, flow unit | | | +| 20h.. | exchange zone: last result (20h program, 22h test type, 24h relay image, 26h alarm code, 28h..37h measurement) or parameter response (id WORD + value LONG per parameter) | | | + +Command bits: 0 reset, 1 start, 2 special cycle, 3 program selection, 5 read parameters, 15 read last result. Each command uses the ATEQ handshake: own echo low -> raise the bit -> echo / error word FFFFh -> error word 0 (or the failed command bit) -> drop the bit -> echo low. Every wait is bounded by `Config.CommandTimeout`. + +## PLC + +1. Declare the hardware structure in a GVL and link it to the device (see the table above). + + ```Pascal + VAR_GLOBAL + Ateq1 : TcoAteqMeasurement.TcoAteqG6Pn_IO_v_3_5_x; + END_VAR + ``` + +2. Declare the component in a `TcoCore.TcoContext` derived block and call it every cycle; `Service()` enables the service view. + + ```Pascal + VAR + _ateq1 : TcoAteqMeasurement.TcoAteqG6Pn_v_3_5_x(THIS^); + END_VAR + + _ateq1.Service(); // only when the service mode is active + _ateq1(inoData := GVL.Ateq1); + ``` + +3. Use the operations (each returns `TcoCore.ITcoTaskStatus`, call them until `Done` or `Error`): + + | Operation | Result | + |---|---| + | `Reset()` | resets the instrument; aborts any other running command | + | `SelectProgram(inProgram)` | program 1-128 selected and confirmed by the instrument | + | `StartCycle(inProgram)` | complete test cycle, result in `Status.LastResult` (`Valid`, `Pass`, `FailTest`, `AlarmCode`, `Measurement`); `Status.LastPass` | + | `ReadLastResult()` | reads the last result into `Status.LastResult` | + | `SpecialCycle(inSpecialCycle, inInstruction)` | runs a special cycle on the selected program | + | `ReadParameters(inoRequest)` | reads 1-35 parameters into `Status.Parameters` | + | `ReadPresetParameters()` | reads the preset into `Status.ParameterSet` | + | `ReadParameter(inParameter)` | reads one parameter into `Status.ParameterQuery` | + + ```Pascal + IF _ateq1.StartCycle(inProgram := 3).Done THEN + IF _ateq1.Status.LastPass THEN + ... + END_IF + END_IF + ``` + + Only one command runs at a time: while a command is busy the other commands are disabled (Reset excepted), and the operation does not overwrite the data of the running command. + +Configuration (`Config`): `InfoTime` (progress information), `ErrorTime` (task timeout, 0 = off), `CommandTimeout` (each handshake step, default 5 s), `CycleTimeout` (test cycle, default 60 s). + +## Visualization + +```XML + +``` + +The service view shows ready / command running / program / pass / fail / alarm, the commands, `Status`, `Control` (program number, special cycle, parameter request, selected parameter) and `Config`. See `tests/TcoAteqMeasurement.Wpf.Sandbox`. + +## Troubleshooting + +| Message | Cause / remedy | +|---|---| +| Command was not acknowledged by the instrument | no PROFINET connection, or the instrument is not in fieldbus mode 5 Standard | +| Instrument reported a command error | `Status.LastCommandError` holds the error word; the set bit names the failed command (e.g. 0008h program selection - program does not exist) | +| Command was not completed by the instrument | the error word stayed FFFFh - check the instrument display for an open menu or an alarm | +| Instrument still echoes the previous command / did not release the command echo | reset the instrument, then restore the component | +| Instrument is not ready (no cycle end) | a cycle is running; wait or reset | +| Test cycle did not start / did not end within Config.CycleTimeout | instrument alarm, invalid program, or program times longer than `CycleTimeout` | +| Last result does not belong to the requested program | a stale result was read - check that no other master resets the results FIFO | + +Not verified on hardware (taken over from AX): relay image bits 4-8 of the last result, input word 0Ah, freshness of the last result after more than 8 cycles without a FIFO reset, CycleEnd behaviour of special cycles. + +## Differences against the AXOpen component + +- No hardware-ID bootstrap (AX errors 700-787) and no module read/write errors (1201-1214): the modules are linked in the TwinCAT System Manager; PN state is reported by `TcoIo.TcoPnIoComponent` (`PN Error`). +- No numeric error ids (`Status.Error.Id`, `Status.Action.Id`): failures are localized messages; `Status.LastCommandError` is kept. +- `Config.TaskTimeout` is `Config.ErrorTime`. +- AX `ParameterQuery.Parameter` is `Control.QueryParameter`; the lookup result is `Status.ParameterQuery`. +- `ReadParameter(inParameter)` is an operation (in AX it existed only in the Blazor view). +- The handshake and the task step sequences are 1:1 with AX (`// AX step N` comments). + +## Tests + +`tests/TcoAteqMeasurementUnitTests/PlcExectutedTests/TcoAteqG6Tests.cs` runs against the test PLC (`TcoAteqMeasurementTests`, AMS port 852, `Tc3Target` environment variable). The test context contains an instrument simulator (`TcoAteqG6Simulator`, port of the AX `FakeG6` harness) with fault injection (fail / silent / stuck-echo masks, ignored program selection, no / endless cycle, stale result). diff --git a/src/TcoAteqMeasurement/TcoAteqMeasurement.slnf b/src/TcoAteqMeasurement/TcoAteqMeasurement.slnf new file mode 100644 index 00000000..dc226a6f --- /dev/null +++ b/src/TcoAteqMeasurement/TcoAteqMeasurement.slnf @@ -0,0 +1,13 @@ +{ + "solution": { + "path": "..\\..\\TcOpen.sln", + "projects": [ + "src\\TcoAteqMeasurement\\src\\TcoAteqMeasurement.Wpf\\TcOpen.Inxton.TcoAteqMeasurement.Wpf.csproj", + "src\\TcoAteqMeasurement\\src\\TcoAteqMeasurementConnector\\TcoAteqMeasurementConnector.csproj", + "src\\TcoAteqMeasurement\\src\\XaeTcoAteqMeasurement\\XaeTcoAteqMeasurement.tsproj", + "src\\TcoAteqMeasurement\\tests\\TcoAteqMeasurement.Wpf.Sandbox\\TcoAteqMeasurement.Wpf.Sandbox.csproj", + "src\\TcoAteqMeasurement\\tests\\TcoAteqMeasurementTestsConnector\\TcoAteqMeasurementTestsConnector.csproj", + "src\\TcoAteqMeasurement\\tests\\TcoAteqMeasurementUnitTests\\TcoAteqMeasurementUnitTests.csproj" + ] + } +} \ No newline at end of file diff --git a/src/TcoAteqMeasurement/assets/GSDML-011E-0117-COMX51REPNS.bmp b/src/TcoAteqMeasurement/assets/GSDML-011E-0117-COMX51REPNS.bmp new file mode 100644 index 00000000..91acf374 Binary files /dev/null and b/src/TcoAteqMeasurement/assets/GSDML-011E-0117-COMX51REPNS.bmp differ diff --git a/src/TcoAteqMeasurement/assets/GSDML-V2.32-HILSCHER-COMX 51XX-RE PNS-20160502.xml b/src/TcoAteqMeasurement/assets/GSDML-V2.32-HILSCHER-COMX 51XX-RE PNS-20160502.xml new file mode 100644 index 00000000..cc4558a4 --- /dev/null +++ b/src/TcoAteqMeasurement/assets/GSDML-V2.32-HILSCHER-COMX 51XX-RE PNS-20160502.xml @@ -0,0 +1,950 @@ + + + + PROFINET Device Profile + 1.00 + Device Profile for PROFINET Devices + PROFIBUS Nutzerorganisation e. V. (PNO) + Device + + 4 + 1 + GSDML + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/G6/Service/TcoAteqG6Pn_v_3_5_xServiceView.xaml b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/G6/Service/TcoAteqG6Pn_v_3_5_xServiceView.xaml new file mode 100644 index 00000000..3c17d5a4 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/G6/Service/TcoAteqG6Pn_v_3_5_xServiceView.xaml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/G6/Service/TcoAteqG6Pn_v_3_5_xServiceView.xaml.cs b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/G6/Service/TcoAteqG6Pn_v_3_5_xServiceView.xaml.cs new file mode 100644 index 00000000..eb8cdc86 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/G6/Service/TcoAteqG6Pn_v_3_5_xServiceView.xaml.cs @@ -0,0 +1,18 @@ +using System.ComponentModel; +using System.Windows.Controls; + +namespace TcoAteqMeasurement +{ + public partial class TcoAteqG6Pn_v_3_5_xServiceView : UserControl + { + public TcoAteqG6Pn_v_3_5_xServiceView() + { + if (DesignerProperties.GetIsInDesignMode(this)) + { + this.DataContext = new TcoAteqG6Pn_v_3_5_xServiceViewModel(); + } + + InitializeComponent(); + } + } +} diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/G6/Service/TcoAteqG6Pn_v_3_5_xServiceViewModel.cs b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/G6/Service/TcoAteqG6Pn_v_3_5_xServiceViewModel.cs new file mode 100644 index 00000000..d77a8875 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/G6/Service/TcoAteqG6Pn_v_3_5_xServiceViewModel.cs @@ -0,0 +1,26 @@ +using Vortex.Presentation.Wpf; + +namespace TcoAteqMeasurement +{ + public class TcoAteqG6Pn_v_3_5_xServiceViewModel : RenderableViewModel + { + public TcoAteqG6Pn_v_3_5_xServiceViewModel() : base() + { + Component = new TcoAteqG6Pn_v_3_5_x(); + } + + public TcoAteqG6Pn_v_3_5_x Component { get; internal set; } + + public override object Model + { + get => Component; + set + { + Component = value as TcoAteqG6Pn_v_3_5_x; + } + } + } + + public class TcoAteqG6Pn_v_3_5_xViewModel : TcoAteqG6Pn_v_3_5_xServiceViewModel + { } +} diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/AssemblyInfo.cs b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..81060e90 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System.Windows; +using System.Reflection; +using Vortex.Presentation.Wpf; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + +[assembly:RenderableAssembly()] +[assembly: AssemblyVersion("0.6.0.0")] +[assembly: AssemblyFileVersion("0.6.0.0")] +[assembly: AssemblyInformationalVersion("0.6.0-386-Create-application-template.913+Branch.386-Create-application-template.Sha.4c84548ce65902faf186e6b2f45c239f599f2d02")] + diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.Designer.cs b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.Designer.cs new file mode 100644 index 00000000..4bb9a97a --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.Designer.cs @@ -0,0 +1,144 @@ +//------------------------------------------------------------------------------ +// +// 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 TcOpen.Inxton.TcoAteqMeasurement.Wpf.Properties { + 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", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal strings() { + } + + /// + /// 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("TcOpen.Inxton.TcoAteqMeasurement.Wpf.Properties.strings", typeof(strings).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 Ready. + /// + public static string Ready { + get { + return ResourceManager.GetString("Ready", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Not ready. + /// + public static string NotReady { + get { + return ResourceManager.GetString("NotReady", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Command running. + /// + public static string CommandRunning { + get { + return ResourceManager.GetString("CommandRunning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Program:. + /// + public static string Program { + get { + return ResourceManager.GetString("Program", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PASS. + /// + public static string Pass { + get { + return ResourceManager.GetString("Pass", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to FAIL test part. + /// + public static string FailTestPart { + get { + return ResourceManager.GetString("FailTestPart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to FAIL reference part. + /// + public static string FailReferencePart { + get { + return ResourceManager.GetString("FailReferencePart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ALARM. + /// + public static string InstrumentAlarm { + get { + return ResourceManager.GetString("InstrumentAlarm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Commands. + /// + public static string Commands { + get { + return ResourceManager.GetString("Commands", resourceCulture); + } + } + } +} diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.cs-CZ.resx b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.cs-CZ.resx new file mode 100644 index 00000000..7b28fa3d --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.cs-CZ.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Připraven + + + Nepřipraven + + + Příkaz probíhá + + + Program: + + + VYHOVUJE + + + NEVYHOVUJE zkoušený díl + + + NEVYHOVUJE referenční díl + + + ALARM + + + Příkazy + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.de-DE.resx b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.de-DE.resx new file mode 100644 index 00000000..0379c40b --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.de-DE.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Bereit + + + Nicht bereit + + + Befehl läuft + + + Programm: + + + GUT + + + SCHLECHT Prüfteil + + + SCHLECHT Referenzteil + + + ALARM + + + Befehle + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.es-ES.resx b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.es-ES.resx new file mode 100644 index 00000000..b322f61b --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.es-ES.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Listo + + + No listo + + + Comando en curso + + + Programa: + + + OK + + + NOK pieza de prueba + + + NOK pieza de referencia + + + ALARMA + + + Comandos + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.resx b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.resx new file mode 100644 index 00000000..6eaf23b8 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Ready + + + Not ready + + + Command running + + + Program: + + + PASS + + + FAIL test part + + + FAIL reference part + + + ALARM + + + Commands + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.sk-Sk.resx b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.sk-Sk.resx new file mode 100644 index 00000000..89f1bb32 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/Properties/strings.sk-Sk.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Pripravený + + + Nepripravený + + + Príkaz prebieha + + + Program: + + + VYHOVUJE + + + NEVYHOVUJE testovaný diel + + + NEVYHOVUJE referenčný diel + + + ALARM + + + Príkazy + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/TcOpen.Inxton.TcoAteqMeasurement.Wpf.csproj b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/TcOpen.Inxton.TcoAteqMeasurement.Wpf.csproj new file mode 100644 index 00000000..7333304e --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurement.Wpf/TcOpen.Inxton.TcoAteqMeasurement.Wpf.csproj @@ -0,0 +1,54 @@ + + + + Library + net48;net5.0-windows + true + false + + TcOpenGroup contributors + TcOpenGroup + https://github.com/TcOpenGroup/TcOpen + MIT + git + TwinCAT3 Ateq Measurement + http://docs.tcopengroup.org/ + https://avatars.githubusercontent.com/u/72873267?s=60&v=4 + + + + + + + + + + + + + + + strings.resx + True + True + + + + + + strings.Designer.cs + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + + + + $(DefaultXamlRuntime) + Designer + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Entry.cs b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Entry.cs new file mode 100644 index 00000000..859136ae --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Entry.cs @@ -0,0 +1,13 @@ +using System; + +namespace TcoAteqMeasurement +{ + public class Entry + { + static string amsId = Environment.GetEnvironmentVariable("Tc3Target"); + const int amsPort = 851; + + public static TcoAteqMeasurement.TcoAteqMeasurementTwinController TcoAteqMeasurement { get; } + = new TcoAteqMeasurement.TcoAteqMeasurementTwinController(Vortex.Adapters.Connector.Tc3.Adapter.Tc3ConnectorAdapter.Create(amsId, amsPort, true)); + } +} diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/AssemblyInfo.cs b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..6a9ea7a6 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/AssemblyInfo.cs @@ -0,0 +1,22 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// In SDK-style projects such as this one, several assembly attributes that were historically +// defined in this file are now automatically added during build and populated with +// values defined in project properties. For details of which attributes are included +// and how to customise this process see: https://aka.ms/assembly-info-properties + + +// Setting ComVisible to false makes the types in this assembly not visible to COM +// components. If you need to access a type in this assembly from COM, set the ComVisible +// attribute to true on that type. + +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM. + +[assembly: Guid("4a20f6ed-5c01-4990-a1b9-b9c24f8d98d3")] + +[assembly: AssemblyVersion("0.6.0.0")] +[assembly: AssemblyFileVersion("0.6.0.0")] +[assembly: AssemblyInformationalVersion("0.6.0-386-Create-application-template.913+Branch.386-Create-application-template.Sha.4c84548ce65902faf186e6b2f45c239f599f2d02")] diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.Designer.cs b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.Designer.cs new file mode 100644 index 00000000..6411d4c3 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.Designer.cs @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +// +// 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 TcoAteqMeasurementConnector.Properties { + 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", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Localizations { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Localizations() { + } + + /// + /// 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("TcoAteqMeasurementConnector.Properties.Localizations", typeof(Localizations).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; + } + } + + } +} diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.cs-CZ.resx b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.cs-CZ.resx new file mode 100644 index 00000000..59bb40b9 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.cs-CZ.resx @@ -0,0 +1,564 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Surová hodnota + + + Reset + + + Start + + + Speciální cyklus + + + Výběr programu + + + Číst výsledky FIFO + + + Číst parametry + + + Zapsat parametry + + + Vymazat výsledky FIFO + + + Číst konfiguraci přístroje + + + Číst konfigurační bity + + + Číst funkční bity + + + Zapsat konfigurační bity + + + Zapsat funkční bity + + + Číst název programu + + + Zapsat název programu + + + Číst poslední výsledek + + + Čas informace + + + Časový limit úlohy (0 = vyp.) + + + Časový limit potvrzení příkazu (na krok) + + + Časový limit testovacího cyklu + + + Příkazové slovo + + + Příkazové bity + + + Číslo programu (jak na displeji, 1-128) + + + Instrukce speciálního cyklu + + + Požadavek na parametry + + + Vybraný parametr + + + Platný + + + Program + + + Typ testu (surový) + + + Vyhovuje + + + Zkoušený díl nevyhovuje (max. průtok) + + + Referenční díl nevyhovuje (min. průtok) + + + Alarm + + + Chyba tlaku (neověřeno) + + + Díl opravitelný (neověřeno) + + + Chyba kalibrace (neověřeno) + + + Chyba kontroly kalibrace (neověřeno) + + + Chyba ATR (neověřeno) + + + Obraz relé (surový) + + + Kód alarmu + + + Kód alarmu (surový) + + + Měření + + + Tlak + + + Jednotka tlaku + + + Průtok / netěsnost + + + Jednotka průtoku + + + Tlak (surový x1000) + + + Kód jednotky tlaku (surový) + + + Průtok (surový x1000) + + + Kód jednotky průtoku (surový) + + + Počet přečtených parametrů + + + Parametry + + + Parametr + + + Nalezeno + + + Hodnota + + + Hodnota (surová x1000) + + + Počet parametrů (1-35) + + + Identifikátory + + + Čas plnění [s] + + + Čas stabilizace [s] + + + Čas testu [s] + + + Čas vypuštění [s] + + + Typ testu + + + Minimální plnicí tlak + + + Maximální plnicí tlak + + + Mez nevyhovění zkoušeného dílu + + + Mez nevyhovění referenčního dílu + + + Žádaná hodnota plnění + + + Identifikátor + + + Potvrzení příkazu + + + Chyba příkazu + + + Příkaz probíhá + + + Aktuální program + + + Výsledky ve FIFO + + + Stav + + + Krok + + + Krok (surový) + + + Reálný čas + + + Zkoušený díl nevyhovuje + + + Referenční díl nevyhovuje + + + Chyba tlaku + + + Konec cyklu + + + Díl opravitelný + + + Chyba nebo drift kalibrace + + + Chyba nebo drift ATR + + + Přítomnost klíče + + + Akce + + + Připraven + + + Poslední díl vyhověl + + + Poslední chybové slovo příkazu + + + Přístroj + + + Poslední výsledek + + + Přednastavené parametry + + + Řízení + + + Konfigurace + + + Chyba PN + + + Vybrat program + + + Spustit testovací cyklus + + + Spustit speciální cyklus + + + Obnovení + + + Obnovení bylo provedeno. + + + IN + + + OUT + + + Vstupní modul 1 (slot 1, 00h..3Fh) + + + Vstupní modul 2 (slot 2, 40h..7Fh) + + + Vstupní modul 3 (slot 3, 80h..BFh) + + + Vstupní modul 4 (slot 4, C0h..FFh) + + + Výstupní modul 1 (slot 5, 00h..3Fh) + + + Výstupní modul 2 (slot 6, 40h..7Fh) + + + Výstupní modul 3 (slot 7, 80h..BFh) + + + Výstupní modul 4 (slot 8, C0h..FFh) + + + Neplatný odkaz: + + + Přístroj stále potvrzuje předchozí příkaz. Resetujte přístroj a poté obnovte komponentu. + + + Přístroj nepotvrdil příkaz. Zkontrolujte připojení PROFINET a režim sběrnice 5 Standard. + + + Přístroj hlásí chybu příkazu. Viz LastCommandError: nastavený bit označuje neúspěšný příkaz. + + + Přístroj nedokončil příkaz. Zkontrolujte na displeji přístroje otevřené menu nebo alarm. + + + Přístroj neuvolnil potvrzení příkazu. Resetujte přístroj a poté obnovte komponentu. + + + Testovací cyklus se nespustil. Zkontrolujte alarmy přístroje a platnost programu. + + + Testovací cyklus neskončil v čase Config.CycleTimeout. + + + Překročen čas úlohy (Config.ErrorTime). + + + Příkaz byl přerušen. + + + Pro obnovení potvrďte tento alarm. + + + Čtení posledního výsledku + + + Poslední výsledek přečten + + + Mapovat na předvolbu + + + Kontrola požadavku na parametry + + + Počet požadovaných parametrů je mimo rozsah (1-35). + + + Čtení parametrů + + + Parametry přečteny + + + Resetování přístroje + + + Přístroj resetován + + + Kontrola čísla programu + + + Číslo programu je mimo rozsah (1-128). Zadejte číslo programu tak, jak je zobrazeno na displeji přístroje. + + + Výběr programu + + + Ověření vybraného programu + + + Přístroj nepřepnul na požadovaný program. Zkontrolujte, zda program v přístroji existuje. + + + Program vybrán + + + Čekání na připravenost přístroje + + + Není vybrán žádný speciální cyklus. + + + Přístroj není připraven (žádný konec cyklu). Počkejte na dokončení běžícího cyklu nebo resetujte přístroj. + + + Spouštění speciálního cyklu + + + Speciální cyklus probíhá + + + Speciální cyklus ukončen + + + Spouštění testovacího cyklu + + + Testovací cyklus probíhá + + + Poslední výsledek nepatří k požadovanému programu. Byl přečten starý výsledek. + + + Testovací cyklus ukončen + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.de-DE.resx b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.de-DE.resx new file mode 100644 index 00000000..4f921292 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.de-DE.resx @@ -0,0 +1,564 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Rohwert + + + Reset + + + Start + + + Sonderzyklus + + + Programmwahl + + + FIFO-Ergebnisse lesen + + + Parameter lesen + + + Parameter schreiben + + + FIFO-Ergebnisse löschen + + + Gerätekonfiguration lesen + + + Konfigurationsbits lesen + + + Funktionsbits lesen + + + Konfigurationsbits schreiben + + + Funktionsbits schreiben + + + Programmname lesen + + + Programmname schreiben + + + Letztes Ergebnis lesen + + + Infozeit + + + Task-Zeitüberschreitung (0 = aus) + + + Befehlsquittierung Zeitüberschreitung (pro Schritt) + + + Prüfzyklus Zeitüberschreitung + + + Befehlswort + + + Befehlsbits + + + Programmnummer (wie angezeigt, 1-128) + + + Sonderzyklus-Vorgabe + + + Parameteranfrage + + + Ausgewählter Parameter + + + Gültig + + + Programm + + + Prüfart (roh) + + + Gut + + + Prüfteil schlecht (Max.-Durchfluss) + + + Referenzteil schlecht (Min.-Durchfluss) + + + Alarm + + + Druckfehler (ungeprüft) + + + Teil nacharbeitbar (ungeprüft) + + + Kalibrierfehler (ungeprüft) + + + Kalibrierprüfungsfehler (ungeprüft) + + + ATR-Fehler (ungeprüft) + + + Relaisabbild (roh) + + + Alarmcode + + + Alarmcode (roh) + + + Messung + + + Druck + + + Druckeinheit + + + Durchfluss / Leck + + + Durchflusseinheit + + + Druck (roh x1000) + + + Druckeinheit-Code (roh) + + + Durchfluss (roh x1000) + + + Durchflusseinheit-Code (roh) + + + Anzahl gelesener Parameter + + + Parameter + + + Parameter + + + Gefunden + + + Wert + + + Wert (roh x1000) + + + Anzahl Parameter (1-35) + + + Kennungen + + + Füllzeit [s] + + + Stabilisierungszeit [s] + + + Prüfzeit [s] + + + Entlüftungszeit [s] + + + Prüfart + + + Minimaler Fülldruck + + + Maximaler Fülldruck + + + Ausschussgrenze Prüfteil + + + Ausschussgrenze Referenzteil + + + Füll-Sollwert + + + Kennung + + + Befehlsquittung + + + Befehlsfehler + + + Befehl läuft + + + Aktuelles Programm + + + Ergebnisse im FIFO + + + Status + + + Schritt + + + Schritt (roh) + + + Echtzeit + + + Prüfteil schlecht + + + Referenzteil schlecht + + + Druckfehler + + + Zyklusende + + + Teil nacharbeitbar + + + Kalibrierfehler oder Drift + + + ATR-Fehler oder Drift + + + Schlüssel vorhanden + + + Aktion + + + Bereit + + + Letztes Teil gut + + + Letztes Befehlsfehlerwort + + + Gerät + + + Letztes Ergebnis + + + Vorgabeparameter + + + Steuerung + + + Konfiguration + + + PN-Fehler + + + Programm wählen + + + Prüfzyklus starten + + + Sonderzyklus starten + + + Wiederherstellen + + + Wiederherstellung wurde ausgeführt. + + + IN + + + OUT + + + Eingangsmodul 1 (Steckplatz 1, 00h..3Fh) + + + Eingangsmodul 2 (Steckplatz 2, 40h..7Fh) + + + Eingangsmodul 3 (Steckplatz 3, 80h..BFh) + + + Eingangsmodul 4 (Steckplatz 4, C0h..FFh) + + + Ausgangsmodul 1 (Steckplatz 5, 00h..3Fh) + + + Ausgangsmodul 2 (Steckplatz 6, 40h..7Fh) + + + Ausgangsmodul 3 (Steckplatz 7, 80h..BFh) + + + Ausgangsmodul 4 (Steckplatz 8, C0h..FFh) + + + Ungültige Referenz: + + + Gerät quittiert noch den vorherigen Befehl. Gerät zurücksetzen, dann die Komponente wiederherstellen. + + + Befehl wurde vom Gerät nicht quittiert. PROFINET-Verbindung und Feldbusmodus 5 Standard prüfen. + + + Gerät meldet einen Befehlsfehler. Siehe LastCommandError: das gesetzte Bit nennt den fehlgeschlagenen Befehl. + + + Befehl wurde vom Gerät nicht abgeschlossen. Display auf offenes Menü oder Alarm prüfen. + + + Gerät hat die Befehlsquittung nicht zurückgenommen. Gerät zurücksetzen, dann die Komponente wiederherstellen. + + + Prüfzyklus ist nicht gestartet. Gerät auf Alarme und das Programm auf Gültigkeit prüfen. + + + Prüfzyklus wurde nicht innerhalb von Config.CycleTimeout beendet. + + + Taskzeit überschritten (Config.ErrorTime). + + + Befehl wurde abgebrochen. + + + Zum Wiederherstellen diesen Alarm quittieren. + + + Letztes Ergebnis wird gelesen + + + Letztes Ergebnis gelesen + + + Auf Vorgabe abbilden + + + Parameteranfrage wird geprüft + + + Anzahl angeforderter Parameter außerhalb des Bereichs (1-35). + + + Parameter werden gelesen + + + Parameter gelesen + + + Gerät wird zurückgesetzt + + + Gerät zurückgesetzt + + + Programmnummer wird geprüft + + + Programmnummer außerhalb des Bereichs (1-128). Programmnummer wie im Gerätedisplay angezeigt angeben. + + + Programm wird gewählt + + + Gewähltes Programm wird geprüft + + + Gerät hat nicht auf das angeforderte Programm umgeschaltet. Prüfen, ob das Programm im Gerät existiert. + + + Programm gewählt + + + Warten auf Gerät bereit + + + Kein Sonderzyklus gewählt. + + + Gerät nicht bereit (kein Zyklusende). Auf das Ende des laufenden Zyklus warten oder das Gerät zurücksetzen. + + + Sonderzyklus wird gestartet + + + Sonderzyklus läuft + + + Sonderzyklus beendet + + + Prüfzyklus wird gestartet + + + Prüfzyklus läuft + + + Letztes Ergebnis gehört nicht zum angeforderten Programm. Ein veraltetes Ergebnis wurde gelesen. + + + Prüfzyklus beendet + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.es-ES.resx b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.es-ES.resx new file mode 100644 index 00000000..523dc70b --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.es-ES.resx @@ -0,0 +1,564 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Valor bruto + + + Reinicio + + + Inicio + + + Ciclo especial + + + Selección de programa + + + Leer resultados FIFO + + + Leer parámetros + + + Escribir parámetros + + + Borrar resultados FIFO + + + Leer configuración del equipo + + + Leer bits de configuración + + + Leer bits de función + + + Escribir bits de configuración + + + Escribir bits de función + + + Leer nombre de programa + + + Escribir nombre de programa + + + Leer último resultado + + + Tiempo de información + + + Tiempo límite de tarea (0 = desactivado) + + + Tiempo límite de confirmación de comando (por paso) + + + Tiempo límite del ciclo de prueba + + + Palabra de comando + + + Bits de comando + + + Número de programa (como se muestra, 1-128) + + + Instrucción del ciclo especial + + + Solicitud de parámetros + + + Parámetro seleccionado + + + Válido + + + Programa + + + Tipo de prueba (bruto) + + + Correcto + + + Pieza de prueba rechazada (caudal máximo) + + + Pieza de referencia rechazada (caudal mínimo) + + + Alarma + + + Error de presión (no verificado) + + + Pieza recuperable (no verificado) + + + Error de calibración (no verificado) + + + Error de verificación de calibración (no verificado) + + + Fallo ATR (no verificado) + + + Imagen de relés (bruto) + + + Código de alarma + + + Código de alarma (bruto) + + + Medición + + + Presión + + + Unidad de presión + + + Caudal / fuga + + + Unidad de caudal + + + Presión (bruto x1000) + + + Código de unidad de presión (bruto) + + + Caudal (bruto x1000) + + + Código de unidad de caudal (bruto) + + + Número de parámetros leídos + + + Parámetros + + + Parámetro + + + Encontrado + + + Valor + + + Valor (bruto x1000) + + + Número de parámetros (1-35) + + + Identificadores + + + Tiempo de llenado [s] + + + Tiempo de estabilización [s] + + + Tiempo de prueba [s] + + + Tiempo de vaciado [s] + + + Tipo de prueba + + + Presión mínima de llenado + + + Presión máxima de llenado + + + Nivel de rechazo de pieza de prueba + + + Nivel de rechazo de pieza de referencia + + + Consigna de llenado + + + Identificador + + + Eco del comando + + + Error de comando + + + Comando en curso + + + Programa actual + + + Resultados en FIFO + + + Estado + + + Paso + + + Paso (bruto) + + + Tiempo real + + + Pieza de prueba rechazada + + + Pieza de referencia rechazada + + + Error de presión + + + Fin de ciclo + + + Pieza recuperable + + + Error o deriva de calibración + + + Error o deriva ATR + + + Presencia de llave + + + Acción + + + Listo + + + Última pieza correcta + + + Última palabra de error de comando + + + Equipo + + + Último resultado + + + Parámetros preajustados + + + Control + + + Configuración + + + Error PN + + + Seleccionar programa + + + Iniciar ciclo de prueba + + + Iniciar ciclo especial + + + Restaurar + + + Se ha ejecutado la restauración. + + + IN + + + OUT + + + Módulo de entrada 1 (ranura 1, 00h..3Fh) + + + Módulo de entrada 2 (ranura 2, 40h..7Fh) + + + Módulo de entrada 3 (ranura 3, 80h..BFh) + + + Módulo de entrada 4 (ranura 4, C0h..FFh) + + + Módulo de salida 1 (ranura 5, 00h..3Fh) + + + Módulo de salida 2 (ranura 6, 40h..7Fh) + + + Módulo de salida 3 (ranura 7, 80h..BFh) + + + Módulo de salida 4 (ranura 8, C0h..FFh) + + + Referencia no válida: + + + El equipo sigue confirmando el comando anterior. Reinicie el equipo y luego restaure el componente. + + + El equipo no confirmó el comando. Compruebe la conexión PROFINET y el modo de bus de campo 5 Standard. + + + El equipo informó un error de comando. Vea LastCommandError: el bit activo indica el comando fallido. + + + El equipo no completó el comando. Compruebe en la pantalla del equipo si hay un menú abierto o una alarma. + + + El equipo no liberó el eco del comando. Reinicie el equipo y luego restaure el componente. + + + El ciclo de prueba no se inició. Compruebe las alarmas del equipo y que el programa sea válido. + + + El ciclo de prueba no terminó dentro de Config.CycleTimeout. + + + Tiempo de tarea excedido (Config.ErrorTime). + + + El comando fue abortado. + + + Para restaurar, confirme esta alarma. + + + Leyendo último resultado + + + Último resultado leído + + + Asignar a preajuste + + + Comprobando solicitud de parámetros + + + Número de parámetros solicitados fuera de rango (1-35). + + + Leyendo parámetros + + + Parámetros leídos + + + Reiniciando equipo + + + Equipo reiniciado + + + Comprobando número de programa + + + Número de programa fuera de rango (1-128). Indique el número de programa tal como aparece en la pantalla del equipo. + + + Seleccionando programa + + + Verificando programa seleccionado + + + El equipo no cambió al programa solicitado. Compruebe que el programa existe en el equipo. + + + Programa seleccionado + + + Esperando equipo listo + + + No se ha seleccionado ningún ciclo especial. + + + El equipo no está listo (sin fin de ciclo). Espere a que termine el ciclo en curso o reinicie el equipo. + + + Iniciando ciclo especial + + + Ciclo especial en curso + + + Ciclo especial terminado + + + Iniciando ciclo de prueba + + + Ciclo de prueba en curso + + + El último resultado no pertenece al programa solicitado. Se leyó un resultado obsoleto. + + + Ciclo de prueba terminado + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.resx b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.resx new file mode 100644 index 00000000..65a9e7f7 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.resx @@ -0,0 +1,564 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Status + + + Control + + + Config + + + PN Error + + + Reset + + + Select program + + + Start test cycle + + + Read last result + + + Start special cycle + + + Read parameters + + + Restore + + + Restore has been executed. + + + Reading last result + + + Last result read + + + Checking parameter request + + + Number of requested parameters out of range (1-35). + + + Reading parameters + + + Parameters read + + + Map to preset + + + Resetting instrument + + + Instrument reset + + + Checking program number + + + Program number out of range (1-128). Pass the program number as shown on the instrument display. + + + Selecting program + + + Verifying selected program + + + Instrument did not switch to the requested program. Check that the program exists on the instrument. + + + Program selected + + + Waiting for instrument ready + + + No special cycle selected. + + + Instrument is not ready (no cycle end). Wait for the running cycle to finish or reset the instrument. + + + Starting special cycle + + + Special cycle running + + + Special cycle finished + + + Starting test cycle + + + Test cycle running + + + Last result does not belong to the requested program. A stale result was read. + + + Test cycle finished + + + Invalid reference: + + + Instrument still echoes the previous command. Reset the instrument, then restore the component. + + + Command was not acknowledged by the instrument. Check the PROFINET connection and fieldbus mode 5 Standard. + + + Instrument reported a command error. See LastCommandError: the set bit names the failed command. + + + Command was not completed by the instrument. Check the instrument display for a running menu or alarm. + + + Instrument did not release the command echo. Reset the instrument, then restore the component. + + + Test cycle did not start. Check the instrument for alarms and that the program is valid. + + + Test cycle did not end within Config.CycleTimeout. + + + Task time exceeded (Config.ErrorTime). + + + Command was aborted. + + + To restore acknowledge this alarm. + + + Raw + + + Start + + + Special cycle + + + Program selection + + + Read FIFO results + + + Write parameters + + + Reset FIFO results + + + Read instrument configuration + + + Read configuration bits + + + Read function bits + + + Write configuration bits + + + Write function bits + + + Read program name + + + Write program name + + + Info time + + + Task timeout (0 = off) + + + Command handshake timeout (per step) + + + Test cycle timeout + + + Command word + + + Command bits + + + Program number (as displayed, 1-128) + + + Special cycle instruction + + + Parameter request + + + Selected parameter + + + Valid + + + Program + + + Test type (raw) + + + Pass + + + Fail test part (maximum flow reject) + + + Fail reference part (minimum flow reject) + + + Alarm + + + Pressure error (unverified) + + + Part recoverable (unverified) + + + Calibration error (unverified) + + + Calibration check error (unverified) + + + ATR fault (unverified) + + + Relay image (raw) + + + Alarm code + + + Alarm code (raw) + + + Measurement + + + Pressure + + + Pressure unit + + + Flow / leak + + + Flow unit + + + Pressure (raw x1000) + + + Pressure unit code (raw) + + + Flow (raw x1000) + + + Flow unit code (raw) + + + Identifier + + + Value + + + Value (raw x1000) + + + Number of parameters read + + + Parameters + + + Parameter + + + Found + + + Number of parameters (1-35) + + + Identifiers + + + Fill time [s] + + + Stabilization time [s] + + + Test time [s] + + + Dump time [s] + + + Test type + + + Minimum fill pressure + + + Maximum fill pressure + + + Test part reject level + + + Reference part reject level + + + Fill set point + + + Command echo + + + Command error + + + Command running + + + Current program + + + Results in FIFO + + + Step + + + Step (raw) + + + Real time + + + Action + + + Ready + + + Last part passed + + + Last command error word + + + Instrument + + + Last result + + + Preset parameters + + + Fail test part + + + Fail reference part + + + Pressure error + + + Cycle end + + + Part recoverable + + + Calibration error or drift + + + ATR error or drift + + + Key presence + + + Input module 1 (slot 1, 00h..3Fh) + + + Input module 2 (slot 2, 40h..7Fh) + + + Input module 3 (slot 3, 80h..BFh) + + + Input module 4 (slot 4, C0h..FFh) + + + Output module 1 (slot 5, 00h..3Fh) + + + Output module 2 (slot 6, 40h..7Fh) + + + Output module 3 (slot 7, 80h..BFh) + + + Output module 4 (slot 8, C0h..FFh) + + + IN + + + OUT + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.sk-SK.resx b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.sk-SK.resx new file mode 100644 index 00000000..13f86fee --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/Properties/Localizations.sk-SK.resx @@ -0,0 +1,564 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Surová hodnota + + + Reset + + + Štart + + + Špeciálny cyklus + + + Výber programu + + + Čítať výsledky FIFO + + + Čítať parametre + + + Zapísať parametre + + + Vymazať výsledky FIFO + + + Čítať konfiguráciu prístroja + + + Čítať konfiguračné bity + + + Čítať funkčné bity + + + Zapísať konfiguračné bity + + + Zapísať funkčné bity + + + Čítať názov programu + + + Zapísať názov programu + + + Čítať posledný výsledok + + + Čas informácie + + + Časový limit úlohy (0 = vyp.) + + + Časový limit potvrdenia príkazu (na krok) + + + Časový limit testovacieho cyklu + + + Príkazové slovo + + + Príkazové bity + + + Číslo programu (ako na displeji, 1-128) + + + Inštrukcia špeciálneho cyklu + + + Požiadavka na parametre + + + Vybraný parameter + + + Platný + + + Program + + + Typ testu (surový) + + + Vyhovuje + + + Testovaný diel nevyhovuje (max. prietok) + + + Referenčný diel nevyhovuje (min. prietok) + + + Alarm + + + Chyba tlaku (neoverené) + + + Diel opraviteľný (neoverené) + + + Chyba kalibrácie (neoverené) + + + Chyba kontroly kalibrácie (neoverené) + + + Chyba ATR (neoverené) + + + Obraz relé (surový) + + + Kód alarmu + + + Kód alarmu (surový) + + + Meranie + + + Tlak + + + Jednotka tlaku + + + Prietok / netesnosť + + + Jednotka prietoku + + + Tlak (surový x1000) + + + Kód jednotky tlaku (surový) + + + Prietok (surový x1000) + + + Kód jednotky prietoku (surový) + + + Počet prečítaných parametrov + + + Parametre + + + Parameter + + + Nájdené + + + Hodnota + + + Hodnota (surová x1000) + + + Počet parametrov (1-35) + + + Identifikátory + + + Čas plnenia [s] + + + Čas stabilizácie [s] + + + Čas testu [s] + + + Čas vypustenia [s] + + + Typ testu + + + Minimálny plniaci tlak + + + Maximálny plniaci tlak + + + Hranica odmietnutia testovaného dielu + + + Hranica odmietnutia referenčného dielu + + + Žiadaná hodnota plnenia + + + Identifikátor + + + Potvrdenie príkazu + + + Chyba príkazu + + + Príkaz prebieha + + + Aktuálny program + + + Výsledky vo FIFO + + + Stav + + + Krok + + + Krok (surový) + + + Reálny čas + + + Testovaný diel nevyhovuje + + + Referenčný diel nevyhovuje + + + Chyba tlaku + + + Koniec cyklu + + + Diel opraviteľný + + + Chyba alebo drift kalibrácie + + + Chyba alebo drift ATR + + + Prítomnosť kľúča + + + Akcia + + + Pripravený + + + Posledný diel vyhovel + + + Posledné chybové slovo príkazu + + + Prístroj + + + Posledný výsledok + + + Prednastavené parametre + + + Riadenie + + + Konfigurácia + + + Chyba PN + + + Vybrať program + + + Spustiť testovací cyklus + + + Spustiť špeciálny cyklus + + + Obnoviť + + + Obnovenie bolo vykonané. + + + IN + + + OUT + + + Vstupný modul 1 (slot 1, 00h..3Fh) + + + Vstupný modul 2 (slot 2, 40h..7Fh) + + + Vstupný modul 3 (slot 3, 80h..BFh) + + + Vstupný modul 4 (slot 4, C0h..FFh) + + + Výstupný modul 1 (slot 5, 00h..3Fh) + + + Výstupný modul 2 (slot 6, 40h..7Fh) + + + Výstupný modul 3 (slot 7, 80h..BFh) + + + Výstupný modul 4 (slot 8, C0h..FFh) + + + Neplatný odkaz: + + + Prístroj stále potvrdzuje predchádzajúci príkaz. Resetujte prístroj a potom obnovte komponent. + + + Prístroj nepotvrdil príkaz. Skontrolujte pripojenie PROFINET a režim zbernice 5 Standard. + + + Prístroj hlási chybu príkazu. Pozri LastCommandError: nastavený bit označuje neúspešný príkaz. + + + Prístroj nedokončil príkaz. Skontrolujte na displeji prístroja otvorené menu alebo alarm. + + + Prístroj neuvoľnil potvrdenie príkazu. Resetujte prístroj a potom obnovte komponent. + + + Testovací cyklus sa nespustil. Skontrolujte alarmy prístroja a platnosť programu. + + + Testovací cyklus neskončil v čase Config.CycleTimeout. + + + Prekročený čas úlohy (Config.ErrorTime). + + + Príkaz bol prerušený. + + + Pre obnovenie potvrďte tento alarm. + + + Čítanie posledného výsledku + + + Posledný výsledok prečítaný + + + Mapovať na predvoľbu + + + Kontrola požiadavky na parametre + + + Počet požadovaných parametrov je mimo rozsahu (1-35). + + + Čítanie parametrov + + + Parametre prečítané + + + Resetovanie prístroja + + + Prístroj resetovaný + + + Kontrola čísla programu + + + Číslo programu je mimo rozsahu (1-128). Zadajte číslo programu tak, ako je zobrazené na displeji prístroja. + + + Výber programu + + + Overenie vybraného programu + + + Prístroj neprepol na požadovaný program. Skontrolujte, či program v prístroji existuje. + + + Program vybraný + + + Čakanie na pripravenosť prístroja + + + Nie je vybraný žiadny špeciálny cyklus. + + + Prístroj nie je pripravený (žiadny koniec cyklu). Počkajte na dokončenie bežiaceho cyklu alebo resetujte prístroj. + + + Spúšťanie špeciálneho cyklu + + + Špeciálny cyklus prebieha + + + Špeciálny cyklus ukončený + + + Spúšťanie testovacieho cyklu + + + Testovací cyklus prebieha + + + Posledný výsledok nepatrí k požadovanému programu. Bol prečítaný starý výsledok. + + + Testovací cyklus ukončený + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/TcoAteqMeasurementConnector.csproj b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/TcoAteqMeasurementConnector.csproj new file mode 100644 index 00000000..2b0e3674 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/TcoAteqMeasurementConnector.csproj @@ -0,0 +1,59 @@ + + + + Library + net48;net5.0 + false + + TcOpen.TcoAteqMeasurementConnector + TcOpenGroup contributors + TcOpenGroup + https://github.com/TcOpenGroup/TcOpen + MIT + git + TwinCAT3 Beckhoff + Early dev stage. Experimental. DO NOT USE IN PRODUCTION!!! + http://docs.tcopengroup.org/ + https://avatars.githubusercontent.com/u/72873267?s=60&v=4 + + + TRACE;PLC_DOCU + AnyCPU + + + PLC_DOCU + AnyCPU + + + PLC_DOCU + AnyCPU + + + + + + + + + + + + + + + + True + True + Localizations.resx + + + + + PublicResXFileCodeGenerator + Localizations.Designer.cs + + + + + + diff --git a/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/ddf/GSDML-V2.32-HILSCHER-COMX 51XX-RE PNS-20160502.xml b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/ddf/GSDML-V2.32-HILSCHER-COMX 51XX-RE PNS-20160502.xml new file mode 100644 index 00000000..cc4558a4 --- /dev/null +++ b/src/TcoAteqMeasurement/src/TcoAteqMeasurementConnector/ddf/GSDML-V2.32-HILSCHER-COMX 51XX-RE PNS-20160502.xml @@ -0,0 +1,950 @@ + + + + PROFINET Device Profile + 1.00 + Device Profile for PROFINET Devices + PROFIBUS Nutzerorganisation e. V. (PNO) + Device + + 4 + 1 + GSDML + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_AlarmCode_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_AlarmCode_v_3_5_x.TcDUT new file mode 100644 index 00000000..ab510dcd --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_AlarmCode_v_3_5_x.TcDUT @@ -0,0 +1,32 @@ + + + + + + Alarm code of the last result (exchange zone 26h). Codes that are not listed decode to Unknown. + + +~*) +{attribute 'qualified_only'} +{attribute 'strict'} +TYPE eTcoAteqG6_AlarmCode_v_3_5_x : +( + Unknown := -1, + NoAlarm := 0, + PressureSwitchTooHigh := 1, + PressureSwitchTooLow := 2, + LargeLeakOnTest := 3, + LargeLeakOnReference := 4, + SensorOutOfOrder := 7, + PressureTooHigh := 43, + PressureTooLow := 44, + PiezoSensorOutOfOrder := 45, + DumpError := 46, + CalibrationDrift := 47, + AtmosphericPressureError := 73, + TemperatureError := 74 +) INT; +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_ParameterId_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_ParameterId_v_3_5_x.TcDUT new file mode 100644 index 00000000..0f76e3d0 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_ParameterId_v_3_5_x.TcDUT @@ -0,0 +1,104 @@ + + + + + + Parameter identifiers of the "Read parameters" command (manual pp. 43-46). Every value is exchanged as LONG x1000; times in seconds, levels in the instrument units, selections as code x1000. + + +~*) +{attribute 'qualified_only'} +{attribute 'strict'} +TYPE eTcoAteqG6_ParameterId_v_3_5_x : +( + None := 0, + FillTime := 1, + StabTime := 2, + TestTime := 3, + PreFillTime := 6, + DumpTime := 9, + CouplingTimeA := 10, + CouplingTimeB := 11, + PartVolume := 20, + TestType := 21, + InterCycleTime := 29, + ResultHoldTime := 48, + MinFill := 50, + MaxFill := 51, + PressureUnit := 53, + TestFail := 60, + TestRework := 61, + RefFail := 62, + RefRework := 63, + SetFill := 66, + DiffAutoResetTime := 80, + FillMode := 103, + ExternalDumpType := 110, + Input7Function := 112, + Language := 123, + MaxPreFill := 126, + FlowUnit := 127, + CalibrationLeakRate := 128, + Filter := 148, + UnitType := 149, + BarGraphMaxReject := 158, + VolumeUnit := 161, + NextProgram := 164, + PiezoAutoZeroCycles := 165, + PiezoAutoZeroMinutes := 166, + DelayExt1 := 249, + DelayExt2 := 250, + DelayExt3 := 251, + DelayExt4 := 252, + DelayExt5 := 253, + DelayExt6 := 254, + DelayInt2 := 255, + DelayInt1 := 256, + DelayAux1 := 257, + DelayAux2 := 258, + DelayAux3 := 259, + DelayAux4 := 260, + TimeExt1 := 261, + TimeExt2 := 262, + TimeExt3 := 263, + TimeExt4 := 264, + TimeExt5 := 265, + TimeExt6 := 266, + TimeInt2 := 267, + TimeInt1 := 268, + TimeAux1 := 269, + TimeAux2 := 270, + TimeAux3 := 271, + TimeAux4 := 272, + PressureFilter := 274, + CapillaryRange := 281, + BarCodeFirstChar := 287, + BarCodeCharCount := 288, + BarCodeProgram := 289, + GeneralPressureUnit := 353, + LinePressureMin := 354, + DisplayMode := 364, + Input8Function := 375, + Input9Function := 376, + UsbMode := 379, + SaveOn := 412, + AccessMode := 413, + Year := 414, + Month := 415, + Day := 416, + Hour := 417, + Minute := 418, + Second := 419, + LearningCycles := 459, + LearningInterCycleTime := 460, + LearningMaxOffset := 461, + LearningFlowMaster := 462, + LearningPressureMaster := 463, + LearningMinVolume := 464, + LearningMaxVolume := 465, + LearningOffset := 486 +) UINT; +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_SpecialCycle_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_SpecialCycle_v_3_5_x.TcDUT new file mode 100644 index 00000000..5205ea7e --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_SpecialCycle_v_3_5_x.TcDUT @@ -0,0 +1,31 @@ + + + + + + Special cycle table (manual p. 58). Ids 25..31 require the "Service" special-cycle function to be enabled on the instrument. + + +~*) +{attribute 'qualified_only'} +{attribute 'strict'} +TYPE eTcoAteqG6_SpecialCycle_v_3_5_x : +( + None := 0, + AtrLearning := 1, + CustomUnitLearn := 4, + CustomUnitCheck := 5, + PiezoAutoZero := 9, + RegulatorAdjust := 13, + CapillaryTemperatureCheck := 25, + TemperatureCheck := 26, + AtmPressureCheck := 27, + P1SensorCheck := 28, + Flow1Check := 29, + Flow2Check := 30, + LinePressureSensorCheck := 31 +) INT; +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_Step_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_Step_v_3_5_x.TcDUT new file mode 100644 index 00000000..6c80b19d --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_Step_v_3_5_x.TcDUT @@ -0,0 +1,26 @@ + + + + + + Current test step (input 0Eh). None = FFFFh on the bus (no cycle running). + + +~*) +{attribute 'qualified_only'} +{attribute 'strict'} +TYPE eTcoAteqG6_Step_v_3_5_x : +( + Unknown := -2, + None := -1, + PreFill := 0, + Fill := 1, + ZeroDiff := 2, + Stabilization := 3, + Test := 4, + Dump := 5 +) INT; +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_TestType_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_TestType_v_3_5_x.TcDUT new file mode 100644 index 00000000..b5111479 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_TestType_v_3_5_x.TcDUT @@ -0,0 +1,22 @@ + + + + + + Test type parameter (id 21). + + +~*) +{attribute 'qualified_only'} +{attribute 'strict'} +TYPE eTcoAteqG6_TestType_v_3_5_x : +( + Unknown := -1, + Invalid := 0, + Direct := 1, + Operator := 2 +) INT; +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_Unit_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_Unit_v_3_5_x.TcDUT new file mode 100644 index 00000000..2ef3dd50 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/Enums/eTcoAteqG6_Unit_v_3_5_x.TcDUT @@ -0,0 +1,44 @@ + + + + + + Unit table (manual p. 48). On the bus a unit is a LONG holding the unit code; the enum value is that code divided by 1000 (14000 = mbar). + + +~*) +{attribute 'qualified_only'} +{attribute 'strict'} +TYPE eTcoAteqG6_Unit_v_3_5_x : +( + Unknown := -1, + cm3_s := 0, + cm3_min := 1, + cm3_h := 2, + Pa := 6, + bar := 11, + kPa := 12, + PSI := 13, + mbar := 14, + MPa := 15, + l_h := 30, + inch3_s := 46, + inch3_min := 47, + inch3_h := 48, + ft3_h := 49, + ml_s := 50, + ml_min := 51, + ml_h := 52, + mm3 := 55, + cm3 := 56, + ml := 61, + l := 62, + inch3 := 63, + ft3 := 64, + SCCM := 84, + Points := 92 +) INT; +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_CommandBits_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_CommandBits_v_3_5_x.TcDUT new file mode 100644 index 00000000..d7d8c8e8 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_CommandBits_v_3_5_x.TcDUT @@ -0,0 +1,50 @@ + + + + + + Bit view of a command, echo or error word (bit 0 = Reset ... bit 15 = Read last result). + + +~*) +TYPE TcoAteqG6_CommandBits_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Raw#>"} + Raw : WORD; + {attribute addProperty Name "<#Reset#>"} + Reset : BOOL; + {attribute addProperty Name "<#Start#>"} + Start : BOOL; + {attribute addProperty Name "<#Special cycle#>"} + SpecialCycle : BOOL; + {attribute addProperty Name "<#Program selection#>"} + ProgramSelection : BOOL; + {attribute addProperty Name "<#Read FIFO results#>"} + ReadFifo : BOOL; + {attribute addProperty Name "<#Read parameters#>"} + ReadParameters : BOOL; + {attribute addProperty Name "<#Write parameters#>"} + WriteParameters : BOOL; + {attribute addProperty Name "<#Reset FIFO results#>"} + ResetFifo : BOOL; + {attribute addProperty Name "<#Read instrument configuration#>"} + ReadInstrumentConfiguration : BOOL; + {attribute addProperty Name "<#Read configuration bits#>"} + ReadConfigurationBits : BOOL; + {attribute addProperty Name "<#Read function bits#>"} + ReadFunctionBits : BOOL; + {attribute addProperty Name "<#Write configuration bits#>"} + WriteConfigurationBits : BOOL; + {attribute addProperty Name "<#Write function bits#>"} + WriteFunctionBits : BOOL; + {attribute addProperty Name "<#Read program name#>"} + ReadProgramName : BOOL; + {attribute addProperty Name "<#Write program name#>"} + WriteProgramName : BOOL; + {attribute addProperty Name "<#Read last result#>"} + ReadLastResult : BOOL; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Config_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Config_v_3_5_x.TcDUT new file mode 100644 index 00000000..0a389ad1 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Config_v_3_5_x.TcDUT @@ -0,0 +1,24 @@ + + + + + + Configuration of TcoAteqG6Pn_v_3_5_x. CommandTimeout / CycleTimeout of 0 fall back to 5 s / 60 s. + + +~*) +TYPE TcoAteqG6_Config_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Info time#>"} + InfoTime : TIME := T#2S; + {attribute addProperty Name "<#Task timeout (0 = off)#>"} + ErrorTime : TIME := T#0S; + {attribute addProperty Name "<#Command handshake timeout (per step)#>"} + CommandTimeout : TIME := T#5S; + {attribute addProperty Name "<#Test cycle timeout#>"} + CycleTimeout : TIME := T#60S; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Control_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Control_v_3_5_x.TcDUT new file mode 100644 index 00000000..7a63144d --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Control_v_3_5_x.TcDUT @@ -0,0 +1,30 @@ + + + + + + Output data: 00h command word, 06h program number (0-based on the bus), 08h special cycle id, 09h special cycle instruction, 20h parameter request. The whole output image is rewritten every cycle. + + +~*) +TYPE TcoAteqG6_Control_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Command word#>"} + Command : WORD; + {attribute addProperty Name "<#Command bits#>"} + CommandBits : TcoAteqG6_CommandBits_v_3_5_x; + {attribute addProperty Name "<#Program number (as displayed, 1-128)#>"} + ProgramNumber : INT; + {attribute addProperty Name "<#Special cycle#>"} + SpecialCycle : eTcoAteqG6_SpecialCycle_v_3_5_x; + {attribute addProperty Name "<#Special cycle instruction#>"} + SpecialCycleInstruction : BYTE; + {attribute addProperty Name "<#Parameter request#>"} + ParameterRequest : TcoAteqG6_ParameterRequest_v_3_5_x; + {attribute addProperty Name "<#Selected parameter#>"} + QueryParameter : eTcoAteqG6_ParameterId_v_3_5_x; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_LastResult_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_LastResult_v_3_5_x.TcDUT new file mode 100644 index 00000000..92a5e8bc --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_LastResult_v_3_5_x.TcDUT @@ -0,0 +1,48 @@ + + + + + + Last result, decoded from the exchange zone (20h..37h) after the "Read last result" command. Valid = no alarm. + + +~*) +TYPE TcoAteqG6_LastResult_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Valid#>"} + Valid : BOOL; + {attribute addProperty Name "<#Program#>"} + ProgramNo : INT; + {attribute addProperty Name "<#Test type (raw)#>"} + TestTypeRaw : INT; + {attribute addProperty Name "<#Pass#>"} + Pass : BOOL; + {attribute addProperty Name "<#Fail test part (maximum flow reject)#>"} + FailTest : BOOL; + {attribute addProperty Name "<#Fail reference part (minimum flow reject)#>"} + FailReference : BOOL; + {attribute addProperty Name "<#Alarm#>"} + Alarm : BOOL; + {attribute addProperty Name "<#Pressure error (unverified)#>"} + PressureError : BOOL; + {attribute addProperty Name "<#Part recoverable (unverified)#>"} + Recoverable : BOOL; + {attribute addProperty Name "<#Calibration error (unverified)#>"} + CalibrationError : BOOL; + {attribute addProperty Name "<#Calibration check error (unverified)#>"} + CalibrationCheckError : BOOL; + {attribute addProperty Name "<#ATR fault (unverified)#>"} + AtrFault : BOOL; + {attribute addProperty Name "<#Relay image (raw)#>"} + RelayImageRaw : WORD; + {attribute addProperty Name "<#Alarm code#>"} + AlarmCode : eTcoAteqG6_AlarmCode_v_3_5_x; + {attribute addProperty Name "<#Alarm code (raw)#>"} + AlarmCodeRaw : INT; + {attribute addProperty Name "<#Measurement#>"} + Measurement : TcoAteqG6_Measurement_v_3_5_x; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Measurement_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Measurement_v_3_5_x.TcDUT new file mode 100644 index 00000000..eadd0b61 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Measurement_v_3_5_x.TcDUT @@ -0,0 +1,32 @@ + + + + + + Pressure and flow with their units: four LONGs (value x1000, unit code). + + +~*) +TYPE TcoAteqG6_Measurement_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Pressure#>"} + Pressure : REAL; + {attribute addProperty Name "<#Pressure unit#>"} + PressureUnit : eTcoAteqG6_Unit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.Unknown; + {attribute addProperty Name "<#Flow / leak#>"} + Flow : REAL; + {attribute addProperty Name "<#Flow unit#>"} + FlowUnit : eTcoAteqG6_Unit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.Unknown; + {attribute addProperty Name "<#Pressure (raw x1000)#>"} + PressureRaw : DINT; + {attribute addProperty Name "<#Pressure unit code (raw)#>"} + PressureUnitRaw : DINT; + {attribute addProperty Name "<#Flow (raw x1000)#>"} + FlowRaw : DINT; + {attribute addProperty Name "<#Flow unit code (raw)#>"} + FlowUnitRaw : DINT; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterList_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterList_v_3_5_x.TcDUT new file mode 100644 index 00000000..f975f5c8 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterList_v_3_5_x.TcDUT @@ -0,0 +1,20 @@ + + + + + + Response of the "Read parameters" command: from input 20h one identifier WORD + value LONG x1000 per parameter. + + +~*) +TYPE TcoAteqG6_ParameterList_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Number of parameters read#>"} + Count : INT; + {attribute addProperty Name "<#Parameters#>"} + Items : ARRAY[0..34] OF TcoAteqG6_Parameter_v_3_5_x; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterQuery_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterQuery_v_3_5_x.TcDUT new file mode 100644 index 00000000..56c3418c --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterQuery_v_3_5_x.TcDUT @@ -0,0 +1,24 @@ + + + + + + Value of the selected parameter (Control.QueryParameter), looked up after every "Read parameters". + + +~*) +TYPE TcoAteqG6_ParameterQuery_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Parameter#>"} + Parameter : eTcoAteqG6_ParameterId_v_3_5_x; + {attribute addProperty Name "<#Found#>"} + Found : BOOL; + {attribute addProperty Name "<#Value#>"} + Value : REAL; + {attribute addProperty Name "<#Value (raw x1000)#>"} + Raw : DINT; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterRequest_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterRequest_v_3_5_x.TcDUT new file mode 100644 index 00000000..a0a14010 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterRequest_v_3_5_x.TcDUT @@ -0,0 +1,20 @@ + + + + + + Request of the "Read parameters" command (output 20h: count, then up to 35 identifiers). + + +~*) +TYPE TcoAteqG6_ParameterRequest_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Number of parameters (1-35)#>"} + Count : INT; + {attribute addProperty Name "<#Identifiers#>"} + Ids : ARRAY[0..34] OF UINT; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterSet_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterSet_v_3_5_x.TcDUT new file mode 100644 index 00000000..c6d14b02 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_ParameterSet_v_3_5_x.TcDUT @@ -0,0 +1,38 @@ + + + + + + Typed view of the commonly used program parameters (manual p. 43), filled by ReadPresetParameters. + + +~*) +TYPE TcoAteqG6_ParameterSet_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Fill time [s]#>"} + FillTime : REAL; + {attribute addProperty Name "<#Stabilization time [s]#>"} + StabTime : REAL; + {attribute addProperty Name "<#Test time [s]#>"} + TestTime : REAL; + {attribute addProperty Name "<#Dump time [s]#>"} + DumpTime : REAL; + {attribute addProperty Name "<#Test type#>"} + TestType : eTcoAteqG6_TestType_v_3_5_x; + {attribute addProperty Name "<#Minimum fill pressure#>"} + MinFill : REAL; + {attribute addProperty Name "<#Maximum fill pressure#>"} + MaxFill : REAL; + {attribute addProperty Name "<#Pressure unit#>"} + PressureUnit : eTcoAteqG6_Unit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.Unknown; + {attribute addProperty Name "<#Test part reject level#>"} + TestFail : REAL; + {attribute addProperty Name "<#Reference part reject level#>"} + RefFail : REAL; + {attribute addProperty Name "<#Fill set point#>"} + SetFill : REAL; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Parameter_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Parameter_v_3_5_x.TcDUT new file mode 100644 index 00000000..ec1072ba --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Parameter_v_3_5_x.TcDUT @@ -0,0 +1,22 @@ + + + + + + One parameter of the "Read parameters" response. + + +~*) +TYPE TcoAteqG6_Parameter_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Identifier#>"} + Id : UINT; + {attribute addProperty Name "<#Value#>"} + Value : REAL; + {attribute addProperty Name "<#Value (raw x1000)#>"} + Raw : DINT; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_State_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_State_v_3_5_x.TcDUT new file mode 100644 index 00000000..4c7a533e --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_State_v_3_5_x.TcDUT @@ -0,0 +1,36 @@ + + + + + + Decoded input image: 00h echo, 02h error word (FFFFh = command running), 06h program (0-based on the bus), 08h results in FIFO, 0Ah test type, 0Ch status bits, 0Eh step, 10h..1Fh real-time pressure/flow. + + +~*) +TYPE TcoAteqG6_State_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Command echo#>"} + Echo : TcoAteqG6_CommandBits_v_3_5_x; + {attribute addProperty Name "<#Command error#>"} + Error : TcoAteqG6_CommandBits_v_3_5_x; + {attribute addProperty Name "<#Command running#>"} + CommandRunning : BOOL; + {attribute addProperty Name "<#Current program#>"} + CurrentProgram : INT; + {attribute addProperty Name "<#Results in FIFO#>"} + ResultsInFifo : INT; + {attribute addProperty Name "<#Test type (raw)#>"} + TestTypeRaw : INT; + {attribute addProperty Name "<#Status#>"} + StatusBits : TcoAteqG6_StatusBits_v_3_5_x; + {attribute addProperty Name "<#Step#>"} + Step : eTcoAteqG6_Step_v_3_5_x := eTcoAteqG6_Step_v_3_5_x.None; + {attribute addProperty Name "<#Step (raw)#>"} + StepRaw : INT; + {attribute addProperty Name "<#Real time#>"} + RealTime : TcoAteqG6_Measurement_v_3_5_x; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_StatusBits_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_StatusBits_v_3_5_x.TcDUT new file mode 100644 index 00000000..660f6616 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_StatusBits_v_3_5_x.TcDUT @@ -0,0 +1,38 @@ + + + + + + Status word of the instrument (input 0Ch). Bits 8 and 10..14 are not used. + + +~*) +TYPE TcoAteqG6_StatusBits_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Raw#>"} + Raw : WORD; + {attribute addProperty Name "<#Pass#>"} + Pass : BOOL; + {attribute addProperty Name "<#Fail test part#>"} + FailTest : BOOL; + {attribute addProperty Name "<#Fail reference part#>"} + FailReference : BOOL; + {attribute addProperty Name "<#Alarm#>"} + Alarm : BOOL; + {attribute addProperty Name "<#Pressure error#>"} + PressureError : BOOL; + {attribute addProperty Name "<#Cycle end#>"} + CycleEnd : BOOL; + {attribute addProperty Name "<#Part recoverable#>"} + Recoverable : BOOL; + {attribute addProperty Name "<#Calibration error or drift#>"} + CalibrationError : BOOL; + {attribute addProperty Name "<#ATR error or drift#>"} + AtrError : BOOL; + {attribute addProperty Name "<#Key presence#>"} + KeyPresence : BOOL; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Status_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Status_v_3_5_x.TcDUT new file mode 100644 index 00000000..65580915 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/DUTs/G6/TcoAteqG6_Status_v_3_5_x.TcDUT @@ -0,0 +1,34 @@ + + + + + + Status of TcoAteqG6Pn_v_3_5_x. + + +~*) +TYPE TcoAteqG6_Status_v_3_5_x : +STRUCT + {attribute addProperty Name "<#Action#>"} + ActionDescription : STRING(100); + {attribute addProperty Name "<#Ready#>"} + Ready : BOOL; + {attribute addProperty Name "<#Last part passed#>"} + LastPass : BOOL; + {attribute addProperty Name "<#Last command error word#>"} + LastCommandError : WORD; + {attribute addProperty Name "<#Instrument#>"} + State : TcoAteqG6_State_v_3_5_x; + {attribute addProperty Name "<#Last result#>"} + LastResult : TcoAteqG6_LastResult_v_3_5_x; + {attribute addProperty Name "<#Parameters#>"} + Parameters : TcoAteqG6_ParameterList_v_3_5_x; + {attribute addProperty Name "<#Preset parameters#>"} + ParameterSet : TcoAteqG6_ParameterSet_v_3_5_x; + {attribute addProperty Name "<#Selected parameter#>"} + ParameterQuery : TcoAteqG6_ParameterQuery_v_3_5_x; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_AddParameterToRequest_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_AddParameterToRequest_v_3_5_x.TcPOU new file mode 100644 index 00000000..69d32a72 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_AddParameterToRequest_v_3_5_x.TcPOU @@ -0,0 +1,27 @@ + + + + + + Appends a parameter identifier to the request. Returns FALSE when the request is full (35). + + +~*) +FUNCTION TcoAteqG6_AddParameterToRequest_v_3_5_x : BOOL +VAR_INPUT + inParameter : eTcoAteqG6_ParameterId_v_3_5_x; +END_VAR +VAR_IN_OUT + inoRequest : TcoAteqG6_ParameterRequest_v_3_5_x; +END_VAR]]> + + = 35 THEN + RETURN; +END_IF +inoRequest.Ids[inoRequest.Count] := TO_UINT(inParameter); +inoRequest.Count := inoRequest.Count + 1; +TcoAteqG6_AddParameterToRequest_v_3_5_x := TRUE;]]> + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_BuildPresetRequest_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_BuildPresetRequest_v_3_5_x.TcPOU new file mode 100644 index 00000000..6890c990 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_BuildPresetRequest_v_3_5_x.TcPOU @@ -0,0 +1,31 @@ + + + + + + Fills the request with the 11 identifiers of the preset parameter set. + + +~*) +FUNCTION TcoAteqG6_BuildPresetRequest_v_3_5_x : BOOL +VAR_IN_OUT + inoRequest : TcoAteqG6_ParameterRequest_v_3_5_x; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearLastResult_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearLastResult_v_3_5_x.TcPOU new file mode 100644 index 00000000..8ba9f641 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearLastResult_v_3_5_x.TcPOU @@ -0,0 +1,35 @@ + + + + + + Clears the last result (Valid = FALSE). + + +~*) +FUNCTION TcoAteqG6_ClearLastResult_v_3_5_x : BOOL +VAR_IN_OUT + inoResult : TcoAteqG6_LastResult_v_3_5_x; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearMeasurement_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearMeasurement_v_3_5_x.TcPOU new file mode 100644 index 00000000..c21060b8 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearMeasurement_v_3_5_x.TcPOU @@ -0,0 +1,27 @@ + + + + + + Clears a measurement. + + +~*) +FUNCTION TcoAteqG6_ClearMeasurement_v_3_5_x : BOOL +VAR_IN_OUT + inoMeasurement : TcoAteqG6_Measurement_v_3_5_x; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearParameterList_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearParameterList_v_3_5_x.TcPOU new file mode 100644 index 00000000..803d7486 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearParameterList_v_3_5_x.TcPOU @@ -0,0 +1,28 @@ + + + + + + Clears a parameter list. + + +~*) +FUNCTION TcoAteqG6_ClearParameterList_v_3_5_x : BOOL +VAR_IN_OUT + inoList : TcoAteqG6_ParameterList_v_3_5_x; +END_VAR +VAR + i : INT; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearParameterRequest_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearParameterRequest_v_3_5_x.TcPOU new file mode 100644 index 00000000..a66ffeb3 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ClearParameterRequest_v_3_5_x.TcPOU @@ -0,0 +1,26 @@ + + + + + + Clears a parameter request. + + +~*) +FUNCTION TcoAteqG6_ClearParameterRequest_v_3_5_x : BOOL +VAR_IN_OUT + inoRequest : TcoAteqG6_ParameterRequest_v_3_5_x; +END_VAR +VAR + i : INT; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeCommandBits_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeCommandBits_v_3_5_x.TcPOU new file mode 100644 index 00000000..5ff45e77 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeCommandBits_v_3_5_x.TcPOU @@ -0,0 +1,39 @@ + + + + + + Bit view of a command, echo or error word. + + +~*) +FUNCTION TcoAteqG6_DecodeCommandBits_v_3_5_x : BOOL +VAR_INPUT + inValue : WORD; +END_VAR +VAR_IN_OUT + inoBits : TcoAteqG6_CommandBits_v_3_5_x; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeLastResult_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeLastResult_v_3_5_x.TcPOU new file mode 100644 index 00000000..dbe70ccc --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeLastResult_v_3_5_x.TcPOU @@ -0,0 +1,36 @@ + + + + + + Decodes the last result from the exchange zone (20h program, 22h test type, 24h relay image, 26h alarm code, 28h..37h measurement). Relay bits 4..8 are not verified on hardware. + + +~*) +FUNCTION TcoAteqG6_DecodeLastResult_v_3_5_x : BOOL +VAR_IN_OUT + inoImage : ARRAY[0..255] OF BYTE; + inoResult : TcoAteqG6_LastResult_v_3_5_x; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeMeasurement_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeMeasurement_v_3_5_x.TcPOU new file mode 100644 index 00000000..1b732c96 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeMeasurement_v_3_5_x.TcPOU @@ -0,0 +1,31 @@ + + + + + + Decodes pressure, pressure unit, flow and flow unit (4 LONGs) from inOffset. + + +~*) +FUNCTION TcoAteqG6_DecodeMeasurement_v_3_5_x : BOOL +VAR_INPUT + inOffset : INT; +END_VAR +VAR_IN_OUT + inoImage : ARRAY[0..255] OF BYTE; + inoMeasurement : TcoAteqG6_Measurement_v_3_5_x; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeParameterList_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeParameterList_v_3_5_x.TcPOU new file mode 100644 index 00000000..6cb0d52a --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeParameterList_v_3_5_x.TcPOU @@ -0,0 +1,39 @@ + + + + + + Decodes inCount parameters (identifier WORD + value LONG x1000 each) from inOffset. A count outside 1..35 leaves the list empty. + + +~*) +FUNCTION TcoAteqG6_DecodeParameterList_v_3_5_x : BOOL +VAR_INPUT + inOffset : INT; + inCount : INT; +END_VAR +VAR_IN_OUT + inoImage : ARRAY[0..255] OF BYTE; + inoList : TcoAteqG6_ParameterList_v_3_5_x; +END_VAR +VAR + i : INT; + pos : INT; +END_VAR]]> + + 35 THEN + RETURN; +END_IF +FOR i := 0 TO inCount - 1 DO + pos := inOffset + 6 * i; + inoList.Items[i].Id := WORD_TO_UINT(TcoAteqG6_GetWord_v_3_5_x(inOffset := pos, inoImage := inoImage)); + inoList.Items[i].Raw := TcoAteqG6_GetDint_v_3_5_x(inOffset := pos + 2, inoImage := inoImage); + inoList.Items[i].Value := TcoAteqG6_ToEngineering_v_3_5_x(inoList.Items[i].Raw); +END_FOR +inoList.Count := inCount; +TcoAteqG6_DecodeParameterList_v_3_5_x := TRUE;]]> + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeState_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeState_v_3_5_x.TcPOU new file mode 100644 index 00000000..165aad68 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeState_v_3_5_x.TcPOU @@ -0,0 +1,30 @@ + + + + + + Decodes the live part of the input image (00h..1Fh). The program number is 0-based on the bus and 1-based here. + + +~*) +FUNCTION TcoAteqG6_DecodeState_v_3_5_x : BOOL +VAR_IN_OUT + inoImage : ARRAY[0..255] OF BYTE; + inoState : TcoAteqG6_State_v_3_5_x; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeStatusBits_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeStatusBits_v_3_5_x.TcPOU new file mode 100644 index 00000000..88f6816f --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_DecodeStatusBits_v_3_5_x.TcPOU @@ -0,0 +1,33 @@ + + + + + + Bit view of the status word (input 0Ch). + + +~*) +FUNCTION TcoAteqG6_DecodeStatusBits_v_3_5_x : BOOL +VAR_INPUT + inValue : WORD; +END_VAR +VAR_IN_OUT + inoBits : TcoAteqG6_StatusBits_v_3_5_x; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_EncodeControl_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_EncodeControl_v_3_5_x.TcPOU new file mode 100644 index 00000000..41a457e3 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_EncodeControl_v_3_5_x.TcPOU @@ -0,0 +1,40 @@ + + + + + + Encodes the control data into the 256-byte output image (00h command, 06h program, 08h/09h special cycle, 20h parameter request). + + +~*) +FUNCTION TcoAteqG6_EncodeControl_v_3_5_x : BOOL +VAR_IN_OUT + inoControl : TcoAteqG6_Control_v_3_5_x; + inoImage : ARRAY[0..255] OF BYTE; +END_VAR +VAR + i : INT; +END_VAR]]> + + = 1 THEN + TcoAteqG6_SetWord_v_3_5_x(inOffset := 16#06, inValue := INT_TO_WORD(inoControl.ProgramNumber - 1), inoImage := inoImage); +END_IF +inoImage[16#08] := TcoAteqG6_SpecialCycleToByte_v_3_5_x(inoControl.SpecialCycle); +inoImage[16#09] := inoControl.SpecialCycleInstruction; +// 20h: parameter request - count, then 35 identifiers (22h..67h) +TcoAteqG6_SetWord_v_3_5_x(inOffset := 16#20, inValue := INT_TO_WORD(inoControl.ParameterRequest.Count), inoImage := inoImage); +FOR i := 0 TO 34 DO + TcoAteqG6_SetWord_v_3_5_x(inOffset := 16#22 + 2 * i, inValue := UINT_TO_WORD(inoControl.ParameterRequest.Ids[i]), inoImage := inoImage); +END_FOR +TcoAteqG6_EncodeControl_v_3_5_x := TRUE;]]> + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_GetDint_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_GetDint_v_3_5_x.TcPOU new file mode 100644 index 00000000..523d787f --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_GetDint_v_3_5_x.TcPOU @@ -0,0 +1,25 @@ + + + + + + Little-endian LONG at inOffset (least significant word first). + + +~*) +FUNCTION TcoAteqG6_GetDint_v_3_5_x : DINT +VAR_INPUT + inOffset : INT; +END_VAR +VAR_IN_OUT + inoImage : ARRAY[0..255] OF BYTE; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_GetInt_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_GetInt_v_3_5_x.TcPOU new file mode 100644 index 00000000..2978ca62 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_GetInt_v_3_5_x.TcPOU @@ -0,0 +1,22 @@ + + + + + + Little-endian INT at inOffset. + + +~*) +FUNCTION TcoAteqG6_GetInt_v_3_5_x : INT +VAR_INPUT + inOffset : INT; +END_VAR +VAR_IN_OUT + inoImage : ARRAY[0..255] OF BYTE; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_GetWord_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_GetWord_v_3_5_x.TcPOU new file mode 100644 index 00000000..ca6fe35c --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_GetWord_v_3_5_x.TcPOU @@ -0,0 +1,22 @@ + + + + + + Little-endian WORD at inOffset (ATEQ fieldbus data: least significant byte first). + + +~*) +FUNCTION TcoAteqG6_GetWord_v_3_5_x : WORD +VAR_INPUT + inOffset : INT; +END_VAR +VAR_IN_OUT + inoImage : ARRAY[0..255] OF BYTE; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_IsParameterRequestValid_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_IsParameterRequestValid_v_3_5_x.TcPOU new file mode 100644 index 00000000..a2457bca --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_IsParameterRequestValid_v_3_5_x.TcPOU @@ -0,0 +1,19 @@ + + + + + + TRUE when the request holds 1..35 identifiers. + + +~*) +FUNCTION TcoAteqG6_IsParameterRequestValid_v_3_5_x : BOOL +VAR_IN_OUT + inoRequest : TcoAteqG6_ParameterRequest_v_3_5_x; +END_VAR]]> + + = 1 AND inoRequest.Count <= 35;]]> + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_MapPresetParameters_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_MapPresetParameters_v_3_5_x.TcPOU new file mode 100644 index 00000000..7ef6a6d5 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_MapPresetParameters_v_3_5_x.TcPOU @@ -0,0 +1,31 @@ + + + + + + Maps a list read with the preset request onto the typed parameter set. + + +~*) +FUNCTION TcoAteqG6_MapPresetParameters_v_3_5_x : BOOL +VAR_IN_OUT + inoList : TcoAteqG6_ParameterList_v_3_5_x; + inoSet : TcoAteqG6_ParameterSet_v_3_5_x; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_QueryParameter_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_QueryParameter_v_3_5_x.TcPOU new file mode 100644 index 00000000..ffc12048 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_QueryParameter_v_3_5_x.TcPOU @@ -0,0 +1,32 @@ + + + + + + Looks inParameter up in a list that was read. + + +~*) +FUNCTION TcoAteqG6_QueryParameter_v_3_5_x : BOOL +VAR_INPUT + inParameter : eTcoAteqG6_ParameterId_v_3_5_x; +END_VAR +VAR_IN_OUT + inoList : TcoAteqG6_ParameterList_v_3_5_x; + inoQuery : TcoAteqG6_ParameterQuery_v_3_5_x; +END_VAR]]> + + inoQuery.Found); +inoQuery.Value := TcoAteqG6_ToEngineering_v_3_5_x(inoQuery.Raw);]]> + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_SetDint_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_SetDint_v_3_5_x.TcPOU new file mode 100644 index 00000000..e1146dec --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_SetDint_v_3_5_x.TcPOU @@ -0,0 +1,31 @@ + + + + + + Writes a little-endian LONG at inOffset. + + +~*) +FUNCTION TcoAteqG6_SetDint_v_3_5_x : BOOL +VAR_INPUT + inOffset : INT; + inValue : DINT; +END_VAR +VAR_IN_OUT + inoImage : ARRAY[0..255] OF BYTE; +END_VAR +VAR + raw : DWORD; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_SetWord_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_SetWord_v_3_5_x.TcPOU new file mode 100644 index 00000000..8a5b48bc --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_SetWord_v_3_5_x.TcPOU @@ -0,0 +1,25 @@ + + + + + + Writes a little-endian WORD at inOffset. + + +~*) +FUNCTION TcoAteqG6_SetWord_v_3_5_x : BOOL +VAR_INPUT + inOffset : INT; + inValue : WORD; +END_VAR +VAR_IN_OUT + inoImage : ARRAY[0..255] OF BYTE; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_SpecialCycleToByte_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_SpecialCycleToByte_v_3_5_x.TcPOU new file mode 100644 index 00000000..27f16f4f --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_SpecialCycleToByte_v_3_5_x.TcPOU @@ -0,0 +1,34 @@ + + + + + + Special cycle to its id byte (output 08h). + + +~*) +FUNCTION TcoAteqG6_SpecialCycleToByte_v_3_5_x : BYTE +VAR_INPUT + inValue : eTcoAteqG6_SpecialCycle_v_3_5_x; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToAlarmCode_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToAlarmCode_v_3_5_x.TcPOU new file mode 100644 index 00000000..abadce41 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToAlarmCode_v_3_5_x.TcPOU @@ -0,0 +1,35 @@ + + + + + + Alarm code word to alarm code. + + +~*) +FUNCTION TcoAteqG6_ToAlarmCode_v_3_5_x : eTcoAteqG6_AlarmCode_v_3_5_x +VAR_INPUT + inRaw : INT; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToEngineering_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToEngineering_v_3_5_x.TcPOU new file mode 100644 index 00000000..b7f114b2 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToEngineering_v_3_5_x.TcPOU @@ -0,0 +1,19 @@ + + + + + + Fixed-point LONG (x1000) to engineering value. + + +~*) +FUNCTION TcoAteqG6_ToEngineering_v_3_5_x : REAL +VAR_INPUT + inRaw : DINT; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToStep_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToStep_v_3_5_x.TcPOU new file mode 100644 index 00000000..57d8986b --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToStep_v_3_5_x.TcPOU @@ -0,0 +1,29 @@ + + + + + + Step word to step. + + +~*) +FUNCTION TcoAteqG6_ToStep_v_3_5_x : eTcoAteqG6_Step_v_3_5_x +VAR_INPUT + inRaw : INT; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToTestType_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToTestType_v_3_5_x.TcPOU new file mode 100644 index 00000000..05a86323 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToTestType_v_3_5_x.TcPOU @@ -0,0 +1,25 @@ + + + + + + Test type parameter value (code x1000) to test type. + + +~*) +FUNCTION TcoAteqG6_ToTestType_v_3_5_x : eTcoAteqG6_TestType_v_3_5_x +VAR_INPUT + inRaw : DINT; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToUnit_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToUnit_v_3_5_x.TcPOU new file mode 100644 index 00000000..b470504a --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_ToUnit_v_3_5_x.TcPOU @@ -0,0 +1,53 @@ + + + + + + Unit code (LONG, code x1000) to unit. Codes that are not listed or not a multiple of 1000 give Unknown. + + +~*) +FUNCTION TcoAteqG6_ToUnit_v_3_5_x : eTcoAteqG6_Unit_v_3_5_x +VAR_INPUT + inRaw : DINT; +END_VAR +VAR + code : DINT; +END_VAR]]> + + 0 THEN + RETURN; +END_IF +code := inRaw / 1000; +CASE code OF + 0: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.cm3_s; + 1: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.cm3_min; + 2: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.cm3_h; + 6: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.Pa; + 11: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.bar; + 12: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.kPa; + 13: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.PSI; + 14: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.mbar; + 15: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.MPa; + 30: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.l_h; + 46: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.inch3_s; + 47: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.inch3_min; + 48: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.inch3_h; + 49: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.ft3_h; + 50: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.ml_s; + 51: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.ml_min; + 52: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.ml_h; + 55: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.mm3; + 56: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.cm3; + 61: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.ml; + 62: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.l; + 63: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.inch3; + 64: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.ft3; + 84: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.SCCM; + 92: TcoAteqG6_ToUnit_v_3_5_x := eTcoAteqG6_Unit_v_3_5_x.Points; +END_CASE]]> + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_TryGetParameterRaw_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_TryGetParameterRaw_v_3_5_x.TcPOU new file mode 100644 index 00000000..abd2982d --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Functions/G6/TcoAteqG6_TryGetParameterRaw_v_3_5_x.TcPOU @@ -0,0 +1,35 @@ + + + + + + Raw value of parameter inId; outFound is FALSE when it is not in the list. + + +~*) +FUNCTION TcoAteqG6_TryGetParameterRaw_v_3_5_x : DINT +VAR_INPUT + inId : UINT; +END_VAR +VAR_IN_OUT + inoList : TcoAteqG6_ParameterList_v_3_5_x; +END_VAR +VAR_OUTPUT + outFound : BOOL; +END_VAR +VAR + i : INT; +END_VAR]]> + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/MAIN.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/MAIN.TcPOU new file mode 100644 index 00000000..461a9270 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/MAIN.TcPOU @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/IO/TcoAteqG6Pn_IO_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/IO/TcoAteqG6Pn_IO_v_3_5_x.TcDUT new file mode 100644 index 00000000..9d4c7d1e --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/IO/TcoAteqG6Pn_IO_v_3_5_x.TcDUT @@ -0,0 +1,16 @@ + + + + "} + In : TcoAteqG6_Inputs_v_3_5_x; + {attribute addProperty Name "<#OUT#>"} + Out : TcoAteqG6_Outputs_v_3_5_x; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/IO/TcoAteqG6_Inputs_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/IO/TcoAteqG6_Inputs_v_3_5_x.TcDUT new file mode 100644 index 00000000..775e7539 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/IO/TcoAteqG6_Inputs_v_3_5_x.TcDUT @@ -0,0 +1,17 @@ + + + + "} + In1 AT %I* : ARRAY[0..63] OF BYTE; + {attribute addProperty Name "<#Input module 2 (slot 2, 40h..7Fh)#>"} + In2 AT %I* : ARRAY[0..63] OF BYTE; + {attribute addProperty Name "<#Input module 3 (slot 3, 80h..BFh)#>"} + In3 AT %I* : ARRAY[0..63] OF BYTE; + {attribute addProperty Name "<#Input module 4 (slot 4, C0h..FFh)#>"} + In4 AT %I* : ARRAY[0..63] OF BYTE; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/IO/TcoAteqG6_Outputs_v_3_5_x.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/IO/TcoAteqG6_Outputs_v_3_5_x.TcDUT new file mode 100644 index 00000000..bdeba0ec --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/IO/TcoAteqG6_Outputs_v_3_5_x.TcDUT @@ -0,0 +1,17 @@ + + + + "} + Out1 AT %Q* : ARRAY[0..63] OF BYTE; + {attribute addProperty Name "<#Output module 2 (slot 6, 40h..7Fh)#>"} + Out2 AT %Q* : ARRAY[0..63] OF BYTE; + {attribute addProperty Name "<#Output module 3 (slot 7, 80h..BFh)#>"} + Out3 AT %Q* : ARRAY[0..63] OF BYTE; + {attribute addProperty Name "<#Output module 4 (slot 8, C0h..FFh)#>"} + Out4 AT %Q* : ARRAY[0..63] OF BYTE; +END_STRUCT +END_TYPE]]> + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/TcoAteqG6Pn_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/TcoAteqG6Pn_v_3_5_x.TcPOU new file mode 100644 index 00000000..03cfabbc --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/G6/TcoAteqG6Pn_v_3_5_x.TcPOU @@ -0,0 +1,447 @@ + + + + + + ATEQ G6 leak tester (G6 Series - Profinet, fieldbus software 3.5, fieldbus mode 5 "Standard"), PN. + The interface uses 4 input modules of 64 bytes (slots 1-4) and 4 output modules of 64 bytes (slots 5-8); + they are mapped to one 256-byte input image and one 256-byte output image. All data are little-endian, + measured values and parameters are LONG x1000, program numbers are 0-based on the bus and 1-based here. + Commands use the ATEQ handshake (command bit -> echo -> error word -> release), see TcoAteqG6Task_v_3_5_x. + Ported from AXOpen AxoG6 v_3_5_x; the hardware-ID bootstrap and the numeric error codes are not ported. + + +~*) +FUNCTION_BLOCK TcoAteqG6Pn_v_3_5_x EXTENDS TcoIo.TcoPnIoComponent +VAR_INPUT + inEnable : BOOL; +END_VAR +VAR_IN_OUT + inoData : TcoAteqG6Pn_IO_v_3_5_x; +END_VAR +VAR + {attribute addProperty Name "<#Status#>"} + {attribute clr [ReadOnly()]} + _status : TcoAteqG6_Status_v_3_5_x; + {attribute addProperty Name "<#Control#>"} + _control : TcoAteqG6_Control_v_3_5_x; + {attribute addProperty Name "<#Config#>"} + _config : TcoAteqG6_Config_v_3_5_x; + {attribute addProperty Name "<#PN Error#>"} + {attribute clr [ReadOnly()]} + _busError : BOOL; +END_VAR +VAR + {attribute addProperty Name "<#Reset#>"} + _resetTask : TcoAteqG6_ResetTask_v_3_5_x(THIS^); + + {attribute addProperty Name "<#Select program#>"} + _selectProgramTask : TcoAteqG6_SelectProgramTask_v_3_5_x(THIS^); + + {attribute addProperty Name "<#Start test cycle#>"} + _startCycleTask : TcoAteqG6_StartCycleTask_v_3_5_x(THIS^); + + {attribute addProperty Name "<#Read last result#>"} + _readLastResultTask : TcoAteqG6_ReadLastResultTask_v_3_5_x(THIS^); + + {attribute addProperty Name "<#Start special cycle#>"} + _specialCycleTask : TcoAteqG6_SpecialCycleTask_v_3_5_x(THIS^); + + {attribute addProperty Name "<#Read parameters#>"} + _readParametersTask : TcoAteqG6_ReadParametersTask_v_3_5_x(THIS^); + + {attribute addProperty Name "<#Restore#>"} + _restoreTask : TcoCore.TcoTask(THIS^); +END_VAR +VAR + {attribute 'hide'} + _inputImage : ARRAY[0..255] OF BYTE; + {attribute 'hide'} + _outputImage : ARRAY[0..255] OF BYTE; + {attribute 'hide'} + _sb : TcoCore.StringBuilder; +END_VAR]]> + + + + + + + + + Gets the configuration of the instrument. + + +~*) +PROPERTY Config : REFERENCE TO TcoAteqG6_Config_v_3_5_x]]> + + + + + + + + + + + + + + + + + + + + Gets the status of the instrument (live state, last result, parameters). + + +~*) +PROPERTY Status : REFERENCE TO TcoAteqG6_Status_v_3_5_x]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Restores this instance to the Ready state. Can be called explicitly or from within one of the restore mechanisms. + + +~*) +METHOD Restore : ITcoRestorable]]> + + ';]]> + + + + + + + + + + + + Custom service (manual, maintenance) logic. + + +~*) +METHOD PROTECTED ServiceMode]]> + + + + + + + + Copies the 4 input modules into the 256-byte input image and decodes the live state. + + +~*) +METHOD INTERNAL UpdateStatus]]> + + + + + + + + Encodes the control data into the 256-byte output image and copies it to the 4 output modules. + + +~*) +METHOD INTERNAL UpdateControl]]> + + + + + + + + Resets the instrument. Aborts any other running command. + + +~*) +METHOD PUBLIC Reset : TcoCore.ITcoTaskStatus]]> + + + + + + + + Selects program inProgram (1-128, as shown on the instrument display). + + +~*) +METHOD PUBLIC SelectProgram : TcoCore.ITcoTaskStatus +VAR_INPUT + inProgram : INT; +END_VAR]]> + + + + + + + + Runs a complete test cycle on program inProgram (1-128) and reads its result into Status.LastResult. + + +~*) +METHOD PUBLIC StartCycle : TcoCore.ITcoTaskStatus +VAR_INPUT + inProgram : INT; +END_VAR]]> + + + + + + + + + + + + + + Runs special cycle inSpecialCycle with instruction inInstruction on the currently selected program. + + +~*) +METHOD PUBLIC SpecialCycle : TcoCore.ITcoTaskStatus +VAR_INPUT + inSpecialCycle : eTcoAteqG6_SpecialCycle_v_3_5_x; + inInstruction : BYTE; +END_VAR]]> + + + + + + + + Reads the parameters listed in inoRequest (1-35 identifiers) into Status.Parameters. + + +~*) +METHOD PUBLIC ReadParameters : TcoCore.ITcoTaskStatus +VAR_IN_OUT + inoRequest : TcoAteqG6_ParameterRequest_v_3_5_x; +END_VAR]]> + + + + + + + + Reads the preset parameters (times, test type, fill levels, reject levels) into Status.ParameterSet. + + +~*) +METHOD PUBLIC ReadPresetParameters : TcoCore.ITcoTaskStatus]]> + + + + + + + + Reads one parameter; the value is in Status.ParameterQuery. + + +~*) +METHOD PUBLIC ReadParameter : TcoCore.ITcoTaskStatus +VAR_INPUT + inParameter : eTcoAteqG6_ParameterId_v_3_5_x; +END_VAR]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6Task_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6Task_v_3_5_x.TcPOU new file mode 100644 index 00000000..18fa2202 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6Task_v_3_5_x.TcPOU @@ -0,0 +1,374 @@ + + + + + + Base of every ATEQ G6 command task. Owns the command handshake (manual p. 56): + own echo low -> raise the command bit (single rising edge) -> acknowledged (error word FFFFh or echo set) -> + completed (error word <> FFFFh; 0 = ok, otherwise failed) -> drop the command bit -> echo low. + Every wait is bounded by Config.CommandTimeout. The command bit is always dropped on done, error, abort and + restore - the instrument only reacts to rising edges, so a bit left high would make it miss the next command. + + +~*) +FUNCTION_BLOCK PUBLIC ABSTRACT TcoAteqG6Task_v_3_5_x EXTENDS TcoCore.TcoTask +VAR_IN_OUT + inoConfig : TcoAteqG6_Config_v_3_5_x; + inoControl : TcoAteqG6_Control_v_3_5_x; + inoStatus : TcoAteqG6_Status_v_3_5_x; + inoImage : ARRAY[0..255] OF BYTE; +END_VAR +VAR + _errorMessage : TcoCore.TcoMessenger(THIS^); + {attribute 'hide'} + _progress : INT := 0; + {attribute 'hide'} + _hsStep : INT := 0; + {attribute 'hide'} + _activeMask : WORD; + {attribute 'hide'} + _cycleRunningSeen : BOOL; + {attribute 'hide'} + _failText : STRING(254); + {attribute 'hide'} + _stepTimer : TON; + {attribute 'hide'} + _hsTimer : TON; + {attribute 'hide'} + _infoTimer : TON; + {attribute 'hide'} + _errorTimer : TON; + {attribute 'hide'} + _varInfo : __SYSTEM.VAR_INFO; + {attribute 'hide'} + _sb : TcoCore.StringBuilder; +END_VAR +VAR CONSTANT + MASK_RESET : WORD := 16#0001; + MASK_START : WORD := 16#0002; + MASK_SPECIAL_CYCLE : WORD := 16#0006; // Start + Special cycle, sent together + MASK_PROGRAM_SELECTION : WORD := 16#0008; + MASK_READ_PARAMETERS : WORD := 16#0020; + MASK_READ_LAST_RESULT : WORD := 16#8000; +END_VAR]]> + + + + + + + T#0S OR NOT inValue THEN + _errorTimer(IN := inValue, PT := THIS^.inoConfig.ErrorTime); +END_IF +IF __ISVALIDREF(inoConfig) AND THIS^.inoConfig.InfoTime <> T#0S OR NOT inValue THEN + _infoTimer(IN := inValue, PT := THIS^.inoConfig.InfoTime); +END_IF]]> + + + + + + Checks the references to the config, control, status and input image. Returns TRUE when all of them are valid. + + +~*) +METHOD PROTECTED CheckReferences : BOOL]]> + + ').Append(_varInfo.Symbol).ToString()).Pin(); +ELSIF NOT __ISVALIDREF(inoConfig) THEN + _varInfo := __VARINFO(inoConfig); + Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); +ELSIF NOT __ISVALIDREF(inoStatus) THEN + _varInfo := __VARINFO(inoStatus); + Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); +ELSIF NOT __ISVALIDREF(inoImage) THEN + _varInfo := __VARINFO(inoImage); + Messenger.Programming(_sb.Clear().Append('<#Invalid reference: #>').Append(_varInfo.Symbol).ToString()).Pin(); +ELSE + CheckReferences := TRUE; +END_IF]]> + + + + + + T#0S THEN + CommandTimeout := THIS^.inoConfig.CommandTimeout; +ELSE + CommandTimeout := T#5S; +END_IF]]> + + + + + + T#0S THEN + CycleTimeout := THIS^.inoConfig.CycleTimeout; +ELSE + CycleTimeout := T#60S; +END_IF]]> + + + + + + Puts the task into error with the text inText, keeps the command error word and drops the command bit. + + +~*) +METHOD PROTECTED Fail +VAR_INPUT + inText : STRING(254); +END_VAR]]> + + + + + + + + Moves to inStep and restarts the step timer. + + +~*) +METHOD PROTECTED GoTo +VAR_INPUT + inStep : INT; +END_VAR]]> + + + + + + + + Runs one command handshake for inMask. Returns TRUE in the cycle the handshake finished successfully; + on any failure the task is put into error. + + +~*) +METHOD PROTECTED Handshake : BOOL +VAR_INPUT + inMask : WORD; +END_VAR]]> + + '); + RETURN; + END_IF +END_IF + +// 1: raise the command bit - a single rising edge +IF _hsStep = 1 THEN + _activeMask := inMask; + inoControl.Command := inoControl.Command OR inMask; + _hsStep := 2; +END_IF + +// 2: acknowledged - command running (FFFFh) or already echoed +IF _hsStep = 2 THEN + _hsTimer(IN := TRUE, PT := CommandTimeout()); + IF inoStatus.State.Error.Raw = 16#FFFF OR (inoStatus.State.Echo.Raw AND inMask) = inMask THEN + _hsTimer(IN := FALSE); + _hsStep := 3; + ELSIF _hsTimer.Q THEN + Fail('<#Command was not acknowledged by the instrument. Check the PROFINET connection and fieldbus mode 5 Standard.#>'); + RETURN; + END_IF +END_IF + +// 3: completed - error word left FFFFh; 0 = success, anything else = failed +IF _hsStep = 3 THEN + _hsTimer(IN := TRUE, PT := CommandTimeout()); + IF inoStatus.State.Error.Raw <> 16#FFFF AND (inoStatus.State.Echo.Raw AND inMask) = inMask THEN + _hsTimer(IN := FALSE); + IF inoStatus.State.Error.Raw <> 0 THEN + Fail('<#Instrument reported a command error. See LastCommandError: the set bit names the failed command.#>'); + RETURN; + END_IF + _hsStep := 4; + ELSIF _hsTimer.Q THEN + Fail('<#Command was not completed by the instrument. Check the instrument display for a running menu or alarm.#>'); + RETURN; + END_IF +END_IF + +// 4: drop the command bit +IF _hsStep = 4 THEN + ReleaseCommand(); + _hsStep := 5; +END_IF + +// 5: echo released +IF _hsStep = 5 THEN + _hsTimer(IN := TRUE, PT := CommandTimeout()); + IF (inoStatus.State.Echo.Raw AND inMask) = 0 THEN + _hsTimer(IN := FALSE); + _hsStep := 0; + Handshake := TRUE; + ELSIF _hsTimer.Q THEN + Fail('<#Instrument did not release the command echo. Reset the instrument, then restore the component.#>'); + RETURN; + END_IF +END_IF]]> + + + + + + Waits for a full cycle after a start command: CycleEnd must be seen FALSE (cycle running, within + Config.CommandTimeout of the start) and then TRUE again (within Config.CycleTimeout). Call it every cycle from + the moment the start bit is raised, so a cycle that starts during the handshake is not missed. + Returns TRUE when the cycle ended. + + +~*) +METHOD PROTECTED ObserveCycle : BOOL +VAR_INPUT + inWaiting : BOOL; // FALSE while the start handshake is still running +END_VAR]]> + + '); + END_IF +ELSIF inoStatus.State.StatusBits.CycleEnd THEN + ObserveCycle := TRUE; +ELSIF StepElapsed(CycleTimeout()) THEN + Fail('<#Test cycle did not end within Config.CycleTimeout.#>'); +END_IF]]> + + + + + + 0 THEN + THIS^.inoControl.Command := THIS^.inoControl.Command AND NOT _activeMask; +END_IF +_activeMask := 0;]]> + + + + + + TRUE when the current step has been active longer than inLimit. + + +~*) +METHOD PROTECTED StepElapsed : BOOL +VAR_INPUT + inLimit : TIME; +END_VAR]]> + + + + + + + + Per-cycle bookkeeping: progress information after Config.InfoTime and the optional task timeout Config.ErrorTime. + + +~*) +METHOD PROTECTED Supervise]]> + + '); +END_IF]]> + + + + + + '; END_IF]]> + + + + + + + + + + + + ').ToString()).Pin();]]> + + + + + + + + + + + + Restores this instance to the Ready state and drops its command bit. + + +~*) +METHOD Restore : ITcoRestorable]]> + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_ReadLastResultTask_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_ReadLastResultTask_v_3_5_x.TcPOU new file mode 100644 index 00000000..e72f9254 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_ReadLastResultTask_v_3_5_x.TcPOU @@ -0,0 +1,58 @@ + + + + + + Read last result (command bit 15) and decode the exchange zone into Status.LastResult. + + +~*) +FUNCTION_BLOCK TcoAteqG6_ReadLastResultTask_v_3_5_x EXTENDS TcoAteqG6Task_v_3_5_x]]> + + '; + IF Handshake(MASK_READ_LAST_RESULT) THEN + TcoAteqG6_DecodeLastResult_v_3_5_x(inoImage := inoImage, inoResult := inoStatus.LastResult); + GoTo(100); + END_IF + END_IF + + // AX step 100 + IF _progress = 100 THEN + inoStatus.ActionDescription := '<#Last result read#>'; + DoneWhen(TRUE); + END_IF + Supervise(); + END_IF +END_IF + +IF THIS^.Error AND NOT _errorMessage.Pinned THEN + THIS^.Restore(); +END_IF]]> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_ReadParametersTask_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_ReadParametersTask_v_3_5_x.TcPOU new file mode 100644 index 00000000..c0ccecf9 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_ReadParametersTask_v_3_5_x.TcPOU @@ -0,0 +1,85 @@ + + + + + + Read parameters (command bit 5) of the currently selected program: sends Control.ParameterRequest and decodes the response into Status.Parameters. With the map-to-preset flag the list is also mapped onto Status.ParameterSet. Control.QueryParameter is looked up after every read. Read-only - this component never writes parameters. + + +~*) +FUNCTION_BLOCK TcoAteqG6_ReadParametersTask_v_3_5_x EXTENDS TcoAteqG6Task_v_3_5_x +VAR + {attribute addProperty Name "<#Map to preset#>"} + {attribute clr [ReadOnly()]} + _mapToPreset : BOOL; +END_VAR]]> + + '; + IF TcoAteqG6_IsParameterRequestValid_v_3_5_x(inoRequest := inoControl.ParameterRequest) THEN + GoTo(10); + ELSE + Fail('<#Number of requested parameters out of range (1-35).#>'); + END_IF + END_IF + + // AX step 10: read and decode + IF _progress = 10 THEN + inoStatus.ActionDescription := '<#Reading parameters#>'; + IF Handshake(MASK_READ_PARAMETERS) THEN + TcoAteqG6_DecodeParameterList_v_3_5_x(inOffset := 16#20, + inCount := inoControl.ParameterRequest.Count, + inoImage := inoImage, + inoList := inoStatus.Parameters); + IF _mapToPreset THEN + TcoAteqG6_MapPresetParameters_v_3_5_x(inoList := inoStatus.Parameters, inoSet := inoStatus.ParameterSet); + END_IF + TcoAteqG6_QueryParameter_v_3_5_x(inParameter := inoControl.QueryParameter, + inoList := inoStatus.Parameters, + inoQuery := inoStatus.ParameterQuery); + GoTo(100); + END_IF + END_IF + + // AX step 100 + IF _progress = 100 THEN + inoStatus.ActionDescription := '<#Parameters read#>'; + DoneWhen(TRUE); + END_IF + Supervise(); + END_IF +END_IF + +IF THIS^.Error AND NOT _errorMessage.Pinned THEN + THIS^.Restore(); +END_IF]]> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_ResetTask_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_ResetTask_v_3_5_x.TcPOU new file mode 100644 index 00000000..39542acd --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_ResetTask_v_3_5_x.TcPOU @@ -0,0 +1,48 @@ + + + + + + Reset command (command bit 0). Never blocked; aborts any other running command. + + +~*) +FUNCTION_BLOCK TcoAteqG6_ResetTask_v_3_5_x EXTENDS TcoAteqG6Task_v_3_5_x]]> + + '; + IF Handshake(MASK_RESET) THEN + GoTo(100); + END_IF + END_IF + + // AX step 100 + IF _progress = 100 THEN + inoStatus.ActionDescription := '<#Instrument reset#>'; + DoneWhen(TRUE); + END_IF + Supervise(); + END_IF +END_IF + +IF THIS^.Error AND NOT _errorMessage.Pinned THEN + THIS^.Restore(); +END_IF]]> + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_SelectProgramTask_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_SelectProgramTask_v_3_5_x.TcPOU new file mode 100644 index 00000000..0d55e563 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_SelectProgramTask_v_3_5_x.TcPOU @@ -0,0 +1,68 @@ + + + + + + Program selection (command bit 3) of Control.ProgramNumber, then checks that the instrument switched to it. + + +~*) +FUNCTION_BLOCK TcoAteqG6_SelectProgramTask_v_3_5_x EXTENDS TcoAteqG6Task_v_3_5_x]]> + + '; + IF inoControl.ProgramNumber < 1 OR inoControl.ProgramNumber > 128 THEN + Fail('<#Program number out of range (1-128). Pass the program number as shown on the instrument display.#>'); + ELSE + GoTo(10); + END_IF + END_IF + + // AX step 10: select the program + IF _progress = 10 THEN + inoStatus.ActionDescription := '<#Selecting program#>'; + IF Handshake(MASK_PROGRAM_SELECTION) THEN + GoTo(20); + END_IF + END_IF + + // AX step 20: the instrument reports the requested program + IF _progress = 20 THEN + inoStatus.ActionDescription := '<#Verifying selected program#>'; + IF inoStatus.State.CurrentProgram = inoControl.ProgramNumber THEN + GoTo(100); + ELSIF StepElapsed(CommandTimeout()) THEN + Fail('<#Instrument did not switch to the requested program. Check that the program exists on the instrument.#>'); + END_IF + END_IF + + // AX step 100 + IF _progress = 100 THEN + inoStatus.ActionDescription := '<#Program selected#>'; + DoneWhen(TRUE); + END_IF + Supervise(); + END_IF +END_IF + +IF THIS^.Error AND NOT _errorMessage.Pinned THEN + THIS^.Restore(); +END_IF]]> + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_SpecialCycleTask_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_SpecialCycleTask_v_3_5_x.TcPOU new file mode 100644 index 00000000..c7eb67c9 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_SpecialCycleTask_v_3_5_x.TcPOU @@ -0,0 +1,70 @@ + + + + + + Special cycle Control.SpecialCycle (id at output 08h, instruction at 09h), started with the Start and Special cycle bits together (manual pp. 58-59), then waits for the cycle end. Runs on the currently selected program. + + +~*) +FUNCTION_BLOCK TcoAteqG6_SpecialCycleTask_v_3_5_x EXTENDS TcoAteqG6Task_v_3_5_x]]> + + '; + IF inoControl.SpecialCycle = eTcoAteqG6_SpecialCycle_v_3_5_x.None THEN + Fail('<#No special cycle selected.#>'); + ELSIF inoStatus.State.StatusBits.CycleEnd THEN + _cycleRunningSeen := FALSE; + GoTo(10); + ELSIF StepElapsed(CommandTimeout()) THEN + Fail('<#Instrument is not ready (no cycle end). Wait for the running cycle to finish or reset the instrument.#>'); + END_IF + END_IF + + // AX step 10: start the special cycle + IF _progress = 10 THEN + inoStatus.ActionDescription := '<#Starting special cycle#>'; + ObserveCycle(inWaiting := FALSE); + IF Handshake(MASK_SPECIAL_CYCLE) THEN + GoTo(20); + END_IF + END_IF + + // AX step 20: cycle runs and ends + IF _progress = 20 THEN + inoStatus.ActionDescription := '<#Special cycle running#>'; + IF ObserveCycle(inWaiting := TRUE) THEN + GoTo(100); + END_IF + END_IF + + // AX step 100 + IF _progress = 100 THEN + inoStatus.ActionDescription := '<#Special cycle finished#>'; + DoneWhen(TRUE); + END_IF + Supervise(); + END_IF +END_IF + +IF THIS^.Error AND NOT _errorMessage.Pinned THEN + THIS^.Restore(); +END_IF]]> + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_StartCycleTask_v_3_5_x.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_StartCycleTask_v_3_5_x.TcPOU new file mode 100644 index 00000000..aeb82475 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/POUs/Prototypes/MeasurementTasks/G6_v_3_5_x/TcoAteqG6_StartCycleTask_v_3_5_x.TcPOU @@ -0,0 +1,116 @@ + + + + + + Complete test cycle on Control.ProgramNumber: select the program, start, wait for the cycle to run and end, then read the last result. A result whose program number differs from the requested one is refused as stale. The results FIFO is never reset. + + +~*) +FUNCTION_BLOCK TcoAteqG6_StartCycleTask_v_3_5_x EXTENDS TcoAteqG6Task_v_3_5_x]]> + + '; + IF inoControl.ProgramNumber < 1 OR inoControl.ProgramNumber > 128 THEN + Fail('<#Program number out of range (1-128). Pass the program number as shown on the instrument display.#>'); + ELSIF inoStatus.State.StatusBits.CycleEnd THEN + GoTo(10); + ELSIF StepElapsed(CommandTimeout()) THEN + Fail('<#Instrument is not ready (no cycle end). Wait for the running cycle to finish or reset the instrument.#>'); + END_IF + END_IF + + // AX step 10: select the program + IF _progress = 10 THEN + inoStatus.ActionDescription := '<#Selecting program#>'; + IF Handshake(MASK_PROGRAM_SELECTION) THEN + GoTo(20); + END_IF + END_IF + + // AX step 20: the instrument reports the requested program + IF _progress = 20 THEN + inoStatus.ActionDescription := '<#Verifying selected program#>'; + IF inoStatus.State.CurrentProgram = inoControl.ProgramNumber THEN + _cycleRunningSeen := FALSE; + GoTo(30); + ELSIF StepElapsed(CommandTimeout()) THEN + Fail('<#Instrument did not switch to the requested program. Check that the program exists on the instrument.#>'); + END_IF + END_IF + + // AX step 30: start; the cycle may already begin while the handshake runs + IF _progress = 30 THEN + inoStatus.ActionDescription := '<#Starting test cycle#>'; + ObserveCycle(inWaiting := FALSE); + IF Handshake(MASK_START) THEN + GoTo(40); + END_IF + END_IF + + // AX step 40: cycle runs (cycle end FALSE) and ends (cycle end TRUE) + IF _progress = 40 THEN + inoStatus.ActionDescription := '<#Test cycle running#>'; + IF ObserveCycle(inWaiting := TRUE) THEN + GoTo(50); + END_IF + END_IF + + // AX step 50: read the last result + IF _progress = 50 THEN + inoStatus.ActionDescription := '<#Reading last result#>'; + IF Handshake(MASK_READ_LAST_RESULT) THEN + TcoAteqG6_DecodeLastResult_v_3_5_x(inoImage := inoImage, inoResult := inoStatus.LastResult); + GoTo(60); + END_IF + END_IF + + // AX step 60: the result belongs to this cycle's program + IF _progress = 60 THEN + IF inoStatus.LastResult.ProgramNo = inoControl.ProgramNumber THEN + GoTo(100); + ELSE + inoStatus.LastResult.Valid := FALSE; + Fail('<#Last result does not belong to the requested program. A stale result was read.#>'); + END_IF + END_IF + + // AX step 100 + IF _progress = 100 THEN + inoStatus.ActionDescription := '<#Test cycle finished#>'; + DoneWhen(TRUE); + END_IF + Supervise(); + END_IF +END_IF + +IF THIS^.Error AND NOT _errorMessage.Pinned THEN + THIS^.Restore(); +END_IF]]> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/PlcTask.TcTTO b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/PlcTask.TcTTO new file mode 100644 index 00000000..3ffad680 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/PlcTask.TcTTO @@ -0,0 +1,17 @@ + + + + + 10000 + 20 + + MAIN + + {9e47618f-d898-4883-89dc-06a0de63aad3} + {501f7f63-8699-4e98-9461-b48244998b7b} + {2a1ec14c-24a4-4b86-8ff8-cba418ec616b} + {f1e8e28d-0124-41c5-a219-cd0c5783f42a} + {32e36b25-4859-49d5-abd3-a619e60655e2} + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/TcoAteqMeasurement.plcproj b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/TcoAteqMeasurement.plcproj new file mode 100644 index 00000000..a155b7a3 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurement/TcoAteqMeasurement.plcproj @@ -0,0 +1,2576 @@ + + + + 1.0.0.0 + 2.0 + {624c28a4-7072-4dca-b0a7-f4edc63a5ed6} + True + true + true + false + TcoAteqMeasurement + 3.1.4023.0 + {7711dc72-3b01-461d-923f-68f934b6547c} + {46a4e697-766c-45b6-bea5-e90b93c0763c} + {1b0d97b4-6712-4a24-8bff-d67b53c4766a} + {6811af2e-a7f4-43f3-8791-e2ef158d8b69} + {a16160d3-4e00-4e96-93a8-d7bd2737613a} + {c999fbab-e277-41c1-88cd-8bef9785be38} + 0.6.0.913 + Vortex.Library + TcoAteqMeasurement + TcoAteqMeasurement + false + true + + + {f4ac9ad6-b898-40ba-9327-ae3ee59c6440} + 1.0.0.0 + TcOpen + + + + {f4ac9ad6-b898-40ba-9327-ae3ee59c6440} + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + + + + + + + + + + + + + + Tc2_Standard, * (Beckhoff Automation GmbH) + Tc2_Standard + + + Tc2_System, * (Beckhoff Automation GmbH) + Tc2_System + + + Tc3_Module, * (Beckhoff Automation GmbH) + Tc3_Module + + + TcoIo, 0.6.0.913 (Vortex.Library) + TcoIo + + + TcoCore, 0.6.0.913 (Vortex.Library) + TcoCore + + + + + Content + + + + + TcoCore, 0.6.0.913 (Vortex.Library) + + + + + + + + "<ProjectRoot>" + + {192FAD59-8248-4824-A8DE-9177C94C195A} + + "{192FAD59-8248-4824-A8DE-9177C94C195A}" + + + + {246001F4-279D-43AC-B241-948EB31120E1} + + "{246001F4-279D-43AC-B241-948EB31120E1}" + + + GlobalVisuImageFilePath + %APPLICATIONPATH% + + + {29BD8D0C-3586-4548-BB48-497B9A01693F} + + "{29BD8D0C-3586-4548-BB48-497B9A01693F}" + + NamingConventions + + "NamingConventions" + + 105 + + "105" + + + stPrefix + + + + 8 + + "8" + + + stPrefix + + + + 9 + + "9" + + + stPrefix + + + + 3 + + "3" + + + stPrefix + + + + 4 + + "4" + + + stPrefix + + + + 5 + + "5" + + + stPrefix + + + + 6 + + "6" + + + stPrefix + + + + 7 + + "7" + + + stPrefix + + + + 29 + + "29" + + + stPrefix + + + + 59 + + "59" + + + stPrefix + + + + 107 + + "107" + + + stPrefix + + + + 22 + + "22" + + + stPrefix + + + + 30 + + "30" + + + stPrefix + + + + 25 + + "25" + + + stPrefix + + + + 35 + + "35" + + + stPrefix + + + + 62 + + "62" + + + stPrefix + + + + 55 + + "55" + + + stPrefix + _ + + + 65 + + "65" + + + stPrefix + + + + 108 + + "108" + + + stPrefix + I + + + 70 + + "70" + + + stPrefix + + + + 34 + + "34" + + + stPrefix + + + + 54 + + "54" + + + stPrefix + _ + + + 121 + + "121" + + + stPrefix + + + + 151 + + "151" + + + stPrefix + st + + + 10 + + "10" + + + stPrefix + + + + 102 + + "102" + + + stPrefix + prg + + + 18 + + "18" + + + stPrefix + + + + 28 + + "28" + + + stPrefix + + + + 123 + + "123" + + + stPrefix + + + + 58 + + "58" + + + stPrefix + + + + 61 + + "61" + + + stPrefix + + + + 11 + + "11" + + + stPrefix + + + + 21 + + "21" + + + stPrefix + + + + 14 + + "14" + + + stPrefix + + + + 24 + + "24" + + + stPrefix + + + + 17 + + "17" + + + stPrefix + + + + 27 + + "27" + + + stPrefix + + + + 37 + + "37" + + + stPrefix + + + + 53 + + "53" + + + stPrefix + + + + 57 + + "57" + + + stPrefix + + + + 73 + + "73" + + + stPrefix + + + + 122 + + "122" + + + stPrefix + + + + 104 + + "104" + + + stPrefix + fc + + + 153 + + "153" + + + stPrefix + union + + + 12 + + "12" + + + stPrefix + + + + 106 + + "106" + + + stPrefix + + + + 32 + + "32" + + + stPrefix + + + + 19 + + "19" + + + stPrefix + + + + 103 + + "103" + + + stPrefix + fb + + + 33 + + "33" + + + stPrefix + + + + 72 + + "72" + + + stPrefix + + + + 152 + + "152" + + + stPrefix + enum + + + 64 + + "64" + + + stPrefix + + + + 20 + + "20" + + + stPrefix + + + + 13 + + "13" + + + stPrefix + + + + 23 + + "23" + + + stPrefix + + + + 16 + + "16" + + + stPrefix + + + + 26 + + "26" + + + stPrefix + + + + 36 + + "36" + + + stPrefix + + + + 63 + + "63" + + + stPrefix + + + + 56 + + "56" + + + stPrefix + + + + 124 + + "124" + + + stPrefix + + + + 154 + + "154" + + + stPrefix + alias + + + 31 + + "31" + + + stPrefix + + + + 51 + + "51" + + + stPrefix + + + + 15 + + "15" + + + stPrefix + + + + 38 + + "38" + + + stPrefix + + + + 71 + + "71" + + + stPrefix + + + + + + + Metrics + + "Metrics" + + 9b526466-3bbe-40a9-b5a5-1cfadd791459 + + "9b526466-3bbe-40a9-b5a5-1cfadd791459" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + e58378e8-a2fb-4a33-8013-8a91270388d0 + + "e58378e8-a2fb-4a33-8013-8a91270388d0" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 2ee16325-7a34-4109-82cd-e99144bdbf43 + + "2ee16325-7a34-4109-82cd-e99144bdbf43" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + 2a5d0bd7-5767-43e1-92ab-90d924ade69e + + "2a5d0bd7-5767-43e1-92ab-90d924ade69e" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + ca51b834-cb16-4517-8b02-4807ce263107 + + "ca51b834-cb16-4517-8b02-4807ce263107" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + aebdfc4d-fc4f-4fac-bf2e-22b603bc1880 + + "aebdfc4d-fc4f-4fac-bf2e-22b603bc1880" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + bb1ff1d3-b0bc-4909-9034-11d7c6edb61f + + "bb1ff1d3-b0bc-4909-9034-11d7c6edb61f" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + 3fb5ac29-8ac7-4ca4-863e-49c3c89643b9 + + "3fb5ac29-8ac7-4ca4-863e-49c3c89643b9" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + c4137578-73e0-4a9c-ad9c-7773a1cff401 + + "c4137578-73e0-4a9c-ad9c-7773a1cff401" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + daa3e89b-a727-4bc9-bd38-29afc6024f90 + + "daa3e89b-a727-4bc9-bd38-29afc6024f90" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + b42720b9-b152-4b52-ad89-630e0f5acab1 + + "b42720b9-b152-4b52-ad89-630e0f5acab1" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 0ade9a3b-311c-4293-bc26-bcf994cdbbdc + + "0ade9a3b-311c-4293-bc26-bcf994cdbbdc" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 15c07c54-9586-460c-802f-b3b4a408e3c7 + + "15c07c54-9586-460c-802f-b3b4a408e3c7" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 19fab17a-876c-4a8d-9d74-3e5d92b63dc8 + + "19fab17a-876c-4a8d-9d74-3e5d92b63dc8" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 87b20586-90da-40d8-82ce-62a7dd0ba8af + + "87b20586-90da-40d8-82ce-62a7dd0ba8af" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + c20d083b-41ea-4867-b762-015491579932 + + "c20d083b-41ea-4867-b762-015491579932" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 827ae15d-4cb9-4177-b870-6bea1db8ee44 + + "827ae15d-4cb9-4177-b870-6bea1db8ee44" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 1a004255-b771-48b6-aa33-ea35ce4d37ea + + "1a004255-b771-48b6-aa33-ea35ce4d37ea" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + 8360c2b5-e762-4cc0-935b-fb129cda1b4a + + "8360c2b5-e762-4cc0-935b-fb129cda1b4a" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + 40f104a2-99f0-486d-9c44-47e8c759ca07 + + "40f104a2-99f0-486d-9c44-47e8c759ca07" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + 62b98ef9-b4c6-4777-bc0a-29245bb8b9f3 + + "62b98ef9-b4c6-4777-bc0a-29245bb8b9f3" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 6c74d656-f35f-41b9-b449-eae882ed12fe + + "6c74d656-f35f-41b9-b449-eae882ed12fe" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 0ba696f2-ce22-4330-931f-4ddd5c597896 + + "0ba696f2-ce22-4330-931f-4ddd5c597896" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 6549803a-9e82-4b28-aff1-2425cbec813b + + "6549803a-9e82-4b28-aff1-2425cbec813b" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 6cb1bfb1-4d4a-43ed-96f4-cd0254fc33b5 + + "6cb1bfb1-4d4a-43ed-96f4-cd0254fc33b5" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + f6dd9a78-1e71-4d9c-9e61-394eb38f3809 + + "f6dd9a78-1e71-4d9c-9e61-394eb38f3809" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 571980c1-792d-4355-a9cb-4c3a8f254ab0 + + "571980c1-792d-4355-a9cb-4c3a8f254ab0" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + eb349b41-54d8-47ed-ab7d-b5dbbc17709f + + "eb349b41-54d8-47ed-ab7d-b5dbbc17709f" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 209f2982-bd60-4988-9cf9-9ff21cbf643f + + "209f2982-bd60-4988-9cf9-9ff21cbf643f" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + + + + NamingConventionsSettings + + "NamingConventionsSettings" + + + FirstCharUpperCase + False + CombineScopeWithDatatypePrefix + True + CombinedDataTypesRecursive + True + + + Rules + + "Rules" + + 35 + + "35" + + + bWarning + False + bActive + True + + + 105 + + "105" + + + bWarning + False + bActive + False + + + 63 + + "63" + + + bWarning + False + bActive + True + + + 8 + + "8" + + + bWarning + False + bActive + True + + + 9 + + "9" + + + bWarning + False + bActive + True + + + 47 + + "47" + + + bWarning + False + bActive + True + + + 1 + + "1" + + + bWarning + False + bActive + True + + + 2 + + "2" + + + bWarning + True + bActive + True + + + 3 + + "3" + + + bWarning + False + bActive + True + + + 4 + + "4" + + + bWarning + False + bActive + False + + + 5 + + "5" + + + bWarning + False + bActive + True + + + 6 + + "6" + + + bWarning + False + bActive + False + + + 7 + + "7" + + + bWarning + False + bActive + True + + + 29 + + "29" + + + bWarning + False + bActive + True + + + 133 + + "133" + + + bWarning + False + bActive + False + + + 163 + + "163" + + + bWarning + False + bActive + False + + + 118 + + "118" + + + bWarning + False + bActive + False + + + 22 + + "22" + + + bWarning + False + bActive + True + + + 148 + + "148" + + + bWarning + False + bActive + False + + + 42 + + "42" + + + bWarning + False + bActive + True + + + 167 + + "167" + + + bWarning + False + bActive + False + + + 62 + + "62" + + + bWarning + False + bActive + True + + + 55 + + "55" + + + bWarning + False + bActive + True + + + 65 + + "65" + + + bWarning + False + bActive + True + + + 75 + + "75" + + + bWarning + False + bActive + True + + + 140 + + "140" + + + bWarning + False + bActive + True + + + 150 + + "150" + + + bWarning + False + bActive + False + + + 114 + + "114" + + + bWarning + False + bActive + False + + + 34 + + "34" + + + bWarning + False + bActive + True + + + 162 + + "162" + + + bWarning + False + bActive + False + + + 13 + + "13" + + + bWarning + False + bActive + True + + + 54 + + "54" + + + bWarning + False + bActive + True + + + 121 + + "121" + + + bWarning + False + bActive + False + + + 23 + + "23" + + + bWarning + False + bActive + True + + + 41 + + "41" + + + bWarning + False + bActive + True + + + 125 + + "125" + + + bWarning + False + bActive + False + + + 60 + + "60" + + + bWarning + False + bActive + True + + + 72 + + "72" + + + bWarning + False + bActive + True + + + 103 + + "103" + + + bWarning + False + bActive + True + + + 112 + + "112" + + + bWarning + False + bActive + False + + + 81 + + "81" + + + bWarning + False + bActive + True + + + 102 + + "102" + + + bWarning + False + bActive + True + + + 18 + + "18" + + + bWarning + False + bActive + True + + + 132 + + "132" + + + bWarning + False + bActive + True + + + 123 + + "123" + + + bWarning + False + bActive + False + + + 28 + + "28" + + + bWarning + False + bActive + False + + + 58 + + "58" + + + bWarning + False + bActive + True + + + 61 + + "61" + + + bWarning + False + bActive + True + + + 78 + + "78" + + + bWarning + False + bActive + True + + + 21 + + "21" + + + bWarning + False + bActive + True + + + 14 + + "14" + + + bWarning + False + bActive + True + + + 24 + + "24" + + + bWarning + False + bActive + False + + + 25 + + "25" + + + bWarning + False + bActive + True + + + 48 + + "48" + + + bWarning + False + bActive + True + + + 37 + + "37" + + + bWarning + False + bActive + True + + + 64 + + "64" + + + bWarning + False + bActive + True + + + 57 + + "57" + + + bWarning + False + bActive + True + + + 17 + + "17" + + + bWarning + False + bActive + True + + + 77 + + "77" + + + bWarning + False + bActive + True + + + 100 + + "100" + + + bWarning + false + nUpperLimit + 1024 + bActive + true + + + 130 + + "130" + + + bWarning + False + bActive + True + + + 160 + + "160" + + + bWarning + False + bActive + True + + + 27 + + "27" + + + bWarning + False + bActive + False + + + 164 + + "164" + + + bWarning + False + bActive + False + + + 119 + + "119" + + + bWarning + False + bActive + False + + + 20 + + "20" + + + bWarning + False + bActive + True + + + 111 + + "111" + + + bWarning + False + bActive + False + + + 12 + + "12" + + + bWarning + False + bActive + True + + + 115 + + "115" + + + bWarning + False + bActive + False + + + 106 + + "106" + + + bWarning + False + bActive + False + + + 145 + + "145" + + + bWarning + False + bActive + False + + + 19 + + "19" + + + bWarning + False + bActive + True + + + 166 + + "166" + + + MaxInOuts + 10 + bActive + false + bWarning + false + MaxOutputs + 10 + MaxInputs + 10 + + + 56 + + "56" + + + bWarning + False + bActive + True + + + 52 + + "52" + + + bWarning + False + bActive + True + + + 16 + + "16" + + + bWarning + False + bActive + False + + + 39 + + "39" + + + bWarning + False + bActive + True + + + 134 + + "134" + + + bWarning + False + bActive + False + + + 80 + + "80" + + + bWarning + False + bActive + True + + + 44 + + "44" + + + bWarning + False + bActive + True + + + 122 + + "122" + + + bWarning + False + bActive + False + + + 113 + + "113" + + + bWarning + False + bActive + False + + + 59 + + "59" + + + bWarning + False + bActive + True + + + 10 + + "10" + + + bWarning + False + bActive + True + + + 95 + + "95" + + + bWarning + False + bActive + True + + + 117 + + "117" + + + bWarning + False + bActive + False + + + 40 + + "40" + + + bWarning + False + bActive + True + + + 33 + + "33" + + + bWarning + False + bActive + False + + + 26 + + "26" + + + bWarning + False + bActive + True + + + 36 + + "36" + + + bWarning + False + bActive + True + + + 46 + + "46" + + + bWarning + False + bActive + True + + + 73 + + "73" + + + bWarning + False + bActive + False + + + 66 + + "66" + + + bWarning + False + bActive + True + + + 76 + + "76" + + + bWarning + False + bActive + True + + + 53 + + "53" + + + bWarning + False + bActive + True + + + 107 + + "107" + + + bWarning + False + bActive + False + + + 32 + + "32" + + + bWarning + False + bActive + True + + + 120 + + "120" + + + bWarning + False + bActive + False + + + 11 + + "11" + + + bWarning + True + bActive + True + + + 124 + + "124" + + + bWarning + False + bActive + False + + + 147 + + "147" + + + bWarning + False + bActive + False + + + 31 + + "31" + + + bWarning + False + bActive + True + + + 90 + + "90" + + + bWarning + False + bActive + True + + + 51 + + "51" + + + bWarning + False + bActive + True + + + 15 + + "15" + + + bWarning + False + bActive + True + + + 38 + + "38" + + + bWarning + False + bActive + True + + + 101 + + "101" + + + MinChars + 5 + bActive + false + MaxChars + 30 + Exceptions + "" + bWarning + false + + + 43 + + "43" + + + bWarning + False + bActive + True + + + 131 + + "131" + + + bWarning + False + bActive + True + + + 161 + + "161" + + + bWarning + False + bActive + True + + + + + + + + SuppressedKeywords + "" + PerformStaticAnalyse + false + + + {40450F57-0AA3-4216-96F3-5444ECB29763} + + "{40450F57-0AA3-4216-96F3-5444ECB29763}" + + + ActiveVisuExtensionsLength + 0 + ActiveVisuProfile + "IR0whWr8bwfwBwAAiD2qpQAAAABVAgAA37x72QAAAAABAAAAAAAAAAEaUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwACTHsAZgA5ADUAYgBiADQAMgA2AC0ANQA1ADIANAAtADQAYgA0ADUALQA5ADQAMAAwAC0AZgBiADAAZgAyAGUANwA3AGUANQAxAGIAfQADCE4AYQBtAGUABDBUAHcAaQBuAEMAQQBUACAAMwAuADEAIABCAHUAaQBsAGQAIAA0ADAAMgA0AC4ANwAFFlAAcgBvAGYAaQBsAGUARABhAHQAYQAGTHsAMQA2AGUANQA1AGIANgAwAC0ANwAwADQAMwAtADQAYQA2ADMALQBiADYANQBiAC0ANgAxADQANwAxADMAOAA3ADgAZAA0ADIAfQAHEkwAaQBiAHIAYQByAGkAZQBzAAhMewAzAGIAZgBkADUANAA1ADkALQBiADAANwBmAC0ANABkADYAZQAtAGEAZQAxAGEALQBhADgAMwAzADUANgBhADUANQAxADQAMgB9AAlMewA5AGMAOQA1ADgAOQA2ADgALQAyAGMAOAA1AC0ANAAxAGIAYgAtADgAOAA3ADEALQA4ADkANQBmAGYAMQBmAGUAZABlADEAYQB9AAoOVgBlAHIAcwBpAG8AbgALBmkAbgB0AAwKVQBzAGEAZwBlAA0KVABpAHQAbABlAA4aVgBpAHMAdQBFAGwAZQBtAE0AZQB0AGUAcgAPDkMAbwBtAHAAYQBuAHkAEAxTAHkAcwB0AGUAbQARElYAaQBzAHUARQBsAGUAbQBzABIwVgBpAHMAdQBFAGwAZQBtAHMAUwBwAGUAYwBpAGEAbABDAG8AbgB0AHIAbwBsAHMAEyhWAGkAcwB1AEUAbABlAG0AcwBXAGkAbgBDAG8AbgB0AHIAbwBsAHMAFCRWAGkAcwB1AEUAbABlAG0AVABlAHgAdABFAGQAaQB0AG8AcgAVIlYAaQBzAHUATgBhAHQAaQB2AGUAQwBvAG4AdAByAG8AbAAWFHYAaQBzAHUAaQBuAHAAdQB0AHMAFwxzAHkAcwB0AGUAbQAYGFYAaQBzAHUARQBsAGUAbQBCAGEAcwBlABkmRABlAHYAUABsAGEAYwBlAGgAbwBsAGQAZQByAHMAVQBzAGUAZAAaCGIAbwBvAGwAGyJQAGwAdQBnAGkAbgBDAG8AbgBzAHQAcgBhAGkAbgB0AHMAHEx7ADQAMwBkADUAMgBiAGMAZQAtADkANAAyAGMALQA0ADQAZAA3AC0AOQBlADkANAAtADEAYgBmAGQAZgAzADEAMABlADYAMwBjAH0AHRxBAHQATABlAGEAcwB0AFYAZQByAHMAaQBvAG4AHhRQAGwAdQBnAGkAbgBHAHUAaQBkAB8WUwB5AHMAdABlAG0ALgBHAHUAaQBkACBIYQBmAGMAZAA1ADQANAA2AC0ANAA5ADEANAAtADQAZgBlADcALQBiAGIANwA4AC0AOQBiAGYAZgBlAGIANwAwAGYAZAAxADcAIRRVAHAAZABhAHQAZQBJAG4AZgBvACJMewBiADAAMwAzADYANgBhADgALQBiADUAYwAwAC0ANABiADkAYQAtAGEAMAAwAGUALQBlAGIAOAA2ADAAMQAxADEAMAA0AGMAMwB9ACMOVQBwAGQAYQB0AGUAcwAkTHsAMQA4ADYAOABmAGYAYwA5AC0AZQA0AGYAYwAtADQANQAzADIALQBhAGMAMAA2AC0AMQBlADMAOQBiAGIANQA1ADcAYgA2ADkAfQAlTHsAYQA1AGIAZAA0ADgAYwAzAC0AMABkADEANwAtADQAMQBiADUALQBiADEANgA0AC0ANQBmAGMANgBhAGQAMgBiADkANgBiADcAfQAmFk8AYgBqAGUAYwB0AHMAVAB5AHAAZQAnVFUAcABkAGEAdABlAEwAYQBuAGcAdQBhAGcAZQBNAG8AZABlAGwARgBvAHIAQwBvAG4AdgBlAHIAdABpAGIAbABlAEwAaQBiAHIAYQByAGkAZQBzACgQTABpAGIAVABpAHQAbABlACkUTABpAGIAQwBvAG0AcABhAG4AeQAqHlUAcABkAGEAdABlAFAAcgBvAHYAaQBkAGUAcgBzACs4UwB5AHMAdABlAG0ALgBDAG8AbABsAGUAYwB0AGkAbwBuAHMALgBIAGEAcwBoAHQAYQBiAGwAZQAsEnYAaQBzAHUAZQBsAGUAbQBzAC1INgBjAGIAMQBjAGQAZQAxAC0AZAA1AGQAYwAtADQAYQAzAGIALQA5ADAANQA0AC0AMgAxAGYAYQA3ADUANgBhADMAZgBhADQALihJAG4AdABlAHIAZgBhAGMAZQBWAGUAcgBzAGkAbwBuAEkAbgBmAG8AL0x7AGMANgAxADEAZQA0ADAAMAAtADcAZgBiADkALQA0AGMAMwA1AC0AYgA5AGEAYwAtADQAZQAzADEANABiADUAOQA5ADYANAAzAH0AMBhNAGEAagBvAHIAVgBlAHIAcwBpAG8AbgAxGE0AaQBuAG8AcgBWAGUAcgBzAGkAbwBuADIMTABlAGcAYQBjAHkAMzBMAGEAbgBnAHUAYQBnAGUATQBvAGQAZQBsAFYAZQByAHMAaQBvAG4ASQBuAGYAbwA0MEwAbwBhAGQATABpAGIAcgBhAHIAaQBlAHMASQBuAHQAbwBQAHIAbwBqAGUAYwB0ADUaQwBvAG0AcABhAHQAaQBiAGkAbABpAHQAeQDQAAIaA9ADAS0E0AUGGgfQBwgaAUUHCQjQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtDtAPAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60BAAAA0A0BLRHQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0S0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAUAAAA0AwLrQIAAADQDQEtE9APAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAAAAAANAMC60CAAAA0A0BLRTQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0V0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtFtAPAS0X0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60EAAAA0A0BLRjQDwEtENAZGq0BRRscAdAAHBoCRR0LBAMAAAAFAAAADQAAAAAAAADQHh8tINAhIhoCRSMkAtAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAAAAANADAS0n0CgBLRHQKQEtENAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAQAAANADAS0n0CgBLRHQKQEtEJoqKwFFAAEC0AABLSzQAAEtF9AAHy0t0C4vGgPQMAutAQAAANAxC60XAAAA0DIarQDQMy8aA9AwC60CAAAA0DELrQMAAADQMhqtANA0Gq0A0DUarQA=" + + + {F66C7017-BDD8-4114-926C-81D6D687E35F} + + "{F66C7017-BDD8-4114-926C-81D6D687E35F}" + + + + + + + + + System.Boolean + System.Collections.Hashtable + System.Int32 + {54dd0eac-a6d8-46f2-8c27-2f43c7e49861} + System.String + + + + + diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/GVLs/GVL.TcGVL b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/GVLs/GVL.TcGVL new file mode 100644 index 00000000..8bd3eaf7 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/GVLs/GVL.TcGVL @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/POUs/MAIN.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/POUs/MAIN.TcPOU new file mode 100644 index 00000000..d1b104da --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/POUs/MAIN.TcPOU @@ -0,0 +1,19 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/PlcTask.TcTTO b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/PlcTask.TcTTO new file mode 100644 index 00000000..332da189 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/PlcTask.TcTTO @@ -0,0 +1,17 @@ + + + + + 10000 + 21 + + MAIN + + {f203021a-8f94-4da2-bf83-4558f82f3a1c} + {3572f010-5613-4691-bbf4-23baff30302c} + {baade827-efad-4fef-9255-c9d14a92b6a3} + {79fd84ea-4b67-4f9c-a103-f523cd06aab1} + {ea9f6a00-6a23-4383-b837-d374d34082bf} + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/TcoAteqMeasurementTests.plcproj b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/TcoAteqMeasurementTests.plcproj new file mode 100644 index 00000000..b2ae0b9c --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/TcoAteqMeasurementTests.plcproj @@ -0,0 +1,2408 @@ + + + + 1.0.0.0 + 2.0 + {fc67af5a-8749-4854-a016-aa411d28ef87} + True + true + true + false + TcoAteqMeasurementTests + 3.1.4024.12 + {9aad03c8-fdc2-403d-afaf-6c4bf57a2d42} + {4f46a5db-ea79-4803-938f-0b4a4af68812} + {dc275c06-ff6f-4833-94a8-9b3caa7662c4} + {0f73b0b4-f891-4821-bc0e-443dab5c8ad9} + {73520cae-a4e4-4e1d-819c-74e4554311f0} + {fd278834-5baa-46ed-b711-6654bc117131} + Vortex.Library + false + TcoAteqMeasurementTests + 0.6.0.913 + TcoAteqMeasurementTests + true + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + + + + + + + + TcoAteqMeasurement, 0.6.0.913 (Vortex.Library) + TcoAteqMeasurement + + + Tc2_Standard, * (Beckhoff Automation GmbH) + Tc2_Standard + + + Tc2_System, * (Beckhoff Automation GmbH) + Tc2_System + + + Tc3_Module, * (Beckhoff Automation GmbH) + Tc3_Module + + + TcoIo, 0.6.0.913 (Vortex.Library) + TcoIo + + + TcoCore, 0.6.0.913 (Vortex.Library) + TcoCore + + + + + TcoAteqMeasurement, 0.6.0.913 (Vortex.Library) + + + TcoCore, 0.6.0.913 (Vortex.Library) + + + + + Content + + + + + + + + "<ProjectRoot>" + + {192FAD59-8248-4824-A8DE-9177C94C195A} + + "{192FAD59-8248-4824-A8DE-9177C94C195A}" + + + + {246001F4-279D-43AC-B241-948EB31120E1} + + "{246001F4-279D-43AC-B241-948EB31120E1}" + + + GlobalVisuImageFilePath + %APPLICATIONPATH% + + + {29BD8D0C-3586-4548-BB48-497B9A01693F} + + "{29BD8D0C-3586-4548-BB48-497B9A01693F}" + + NamingConventions + + "NamingConventions" + + 105 + + "105" + + + stPrefix + + + + 8 + + "8" + + + stPrefix + + + + 9 + + "9" + + + stPrefix + + + + 3 + + "3" + + + stPrefix + + + + 4 + + "4" + + + stPrefix + + + + 5 + + "5" + + + stPrefix + + + + 6 + + "6" + + + stPrefix + + + + 7 + + "7" + + + stPrefix + + + + 29 + + "29" + + + stPrefix + + + + 59 + + "59" + + + stPrefix + + + + 107 + + "107" + + + stPrefix + + + + 22 + + "22" + + + stPrefix + + + + 30 + + "30" + + + stPrefix + + + + 25 + + "25" + + + stPrefix + + + + 35 + + "35" + + + stPrefix + + + + 62 + + "62" + + + stPrefix + + + + 55 + + "55" + + + stPrefix + _ + + + 65 + + "65" + + + stPrefix + + + + 108 + + "108" + + + stPrefix + I + + + 70 + + "70" + + + stPrefix + + + + 34 + + "34" + + + stPrefix + + + + 54 + + "54" + + + stPrefix + _ + + + 121 + + "121" + + + stPrefix + + + + 151 + + "151" + + + stPrefix + st + + + 10 + + "10" + + + stPrefix + + + + 102 + + "102" + + + stPrefix + prg + + + 18 + + "18" + + + stPrefix + + + + 28 + + "28" + + + stPrefix + + + + 123 + + "123" + + + stPrefix + + + + 58 + + "58" + + + stPrefix + + + + 61 + + "61" + + + stPrefix + + + + 11 + + "11" + + + stPrefix + + + + 21 + + "21" + + + stPrefix + + + + 14 + + "14" + + + stPrefix + + + + 24 + + "24" + + + stPrefix + + + + 17 + + "17" + + + stPrefix + + + + 27 + + "27" + + + stPrefix + + + + 37 + + "37" + + + stPrefix + + + + 53 + + "53" + + + stPrefix + + + + 57 + + "57" + + + stPrefix + + + + 73 + + "73" + + + stPrefix + + + + 122 + + "122" + + + stPrefix + + + + 104 + + "104" + + + stPrefix + fc + + + 153 + + "153" + + + stPrefix + union + + + 12 + + "12" + + + stPrefix + + + + 106 + + "106" + + + stPrefix + + + + 32 + + "32" + + + stPrefix + + + + 19 + + "19" + + + stPrefix + + + + 103 + + "103" + + + stPrefix + fb + + + 33 + + "33" + + + stPrefix + + + + 72 + + "72" + + + stPrefix + + + + 152 + + "152" + + + stPrefix + enum + + + 64 + + "64" + + + stPrefix + + + + 20 + + "20" + + + stPrefix + + + + 13 + + "13" + + + stPrefix + + + + 23 + + "23" + + + stPrefix + + + + 16 + + "16" + + + stPrefix + + + + 26 + + "26" + + + stPrefix + + + + 36 + + "36" + + + stPrefix + + + + 63 + + "63" + + + stPrefix + + + + 56 + + "56" + + + stPrefix + + + + 124 + + "124" + + + stPrefix + + + + 154 + + "154" + + + stPrefix + alias + + + 31 + + "31" + + + stPrefix + + + + 51 + + "51" + + + stPrefix + + + + 15 + + "15" + + + stPrefix + + + + 38 + + "38" + + + stPrefix + + + + 71 + + "71" + + + stPrefix + + + + + + + Metrics + + "Metrics" + + 9b526466-3bbe-40a9-b5a5-1cfadd791459 + + "9b526466-3bbe-40a9-b5a5-1cfadd791459" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + e58378e8-a2fb-4a33-8013-8a91270388d0 + + "e58378e8-a2fb-4a33-8013-8a91270388d0" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 2ee16325-7a34-4109-82cd-e99144bdbf43 + + "2ee16325-7a34-4109-82cd-e99144bdbf43" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + 2a5d0bd7-5767-43e1-92ab-90d924ade69e + + "2a5d0bd7-5767-43e1-92ab-90d924ade69e" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + ca51b834-cb16-4517-8b02-4807ce263107 + + "ca51b834-cb16-4517-8b02-4807ce263107" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + aebdfc4d-fc4f-4fac-bf2e-22b603bc1880 + + "aebdfc4d-fc4f-4fac-bf2e-22b603bc1880" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + bb1ff1d3-b0bc-4909-9034-11d7c6edb61f + + "bb1ff1d3-b0bc-4909-9034-11d7c6edb61f" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + 3fb5ac29-8ac7-4ca4-863e-49c3c89643b9 + + "3fb5ac29-8ac7-4ca4-863e-49c3c89643b9" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + c4137578-73e0-4a9c-ad9c-7773a1cff401 + + "c4137578-73e0-4a9c-ad9c-7773a1cff401" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + daa3e89b-a727-4bc9-bd38-29afc6024f90 + + "daa3e89b-a727-4bc9-bd38-29afc6024f90" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + b42720b9-b152-4b52-ad89-630e0f5acab1 + + "b42720b9-b152-4b52-ad89-630e0f5acab1" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 0ade9a3b-311c-4293-bc26-bcf994cdbbdc + + "0ade9a3b-311c-4293-bc26-bcf994cdbbdc" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 15c07c54-9586-460c-802f-b3b4a408e3c7 + + "15c07c54-9586-460c-802f-b3b4a408e3c7" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 19fab17a-876c-4a8d-9d74-3e5d92b63dc8 + + "19fab17a-876c-4a8d-9d74-3e5d92b63dc8" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 87b20586-90da-40d8-82ce-62a7dd0ba8af + + "87b20586-90da-40d8-82ce-62a7dd0ba8af" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + c20d083b-41ea-4867-b762-015491579932 + + "c20d083b-41ea-4867-b762-015491579932" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 827ae15d-4cb9-4177-b870-6bea1db8ee44 + + "827ae15d-4cb9-4177-b870-6bea1db8ee44" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 1a004255-b771-48b6-aa33-ea35ce4d37ea + + "1a004255-b771-48b6-aa33-ea35ce4d37ea" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + 8360c2b5-e762-4cc0-935b-fb129cda1b4a + + "8360c2b5-e762-4cc0-935b-fb129cda1b4a" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + 40f104a2-99f0-486d-9c44-47e8c759ca07 + + "40f104a2-99f0-486d-9c44-47e8c759ca07" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + 62b98ef9-b4c6-4777-bc0a-29245bb8b9f3 + + "62b98ef9-b4c6-4777-bc0a-29245bb8b9f3" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 6c74d656-f35f-41b9-b449-eae882ed12fe + + "6c74d656-f35f-41b9-b449-eae882ed12fe" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 0ba696f2-ce22-4330-931f-4ddd5c597896 + + "0ba696f2-ce22-4330-931f-4ddd5c597896" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 6549803a-9e82-4b28-aff1-2425cbec813b + + "6549803a-9e82-4b28-aff1-2425cbec813b" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 6cb1bfb1-4d4a-43ed-96f4-cd0254fc33b5 + + "6cb1bfb1-4d4a-43ed-96f4-cd0254fc33b5" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + f6dd9a78-1e71-4d9c-9e61-394eb38f3809 + + "f6dd9a78-1e71-4d9c-9e61-394eb38f3809" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 571980c1-792d-4355-a9cb-4c3a8f254ab0 + + "571980c1-792d-4355-a9cb-4c3a8f254ab0" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + eb349b41-54d8-47ed-ab7d-b5dbbc17709f + + "eb349b41-54d8-47ed-ab7d-b5dbbc17709f" + + + stUpperLimit + "" + bActive + true + stLowerLimit + "" + + + 209f2982-bd60-4988-9cf9-9ff21cbf643f + + "209f2982-bd60-4988-9cf9-9ff21cbf643f" + + + stUpperLimit + "" + bActive + false + stLowerLimit + "" + + + + + + NamingConventionsSettings + + "NamingConventionsSettings" + + + FirstCharUpperCase + False + CombineScopeWithDatatypePrefix + True + CombinedDataTypesRecursive + True + + + Rules + + "Rules" + + 35 + + "35" + + + bWarning + False + bActive + True + + + 105 + + "105" + + + bWarning + False + bActive + False + + + 63 + + "63" + + + bWarning + False + bActive + True + + + 8 + + "8" + + + bWarning + False + bActive + True + + + 9 + + "9" + + + bWarning + False + bActive + True + + + 47 + + "47" + + + bWarning + False + bActive + True + + + 1 + + "1" + + + bWarning + False + bActive + True + + + 2 + + "2" + + + bWarning + True + bActive + True + + + 3 + + "3" + + + bWarning + False + bActive + True + + + 4 + + "4" + + + bWarning + False + bActive + False + + + 5 + + "5" + + + bWarning + False + bActive + True + + + 6 + + "6" + + + bWarning + False + bActive + False + + + 7 + + "7" + + + bWarning + False + bActive + True + + + 29 + + "29" + + + bWarning + False + bActive + True + + + 133 + + "133" + + + bWarning + False + bActive + False + + + 163 + + "163" + + + bWarning + False + bActive + False + + + 118 + + "118" + + + bWarning + False + bActive + False + + + 22 + + "22" + + + bWarning + False + bActive + True + + + 148 + + "148" + + + bWarning + False + bActive + False + + + 42 + + "42" + + + bWarning + False + bActive + True + + + 167 + + "167" + + + bWarning + False + bActive + False + + + 62 + + "62" + + + bWarning + False + bActive + True + + + 55 + + "55" + + + bWarning + False + bActive + True + + + 65 + + "65" + + + bWarning + False + bActive + True + + + 75 + + "75" + + + bWarning + False + bActive + True + + + 140 + + "140" + + + bWarning + False + bActive + True + + + 150 + + "150" + + + bWarning + False + bActive + False + + + 114 + + "114" + + + bWarning + False + bActive + False + + + 34 + + "34" + + + bWarning + False + bActive + True + + + 162 + + "162" + + + bWarning + False + bActive + False + + + 13 + + "13" + + + bWarning + False + bActive + True + + + 54 + + "54" + + + bWarning + False + bActive + True + + + 121 + + "121" + + + bWarning + False + bActive + False + + + 23 + + "23" + + + bWarning + False + bActive + True + + + 41 + + "41" + + + bWarning + False + bActive + True + + + 125 + + "125" + + + bWarning + False + bActive + False + + + 60 + + "60" + + + bWarning + False + bActive + True + + + 72 + + "72" + + + bWarning + False + bActive + True + + + 103 + + "103" + + + bWarning + False + bActive + True + + + 112 + + "112" + + + bWarning + False + bActive + False + + + 81 + + "81" + + + bWarning + False + bActive + True + + + 102 + + "102" + + + bWarning + False + bActive + True + + + 18 + + "18" + + + bWarning + False + bActive + True + + + 132 + + "132" + + + bWarning + False + bActive + True + + + 123 + + "123" + + + bWarning + False + bActive + False + + + 28 + + "28" + + + bWarning + False + bActive + False + + + 58 + + "58" + + + bWarning + False + bActive + True + + + 61 + + "61" + + + bWarning + False + bActive + True + + + 78 + + "78" + + + bWarning + False + bActive + True + + + 21 + + "21" + + + bWarning + False + bActive + True + + + 14 + + "14" + + + bWarning + False + bActive + True + + + 24 + + "24" + + + bWarning + False + bActive + False + + + 25 + + "25" + + + bWarning + False + bActive + True + + + 48 + + "48" + + + bWarning + False + bActive + True + + + 37 + + "37" + + + bWarning + False + bActive + True + + + 64 + + "64" + + + bWarning + False + bActive + True + + + 57 + + "57" + + + bWarning + False + bActive + True + + + 17 + + "17" + + + bWarning + False + bActive + True + + + 77 + + "77" + + + bWarning + False + bActive + True + + + 100 + + "100" + + + bWarning + false + nUpperLimit + 1024 + bActive + true + + + 130 + + "130" + + + bWarning + False + bActive + True + + + 160 + + "160" + + + bWarning + False + bActive + True + + + 27 + + "27" + + + bWarning + False + bActive + False + + + 164 + + "164" + + + bWarning + False + bActive + False + + + 119 + + "119" + + + bWarning + False + bActive + False + + + 20 + + "20" + + + bWarning + False + bActive + True + + + 111 + + "111" + + + bWarning + False + bActive + False + + + 12 + + "12" + + + bWarning + False + bActive + True + + + 115 + + "115" + + + bWarning + False + bActive + False + + + 106 + + "106" + + + bWarning + False + bActive + False + + + 145 + + "145" + + + bWarning + False + bActive + False + + + 19 + + "19" + + + bWarning + False + bActive + True + + + 166 + + "166" + + + MaxInOuts + 10 + bActive + false + bWarning + false + MaxOutputs + 10 + MaxInputs + 10 + + + 56 + + "56" + + + bWarning + False + bActive + True + + + 52 + + "52" + + + bWarning + False + bActive + True + + + 16 + + "16" + + + bWarning + False + bActive + False + + + 39 + + "39" + + + bWarning + False + bActive + True + + + 134 + + "134" + + + bWarning + False + bActive + False + + + 80 + + "80" + + + bWarning + False + bActive + True + + + 44 + + "44" + + + bWarning + False + bActive + True + + + 122 + + "122" + + + bWarning + False + bActive + False + + + 113 + + "113" + + + bWarning + False + bActive + False + + + 59 + + "59" + + + bWarning + False + bActive + True + + + 10 + + "10" + + + bWarning + False + bActive + True + + + 95 + + "95" + + + bWarning + False + bActive + True + + + 117 + + "117" + + + bWarning + False + bActive + False + + + 40 + + "40" + + + bWarning + False + bActive + True + + + 33 + + "33" + + + bWarning + False + bActive + False + + + 26 + + "26" + + + bWarning + False + bActive + True + + + 36 + + "36" + + + bWarning + False + bActive + True + + + 46 + + "46" + + + bWarning + False + bActive + True + + + 73 + + "73" + + + bWarning + False + bActive + False + + + 66 + + "66" + + + bWarning + False + bActive + True + + + 76 + + "76" + + + bWarning + False + bActive + True + + + 53 + + "53" + + + bWarning + False + bActive + True + + + 107 + + "107" + + + bWarning + False + bActive + False + + + 32 + + "32" + + + bWarning + False + bActive + True + + + 120 + + "120" + + + bWarning + False + bActive + False + + + 11 + + "11" + + + bWarning + True + bActive + True + + + 124 + + "124" + + + bWarning + False + bActive + False + + + 147 + + "147" + + + bWarning + False + bActive + False + + + 31 + + "31" + + + bWarning + False + bActive + True + + + 90 + + "90" + + + bWarning + False + bActive + True + + + 51 + + "51" + + + bWarning + False + bActive + True + + + 15 + + "15" + + + bWarning + False + bActive + True + + + 38 + + "38" + + + bWarning + False + bActive + True + + + 101 + + "101" + + + MinChars + 5 + bActive + false + MaxChars + 30 + Exceptions + "" + bWarning + false + + + 43 + + "43" + + + bWarning + False + bActive + True + + + 131 + + "131" + + + bWarning + False + bActive + True + + + 161 + + "161" + + + bWarning + False + bActive + True + + + + + + + + SuppressedKeywords + "" + PerformStaticAnalyse + false + + + {40450F57-0AA3-4216-96F3-5444ECB29763} + + "{40450F57-0AA3-4216-96F3-5444ECB29763}" + + + ActiveVisuExtensionsLength + 0 + ActiveVisuProfile + "IR0whWr8bwfwBwAAiD2qpQAAAABVAgAA37x72QAAAAABAAAAAAAAAAEaUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwACTHsAZgA5ADUAYgBiADQAMgA2AC0ANQA1ADIANAAtADQAYgA0ADUALQA5ADQAMAAwAC0AZgBiADAAZgAyAGUANwA3AGUANQAxAGIAfQADCE4AYQBtAGUABDBUAHcAaQBuAEMAQQBUACAAMwAuADEAIABCAHUAaQBsAGQAIAA0ADAAMgA0AC4ANwAFFlAAcgBvAGYAaQBsAGUARABhAHQAYQAGTHsAMQA2AGUANQA1AGIANgAwAC0ANwAwADQAMwAtADQAYQA2ADMALQBiADYANQBiAC0ANgAxADQANwAxADMAOAA3ADgAZAA0ADIAfQAHEkwAaQBiAHIAYQByAGkAZQBzAAhMewAzAGIAZgBkADUANAA1ADkALQBiADAANwBmAC0ANABkADYAZQAtAGEAZQAxAGEALQBhADgAMwAzADUANgBhADUANQAxADQAMgB9AAlMewA5AGMAOQA1ADgAOQA2ADgALQAyAGMAOAA1AC0ANAAxAGIAYgAtADgAOAA3ADEALQA4ADkANQBmAGYAMQBmAGUAZABlADEAYQB9AAoOVgBlAHIAcwBpAG8AbgALBmkAbgB0AAwKVQBzAGEAZwBlAA0KVABpAHQAbABlAA4aVgBpAHMAdQBFAGwAZQBtAE0AZQB0AGUAcgAPDkMAbwBtAHAAYQBuAHkAEAxTAHkAcwB0AGUAbQARElYAaQBzAHUARQBsAGUAbQBzABIwVgBpAHMAdQBFAGwAZQBtAHMAUwBwAGUAYwBpAGEAbABDAG8AbgB0AHIAbwBsAHMAEyhWAGkAcwB1AEUAbABlAG0AcwBXAGkAbgBDAG8AbgB0AHIAbwBsAHMAFCRWAGkAcwB1AEUAbABlAG0AVABlAHgAdABFAGQAaQB0AG8AcgAVIlYAaQBzAHUATgBhAHQAaQB2AGUAQwBvAG4AdAByAG8AbAAWFHYAaQBzAHUAaQBuAHAAdQB0AHMAFwxzAHkAcwB0AGUAbQAYGFYAaQBzAHUARQBsAGUAbQBCAGEAcwBlABkmRABlAHYAUABsAGEAYwBlAGgAbwBsAGQAZQByAHMAVQBzAGUAZAAaCGIAbwBvAGwAGyJQAGwAdQBnAGkAbgBDAG8AbgBzAHQAcgBhAGkAbgB0AHMAHEx7ADQAMwBkADUAMgBiAGMAZQAtADkANAAyAGMALQA0ADQAZAA3AC0AOQBlADkANAAtADEAYgBmAGQAZgAzADEAMABlADYAMwBjAH0AHRxBAHQATABlAGEAcwB0AFYAZQByAHMAaQBvAG4AHhRQAGwAdQBnAGkAbgBHAHUAaQBkAB8WUwB5AHMAdABlAG0ALgBHAHUAaQBkACBIYQBmAGMAZAA1ADQANAA2AC0ANAA5ADEANAAtADQAZgBlADcALQBiAGIANwA4AC0AOQBiAGYAZgBlAGIANwAwAGYAZAAxADcAIRRVAHAAZABhAHQAZQBJAG4AZgBvACJMewBiADAAMwAzADYANgBhADgALQBiADUAYwAwAC0ANABiADkAYQAtAGEAMAAwAGUALQBlAGIAOAA2ADAAMQAxADEAMAA0AGMAMwB9ACMOVQBwAGQAYQB0AGUAcwAkTHsAMQA4ADYAOABmAGYAYwA5AC0AZQA0AGYAYwAtADQANQAzADIALQBhAGMAMAA2AC0AMQBlADMAOQBiAGIANQA1ADcAYgA2ADkAfQAlTHsAYQA1AGIAZAA0ADgAYwAzAC0AMABkADEANwAtADQAMQBiADUALQBiADEANgA0AC0ANQBmAGMANgBhAGQAMgBiADkANgBiADcAfQAmFk8AYgBqAGUAYwB0AHMAVAB5AHAAZQAnVFUAcABkAGEAdABlAEwAYQBuAGcAdQBhAGcAZQBNAG8AZABlAGwARgBvAHIAQwBvAG4AdgBlAHIAdABpAGIAbABlAEwAaQBiAHIAYQByAGkAZQBzACgQTABpAGIAVABpAHQAbABlACkUTABpAGIAQwBvAG0AcABhAG4AeQAqHlUAcABkAGEAdABlAFAAcgBvAHYAaQBkAGUAcgBzACs4UwB5AHMAdABlAG0ALgBDAG8AbABsAGUAYwB0AGkAbwBuAHMALgBIAGEAcwBoAHQAYQBiAGwAZQAsEnYAaQBzAHUAZQBsAGUAbQBzAC1INgBjAGIAMQBjAGQAZQAxAC0AZAA1AGQAYwAtADQAYQAzAGIALQA5ADAANQA0AC0AMgAxAGYAYQA3ADUANgBhADMAZgBhADQALihJAG4AdABlAHIAZgBhAGMAZQBWAGUAcgBzAGkAbwBuAEkAbgBmAG8AL0x7AGMANgAxADEAZQA0ADAAMAAtADcAZgBiADkALQA0AGMAMwA1AC0AYgA5AGEAYwAtADQAZQAzADEANABiADUAOQA5ADYANAAzAH0AMBhNAGEAagBvAHIAVgBlAHIAcwBpAG8AbgAxGE0AaQBuAG8AcgBWAGUAcgBzAGkAbwBuADIMTABlAGcAYQBjAHkAMzBMAGEAbgBnAHUAYQBnAGUATQBvAGQAZQBsAFYAZQByAHMAaQBvAG4ASQBuAGYAbwA0MEwAbwBhAGQATABpAGIAcgBhAHIAaQBlAHMASQBuAHQAbwBQAHIAbwBqAGUAYwB0ADUaQwBvAG0AcABhAHQAaQBiAGkAbABpAHQAeQDQAAIaA9ADAS0E0AUGGgfQBwgaAUUHCQjQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtDtAPAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60BAAAA0A0BLRHQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0S0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAUAAAA0AwLrQIAAADQDQEtE9APAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAAAAAANAMC60CAAAA0A0BLRTQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0V0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtFtAPAS0X0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60EAAAA0A0BLRjQDwEtENAZGq0BRRscAdAAHBoCRR0LBAMAAAAFAAAADQAAAAAAAADQHh8tINAhIhoCRSMkAtAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAAAAANADAS0n0CgBLRHQKQEtENAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAQAAANADAS0n0CgBLRHQKQEtEJoqKwFFAAEC0AABLSzQAAEtF9AAHy0t0C4vGgPQMAutAQAAANAxC60XAAAA0DIarQDQMy8aA9AwC60CAAAA0DELrQMAAADQMhqtANA0Gq0A0DUarQA=" + + + {F66C7017-BDD8-4114-926C-81D6D687E35F} + + "{F66C7017-BDD8-4114-926C-81D6D687E35F}" + + + + + + + + + System.Boolean + System.Collections.Hashtable + System.Int32 + {54dd0eac-a6d8-46f2-8c27-2f43c7e49861} + System.String + + + + + diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoAteqG6/TcoAteqG6Simulator.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoAteqG6/TcoAteqG6Simulator.TcPOU new file mode 100644 index 00000000..1796b75d --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoAteqG6/TcoAteqG6Simulator.TcPOU @@ -0,0 +1,216 @@ + + + + + + Simulated ATEQ G6 instrument (port of the AX FakeG6 harness). Each Step() plays one PLC cycle of the instrument + against the output image: a rising command edge is echoed with error word FFFFh, the command completes after + CommandCycles cycles (error word 0, or the command's own bit when it is in FailMask), the echo drops once the + PLC drops the command bit. A started (special) cycle clears CycleEnd for CycleCycles cycles. Results are written + into the input image exactly where the real instrument puts them. + + +~*) +FUNCTION_BLOCK TcoAteqG6Simulator +VAR + // behaviour knobs + CommandCycles : INT := 2; + CycleCycles : INT := 3; + FailMask : WORD; // commands completing with an error + SilentMask : WORD; // commands never acknowledged + StuckEchoMask : WORD; // echo never released + IgnoreProgramSelection : BOOL; + NoCycle : BOOL; // start accepted, cycle end never drops + EndlessCycle : BOOL; // cycle end never comes back + ResultProgramOffset : INT; // <> 0 -> stale last result + ResultRelay : WORD := 16#0001; + ResultAlarm : INT; + // instrument state + BusProgram : INT; // 0-based, as on the bus + CycleEnd : BOOL := TRUE; + Echo : WORD; + Error : WORD; + // observations + RisingEdges : INT; + RaisedUnion : WORD; + LastRaised : WORD; + LastSpecialId : BYTE; +END_VAR +VAR + _prev : WORD; + _active : WORD; + _busy : INT; + _cycle : INT; +END_VAR]]> + + + + + + + + + + + + + 0 THEN + RisingEdges := RisingEdges + 1; + RaisedUnion := RaisedUnion OR rising; + LastRaised := rising; + IF (rising AND SilentMask) = 0 THEN + _active := rising; + Echo := Echo OR rising; + Error := 16#FFFF; + _busy := CommandCycles; + IF (rising AND 16#0004) <> 0 THEN + LastSpecialId := inoOut[16#08]; + END_IF + END_IF +END_IF +IF _busy > 0 THEN + _busy := _busy - 1; + IF _busy = 0 THEN + Complete(inoOut := inoOut, inoIn := inoIn); + END_IF +END_IF +Echo := Echo AND NOT (dropped AND NOT StuckEchoMask); +IF _cycle > 0 AND NOT EndlessCycle THEN + _cycle := _cycle - 1; + IF _cycle = 0 THEN + CycleEnd := TRUE; + WriteLastResult(inoIn := inoIn); + END_IF +END_IF +_prev := cmd; +WriteState(inoIn := inoIn);]]> + + + + + + 0 THEN + Error := _active; + RETURN; +END_IF +Error := 0; +IF _active = 16#0001 THEN + CycleEnd := TRUE; + _cycle := 0; +ELSIF _active = 16#0008 THEN + IF NOT IgnoreProgramSelection THEN + BusProgram := TcoAteqMeasurement.TcoAteqG6_GetInt_v_3_5_x(inOffset := 16#06, inoImage := inoOut); + END_IF +ELSIF _active = 16#0002 OR _active = 16#0006 THEN + IF NOT NoCycle THEN + CycleEnd := FALSE; + _cycle := CycleCycles; + END_IF +ELSIF _active = 16#8000 THEN + WriteLastResult(inoIn := inoIn); +ELSIF _active = 16#0020 THEN + WriteParameters(inoOut := inoOut, inoIn := inoIn); +END_IF]]> + + + + + + + + + + + + + + + + + + Response value of every requested parameter = its identifier x 1000. The request (count + identifiers) is read from output 20h. + + +~*) +METHOD PRIVATE WriteParameters +VAR_IN_OUT + inoOut : ARRAY[0..255] OF BYTE; + inoIn : ARRAY[0..255] OF BYTE; +END_VAR +VAR + i : INT; + count : INT; + id : WORD; +END_VAR]]> + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoAteqG6/TcoAteqG6TestContext.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoAteqG6/TcoAteqG6TestContext.TcPOU new file mode 100644 index 00000000..b2c77359 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoAteqG6/TcoAteqG6TestContext.TcPOU @@ -0,0 +1,122 @@ + + + + + + Test context of TcoAteqG6Pn_v_3_5_x. _inImage is the input image of the instrument: written by the simulator + when _simulate = TRUE, otherwise directly by the test. _outImage is what the component put on the wire. + + +~*) +FUNCTION_BLOCK TcoAteqG6TestContext EXTENDS TcoCore._internals_TcoContext +VAR + _sut : TcoAteqMeasurement.TcoAteqG6Pn_v_3_5_x(THIS^); + _io : TcoAteqMeasurement.TcoAteqG6Pn_IO_v_3_5_x; + _sim : TcoAteqG6Simulator; + _simulate : BOOL; + _inImage : ARRAY[0..255] OF BYTE; + _outImage : ARRAY[0..255] OF BYTE; + _program : INT; + _specialCycle : TcoAteqMeasurement.eTcoAteqG6_SpecialCycle_v_3_5_x; + _instruction : BYTE; + _parameter : TcoAteqMeasurement.eTcoAteqG6_ParameterId_v_3_5_x; + _request : TcoAteqMeasurement.TcoAteqG6_ParameterRequest_v_3_5_x; + _taskDone : BOOL; + _taskError : BOOL; + _startCycleBusy : BOOL; + _selectProgramBusy : BOOL; + _resetBusy : BOOL; +END_VAR +VAR + {attribute 'hide'} + _i : INT; +END_VAR]]> + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoAteqG6/eTcoAteqG6Tests.TcDUT b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoAteqG6/eTcoAteqG6Tests.TcDUT new file mode 100644 index 00000000..ff62e5fc --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoAteqG6/eTcoAteqG6Tests.TcDUT @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoContext/WpfContext.TcPOU b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoContext/WpfContext.TcPOU new file mode 100644 index 00000000..0fbc4cdf --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/TcoAteqMeasurementTests/Tests/TcoContext/WpfContext.TcPOU @@ -0,0 +1,23 @@ + + + + "} + _ateq1 : TcoAteqMeasurement.TcoAteqG6Pn_v_3_5_x(THIS^); +END_VAR]]> + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/XaeTcoAteqMeasurement.tsproj b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/XaeTcoAteqMeasurement.tsproj new file mode 100644 index 00000000..4211e526 --- /dev/null +++ b/src/TcoAteqMeasurement/src/XaeTcoAteqMeasurement/XaeTcoAteqMeasurement.tsproj @@ -0,0 +1,60 @@ + + + + + + + + + + PlcTask + + + PlcTask1 + + + + + + + TcoAteqMeasurement Instance + {08500001-0000-0000-F000-000000000064} + + + 0 + PlcTask + + #x02010030 + + 20 + 10000000 + + + + + + + + + + TcoAteqMeasurementTests Instance + {08500001-0000-0000-F000-000000000064} + + + 0 + PlcTask + + #x02010040 + + 21 + 10000000 + + + + + + + + + + diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/App.xaml b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/App.xaml new file mode 100644 index 00000000..aa3a614f --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/App.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/App.xaml.cs b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/App.xaml.cs new file mode 100644 index 00000000..a840045a --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/App.xaml.cs @@ -0,0 +1,38 @@ +using System; + +using System.Windows; + + + +using System.IO; +using System.Reflection; +using TcOpen.Inxton.TcoCore.Wpf; + +namespace TcoAteqMeasurement.Wpf.Sandbox +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + public App() : base() + { + TcOpen.Inxton.TcoAppDomain.Current.Builder + .SetPlcDialogs(DialogProxyServiceWpf.Create(new[] { TcoAteqMeasurementTests.Entry.TcoAteqMeasurementTestsPlc.MAIN._wpfContext })) + .SetUpLogger(new TcOpen.Inxton.Logging.SerilogAdapter()) + .SetDispatcher(TcoCore.Wpf.Threading.Dispatcher.Get); + + + + + + TcoAteqMeasurementTests.Entry.TcoAteqMeasurementTestsPlc.Connector.BuildAndStart(); + TcoAteqMeasurementTests.Entry.TcoAteqMeasurementTestsPlc.MAIN._wpfContextCall.Synchron = true; + TcoAteqMeasurementTests.Entry.TcoAteqMeasurementTestsPlc.MAIN._wpfContext._serviceModeActive.Synchron = true; + this.ShutdownMode = ShutdownMode.OnLastWindowClose; + } + + + + } +} diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/AssemblyInfo.cs b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/AssemblyInfo.cs new file mode 100644 index 00000000..d6589f5f --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/AssemblyInfo.cs @@ -0,0 +1,16 @@ +using System.Windows; +using System.Reflection; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + +[assembly: AssemblyVersion("0.6.0.0")] +[assembly: AssemblyFileVersion("0.6.0.0")] +[assembly: AssemblyInformationalVersion("0.6.0-386-Create-application-template.913+Branch.386-Create-application-template.Sha.4c84548ce65902faf186e6b2f45c239f599f2d02")] + diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/MainWindow.xaml b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/MainWindow.xaml new file mode 100644 index 00000000..99738b55 --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/MainWindow.xaml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/MainWindow.xaml.cs b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/MainWindow.xaml.cs new file mode 100644 index 00000000..23069d7c --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/MainWindow.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace TcoAteqMeasurement.Wpf.Sandbox +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/TcoAteqMeasurement.Wpf.Sandbox.csproj b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/TcoAteqMeasurement.Wpf.Sandbox.csproj new file mode 100644 index 00000000..f536571b --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurement.Wpf.Sandbox/TcoAteqMeasurement.Wpf.Sandbox.csproj @@ -0,0 +1,28 @@ + + + + WinExe + net48;net5.0-windows + true + false + false + + + + full + true + AnyCPU + + + + + + + + + + + + + + diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Entry.cs b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Entry.cs new file mode 100644 index 00000000..56ca5454 --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Entry.cs @@ -0,0 +1,21 @@ +using System; + +namespace TcoAteqMeasurementTests +{ + public static class Entry + { + +#if SET_ENV_VAR + static Entry() + { + Environment.SetEnvironmentVariable("Tc3Target", YOUR_TARGER_SYSTEM AMS_ID); + } +#endif + + static string TargetAmsId = Environment.GetEnvironmentVariable("Tc3Target"); + static int TargetAmsPort = 852; + + public static TcoAteqMeasurementTestsTwinController TcoAteqMeasurementTestsPlc { get; } + = new TcoAteqMeasurementTestsTwinController(Vortex.Adapters.Connector.Tc3.Adapter.Tc3ConnectorAdapter.Create( TargetAmsId,TargetAmsPort, true)); + } +} diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.Designer.cs b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.Designer.cs new file mode 100644 index 00000000..943e132b --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.Designer.cs @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +// +// 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 TcoAteqMeasurementTestsConnector.Properties { + 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", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Localizations { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Localizations() { + } + + /// + /// 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("TcoAteqMeasurementTestsConnector.Properties.Localizations", typeof(Localizations).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; + } + } + + } +} diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.cs-CZ.resx b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.cs-CZ.resx new file mode 100644 index 00000000..823400fc --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.cs-CZ.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + ATEQ G6 PN + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.de-DE.resx b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.de-DE.resx new file mode 100644 index 00000000..823400fc --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.de-DE.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + ATEQ G6 PN + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.es-ES.resx b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.es-ES.resx new file mode 100644 index 00000000..823400fc --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.es-ES.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + ATEQ G6 PN + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.resx b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.resx new file mode 100644 index 00000000..0c90e2d4 --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + ATEQ G6 PN + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.sk-SK.resx b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.sk-SK.resx new file mode 100644 index 00000000..823400fc --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/Properties/Localizations.sk-SK.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + ATEQ G6 PN + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/TcoAteqMeasurementTestsConnector.csproj b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/TcoAteqMeasurementTestsConnector.csproj new file mode 100644 index 00000000..fc4635ba --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementTestsConnector/TcoAteqMeasurementTestsConnector.csproj @@ -0,0 +1,24 @@ + + + + Library + net48;net5.0 + false + + + + + + + True + True + Localizations.resx + + + + + PublicResXFileCodeGenerator + Localizations.Designer.cs + + + \ No newline at end of file diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/ConnectorFixture.cs b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/ConnectorFixture.cs new file mode 100644 index 00000000..aa95c658 --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/ConnectorFixture.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TcoAteqMeasurementUnitTests +{ + public class ConnectorFixture + { + public ConnectorFixture() + { + StartConnector(); + } + + private static TcoAteqMeasurementTests.TcoAteqMeasurementTestsTwinController _connector; + public static TcoAteqMeasurementTests.TcoAteqMeasurementTestsTwinController Connector + { + get + { + if (_connector == null) + { + StartConnector(); + } + return _connector; + } + + } + + public static void StartConnector() + { + var adapter = Vortex.Adapters.Connector.Tc3.Adapter.Tc3ConnectorAdapter.Create(TestSetupFixture.TargetAmsId, TestSetupFixture.TargetAmsPort, true); + _connector = new TcoAteqMeasurementTests.TcoAteqMeasurementTestsTwinController(adapter); + _connector.Connector.ReadWriteCycleDelay = 100; + _connector.Connector.BuildAndStart(); + } + } +} diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/MockRootObject.cs b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/MockRootObject.cs new file mode 100644 index 00000000..9c46f41c --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/MockRootObject.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Vortex.Connector; + +namespace TcoAteqMeasurementUnitTests +{ + public class MockRootObject : IVortexObject, ITwinObject, IVortexElement + { + public MockRootObject() + { + _adapter = new ConnectorAdapter(typeof(DummyConnectorFactory)); + _connector = _adapter.GetConnector(null); + _connector.GetConnector().SuspendWriteProtection("Hoj morho vetvo mojho rodu, kto kramou rukou siahne na tvoju slobodu a co i dusu das v tom boji divokom vol nebyt ako byt otrokom!"); + } + + public string Symbol => string.Empty; + + public string AttributeName => string.Empty; + + public string HumanReadable => string.Empty; + + public IList _children = new List(); + + public void AddChild(IVortexObject vortexObject) + { + _children.Add(vortexObject); + } + + public IList _kids = new List(); + + public void AddKid(IVortexElement kid) + { + _kids.Add(kid); + } + + public IList _valueTags = new List(); + + public void AddValueTag(IValueTag valueTag) + { + _valueTags.Add(valueTag); + } + + public IEnumerable GetChildren() + { + return _children; + } + + private ConnectorAdapter _adapter; + private IConnector _connector; + public IConnector GetConnector() + { + return _connector; + } + + public IEnumerable GetKids() + { + return _kids; + } + + public IVortexObject GetParent() + { + return GetConnector(); + } + + public string GetSymbolTail() + { + return string.Empty; + } + + public IEnumerable GetValueTags() + { + return _valueTags; + } + } +} \ No newline at end of file diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/PlcExectutedTests/TcoAteqG6Tests.cs b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/PlcExectutedTests/TcoAteqG6Tests.cs new file mode 100644 index 00000000..7edfa61e --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/PlcExectutedTests/TcoAteqG6Tests.cs @@ -0,0 +1,560 @@ +using System; +using NUnit.Framework; +using TcoAteqMeasurement; +using TcoAteqMeasurementTests; + +namespace TcoAteqMeasurementUnitTests.PlcExecutedTests +{ + /// + /// PLC executed tests of TcoAteqG6Pn_v_3_5_x (ports of the AX AxoG6 codec, task and coordination tests). + /// Requires the TcoAteqMeasurementTests PLC running on the target set in the 'Tc3Target' environment variable. + /// + public class TcoAteqG6Tests + { + TcoAteqG6TestContext sut = ConnectorFixture.Connector.MAIN._g6TestContext; + + [SetUp] + public void TestSetup() + { + sut._simulate.Synchron = false; + sut.ExecuteProbeRun((int)eTcoAteqG6Tests.Restore); + sut._sut._config.CommandTimeout.Synchron = TimeSpan.FromMilliseconds(500); + sut._sut._config.CycleTimeout.Synchron = TimeSpan.FromMilliseconds(1000); + sut._sut._config.ErrorTime.Synchron = TimeSpan.Zero; + sut._sut._control.ProgramNumber.Synchron = 0; + sut._sut._control.SpecialCycle.Synchron = (short)eTcoAteqG6_SpecialCycle_v_3_5_x.None; + sut._sut._control.QueryParameter.Synchron = (ushort)eTcoAteqG6_ParameterId_v_3_5_x.None; + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + } + + private void HealthyInstrument() + { + sut._simulate.Synchron = true; + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + } + + private void In(int offset, params byte[] bytes) + { + for (int i = 0; i < bytes.Length; i++) + sut._inImage[offset + i].Synchron = bytes[i]; + } + + private void InDint(int offset, int value) => In(offset, BitConverter.GetBytes(value)); + + private byte Out(int offset) => sut._outImage[offset].Synchron; + + private ushort Command => sut._sut._control.Command.Synchron; + + private void Run(eTcoAteqG6Tests test) => sut.ExecuteProbeRun((ulong)test); + + private void AssertDone() + { + Assert.IsTrue(sut._taskDone.Synchron, "task not done"); + Assert.IsFalse(sut._taskError.Synchron, "task in error"); + } + + private void AssertError() + { + Assert.IsTrue(sut._taskError.Synchron, "task not in error"); + Assert.IsFalse(sut._taskDone.Synchron, "task done"); + } + + // ------------------------------------------------------------ codec / mapping + + [Test, Timeout(10000)] + public void InputImageIsDecodedIntoState() + { + In(0x00, 0x08, 0x80); // echo: program selection + read last result + In(0x02, 0xFF, 0xFF); // error word FFFFh = command running + In(0x06, 0x04, 0x00); // program 4 on the bus = 5 + In(0x08, 0x07, 0x00); // results in FIFO + In(0x0C, 0x21, 0x82); // pass, cycle end, ATR error (bit 9), key presence (bit 15) + In(0x0E, 0x03, 0x00); // step 3 = stabilization + InDint(0x10, 207000); // pressure 207 + InDint(0x14, 14000); // mbar + InDint(0x18, -108); // flow -0.108 + InDint(0x1C, 84000); // SCCM + + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + + var s = sut._sut._status.State; + Assert.AreEqual(0x8008, s.Echo.Raw.Synchron); + Assert.IsTrue(s.Echo.ProgramSelection.Synchron); + Assert.IsTrue(s.Echo.ReadLastResult.Synchron); + Assert.IsFalse(s.Echo.Reset.Synchron); + Assert.IsTrue(s.CommandRunning.Synchron); + Assert.AreEqual(5, s.CurrentProgram.Synchron); + Assert.AreEqual(7, s.ResultsInFifo.Synchron); + Assert.IsTrue(s.StatusBits.Pass.Synchron); + Assert.IsTrue(s.StatusBits.CycleEnd.Synchron); + Assert.IsTrue(s.StatusBits.AtrError.Synchron); + Assert.IsTrue(s.StatusBits.KeyPresence.Synchron); + Assert.IsFalse(s.StatusBits.Alarm.Synchron); + Assert.AreEqual((short)eTcoAteqG6_Step_v_3_5_x.Stabilization, s.Step.Synchron); + Assert.AreEqual(207.0f, s.RealTime.Pressure.Synchron, 0.0001f); + Assert.AreEqual((short)eTcoAteqG6_Unit_v_3_5_x.mbar, s.RealTime.PressureUnit.Synchron); + Assert.AreEqual(-0.108f, s.RealTime.Flow.Synchron, 0.0001f); + Assert.AreEqual((short)eTcoAteqG6_Unit_v_3_5_x.SCCM, s.RealTime.FlowUnit.Synchron); + Assert.IsFalse(sut._sut._status.Ready.Synchron, "command running -> not ready"); + } + + [Test, Timeout(10000)] + public void UnknownCodesDecodeToUnknown() + { + In(0x0E, 0x07, 0x00); // step 7 + InDint(0x14, 1500); // not a multiple of 1000 + InDint(0x1C, 99000); // not in the unit table + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + + var s = sut._sut._status.State; + Assert.AreEqual((short)eTcoAteqG6_Step_v_3_5_x.Unknown, s.Step.Synchron); + Assert.AreEqual((short)eTcoAteqG6_Unit_v_3_5_x.Unknown, s.RealTime.PressureUnit.Synchron); + Assert.AreEqual((short)eTcoAteqG6_Unit_v_3_5_x.Unknown, s.RealTime.FlowUnit.Synchron); + + In(0x0E, 0xFF, 0xFF); // FFFFh = no cycle + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + Assert.AreEqual((short)eTcoAteqG6_Step_v_3_5_x.None, s.Step.Synchron); + } + + [Test, Timeout(10000)] + public void ReadyFollowsCycleEndAndCommandRunning() + { + In(0x0C, 0x20, 0x00); + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + Assert.IsTrue(sut._sut._status.Ready.Synchron); + } + + [Test, Timeout(10000)] + public void ControlIsEncodedIntoOutputImage() + { + var c = sut._sut._control; + c.ProgramNumber.Synchron = 3; + c.SpecialCycle.Synchron = (short)eTcoAteqG6_SpecialCycle_v_3_5_x.PiezoAutoZero; + c.SpecialCycleInstruction.Synchron = 5; + c.ParameterRequest.Count.Synchron = 3; + c.ParameterRequest.Ids[0].Synchron = 1; + c.ParameterRequest.Ids[1].Synchron = 3; + c.ParameterRequest.Ids[2].Synchron = 60; + + sut.ExecuteProbeRun(3, (int)eTcoAteqG6Tests.Run); + + Assert.AreEqual(0x02, Out(0x06), "program 3 is 2 on the bus"); + Assert.AreEqual(0x00, Out(0x07)); + Assert.AreEqual(9, Out(0x08), "special cycle id"); + Assert.AreEqual(5, Out(0x09), "special cycle instruction"); + Assert.AreEqual(3, Out(0x20), "parameter count"); + Assert.AreEqual(1, Out(0x22)); + Assert.AreEqual(3, Out(0x24)); + Assert.AreEqual(60, Out(0x26)); + Assert.AreEqual(0, Out(0x28)); + } + + [Test, Timeout(10000)] + public void CommandWordIsLittleEndian() + { + sut._sut._control.Command.Synchron = 0x8006; + sut.ExecuteProbeRun(3, (int)eTcoAteqG6Tests.Run); + Assert.AreEqual(0x06, Out(0x00)); + Assert.AreEqual(0x80, Out(0x01)); + Assert.IsTrue(sut._sut._control.CommandBits.Start.Synchron); + Assert.IsTrue(sut._sut._control.CommandBits.SpecialCycle.Synchron); + Assert.IsTrue(sut._sut._control.CommandBits.ReadLastResult.Synchron); + sut._sut._control.Command.Synchron = 0; + } + + // ------------------------------------------------------------ handshake (via Reset) + + [Test, Timeout(10000)] + public void ResetRunsOneHandshake() + { + HealthyInstrument(); + Run(eTcoAteqG6Tests.Reset); + + AssertDone(); + Assert.AreEqual(0, Command, "command bit dropped"); + Assert.AreEqual(1, sut._sim.RisingEdges.Synchron, "exactly one rising edge"); + Assert.AreEqual(0x0001, sut._sim.LastRaised.Synchron); + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + Assert.AreEqual(0, sut._sim.Echo.Synchron, "echo released"); + } + + [Test, Timeout(10000)] + public void CommandErrorFailsTheTask() + { + HealthyInstrument(); + sut._sim.FailMask.Synchron = 0x0001; + Run(eTcoAteqG6Tests.Reset); + + AssertError(); + Assert.AreEqual(0x0001, sut._sut._status.LastCommandError.Synchron); + Assert.AreEqual(0, Command, "command bit dropped on error"); + } + + [Test, Timeout(10000)] + public void SilentInstrumentFailsTheTask() + { + HealthyInstrument(); + sut._sim.SilentMask.Synchron = 0x0001; + Run(eTcoAteqG6Tests.Reset); + + AssertError(); + Assert.AreEqual(0, Command); + } + + [Test, Timeout(10000)] + public void NeverCompletingCommandFailsTheTask() + { + HealthyInstrument(); + sut._sim.CommandCycles.Synchron = 10000; + Run(eTcoAteqG6Tests.Reset); + + AssertError(); + Assert.AreEqual(0, Command); + } + + [Test, Timeout(10000)] + public void StuckEchoFailsTheTask() + { + HealthyInstrument(); + sut._sim.StuckEchoMask.Synchron = 0x0001; + Run(eTcoAteqG6Tests.Reset); + + AssertError(); + Assert.AreEqual(0, Command); + } + + [Test, Timeout(10000)] + public void EchoStillHighRaisesNoEdge() + { + HealthyInstrument(); + sut._sim.Echo.Synchron = 0x0001; + Run(eTcoAteqG6Tests.Reset); + + AssertError(); + Assert.AreEqual(0, sut._sim.RisingEdges.Synchron); + } + + [Test, Timeout(10000)] + public void RestoreDropsTheCommandBit() + { + HealthyInstrument(); + sut._sim.CommandCycles.Synchron = 10000; + sut._sut._config.CommandTimeout.Synchron = TimeSpan.FromSeconds(30); + Run(eTcoAteqG6Tests.InvokeReset); + sut.ExecuteProbeRun(5, (int)eTcoAteqG6Tests.Run); + Assert.AreEqual(0x0001, Command, "command bit raised while running"); + + Run(eTcoAteqG6Tests.Restore); + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + Assert.AreEqual(0, Command); + Assert.IsFalse(sut._resetBusy.Synchron); + } + + // ------------------------------------------------------------ select program + + [Test, Timeout(10000)] + public void SelectProgramSwitchesTheProgram() + { + HealthyInstrument(); + sut._program.Synchron = 5; + Run(eTcoAteqG6Tests.SelectProgram); + + AssertDone(); + Assert.AreEqual(4, sut._sim.BusProgram.Synchron); + Assert.AreEqual(0x0008, sut._sim.LastRaised.Synchron); + Assert.AreEqual(5, sut._sut._status.State.CurrentProgram.Synchron); + } + + [TestCase(0)] + [TestCase(129)] + [Timeout(10000)] + public void SelectProgramOutOfRangeRaisesNoEdge(int program) + { + HealthyInstrument(); + sut._program.Synchron = (short)program; + Run(eTcoAteqG6Tests.SelectProgram); + + AssertError(); + Assert.AreEqual(0, sut._sim.RisingEdges.Synchron); + } + + [Test, Timeout(10000)] + public void IgnoredProgramSelectionFailsTheTask() + { + HealthyInstrument(); + sut._sim.IgnoreProgramSelection.Synchron = true; + sut._program.Synchron = 5; + Run(eTcoAteqG6Tests.SelectProgram); + + AssertError(); + } + + // ------------------------------------------------------------ start cycle + + [Test, Timeout(10000)] + public void StartCycleReadsTheResult() + { + HealthyInstrument(); + sut._program.Synchron = 3; + Run(eTcoAteqG6Tests.StartCycle); + + AssertDone(); + var r = sut._sut._status.LastResult; + Assert.IsTrue(r.Valid.Synchron); + Assert.IsTrue(r.Pass.Synchron); + Assert.AreEqual(3, r.ProgramNo.Synchron); + Assert.AreEqual(207.0f, r.Measurement.Pressure.Synchron, 0.0001f); + Assert.AreEqual((short)eTcoAteqG6_Unit_v_3_5_x.mbar, r.Measurement.PressureUnit.Synchron); + Assert.AreEqual(-0.108f, r.Measurement.Flow.Synchron, 0.0001f); + Assert.AreEqual((short)eTcoAteqG6_Unit_v_3_5_x.cm3_min, r.Measurement.FlowUnit.Synchron); + Assert.AreEqual(0, Command); + Assert.AreEqual(0x800A, sut._sim.RaisedUnion.Synchron, "only select, start and read last result"); + Assert.AreEqual(3, sut._sim.RisingEdges.Synchron); + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + Assert.IsTrue(sut._sut._status.LastPass.Synchron); + } + + [Test, Timeout(10000)] + public void StartCycleWaitsForInstrumentReady() + { + HealthyInstrument(); + sut._sim.CycleEnd.Synchron = false; + sut._program.Synchron = 3; + Run(eTcoAteqG6Tests.StartCycle); + + AssertError(); + Assert.AreEqual(0, sut._sim.RisingEdges.Synchron); + } + + [Test, Timeout(10000)] + public void CycleThatNeverStartsFailsTheTask() + { + HealthyInstrument(); + sut._sim.NoCycle.Synchron = true; + sut._program.Synchron = 3; + Run(eTcoAteqG6Tests.StartCycle); + + AssertError(); + Assert.AreEqual(0, Command); + } + + [Test, Timeout(10000)] + public void CycleThatNeverEndsFailsTheTask() + { + HealthyInstrument(); + sut._sim.EndlessCycle.Synchron = true; + sut._program.Synchron = 3; + Run(eTcoAteqG6Tests.StartCycle); + + AssertError(); + Assert.AreEqual(0, Command); + } + + [Test, Timeout(10000)] + public void StaleResultIsRefused() + { + HealthyInstrument(); + sut._sim.ResultProgramOffset.Synchron = 1; + sut._program.Synchron = 3; + Run(eTcoAteqG6Tests.StartCycle); + + AssertError(); + Assert.IsFalse(sut._sut._status.LastResult.Valid.Synchron); + } + + [Test, Timeout(10000)] + public void AlarmResultIsInvalid() + { + HealthyInstrument(); + sut._sim.ResultRelay.Synchron = 0x0008; + sut._sim.ResultAlarm.Synchron = 44; + sut._program.Synchron = 3; + Run(eTcoAteqG6Tests.StartCycle); + + AssertDone(); + var r = sut._sut._status.LastResult; + Assert.IsFalse(r.Valid.Synchron); + Assert.IsTrue(r.Alarm.Synchron); + Assert.AreEqual((short)eTcoAteqG6_AlarmCode_v_3_5_x.PressureTooLow, r.AlarmCode.Synchron); + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + Assert.IsFalse(sut._sut._status.LastPass.Synchron); + } + + [Test, Timeout(10000)] + public void ReadLastResultDecodesTheExchangeZone() + { + HealthyInstrument(); + sut._sim.BusProgram.Synchron = 2; + Run(eTcoAteqG6Tests.ReadLastResult); + + AssertDone(); + Assert.AreEqual(0x8000, sut._sim.LastRaised.Synchron); + Assert.AreEqual(3, sut._sut._status.LastResult.ProgramNo.Synchron); + Assert.IsTrue(sut._sut._status.LastResult.Valid.Synchron); + } + + // ------------------------------------------------------------ special cycle + + [Test, Timeout(10000)] + public void SpecialCycleRaisesStartAndSpecialTogether() + { + HealthyInstrument(); + sut._specialCycle.Synchron = (short)eTcoAteqG6_SpecialCycle_v_3_5_x.PiezoAutoZero; + sut._instruction.Synchron = 0; + Run(eTcoAteqG6Tests.SpecialCycle); + + AssertDone(); + Assert.AreEqual(0x0006, sut._sim.LastRaised.Synchron); + Assert.AreEqual(1, sut._sim.RisingEdges.Synchron); + Assert.AreEqual(9, sut._sim.LastSpecialId.Synchron); + Assert.AreEqual(0, Command); + } + + [Test, Timeout(10000)] + public void SpecialCycleNoneRaisesNoEdge() + { + HealthyInstrument(); + sut._specialCycle.Synchron = (short)eTcoAteqG6_SpecialCycle_v_3_5_x.None; + Run(eTcoAteqG6Tests.SpecialCycle); + + AssertError(); + Assert.AreEqual(0, sut._sim.RisingEdges.Synchron); + } + + // ------------------------------------------------------------ parameters + + [Test, Timeout(10000)] + public void ReadParametersDecodesTheList() + { + HealthyInstrument(); + sut._request.Count.Synchron = 2; + sut._request.Ids[0].Synchron = 3; + sut._request.Ids[1].Synchron = 2; + Run(eTcoAteqG6Tests.ReadParameters); + + AssertDone(); + Assert.AreEqual(0x0020, sut._sim.LastRaised.Synchron); + var list = sut._sut._status.Parameters; + Assert.AreEqual(2, list.Count.Synchron); + Assert.AreEqual(3, list.Items[0].Id.Synchron); + Assert.AreEqual(3.0f, list.Items[0].Value.Synchron, 0.0001f); + Assert.AreEqual(2, list.Items[1].Id.Synchron); + Assert.AreEqual(2000, list.Items[1].Raw.Synchron); + } + + [Test, Timeout(10000)] + public void EmptyParameterRequestRaisesNoEdge() + { + HealthyInstrument(); + sut._request.Count.Synchron = 0; + Run(eTcoAteqG6Tests.ReadParameters); + + AssertError(); + Assert.AreEqual(0, sut._sim.RisingEdges.Synchron); + } + + [Test, Timeout(10000)] + public void PresetParametersAreMapped() + { + HealthyInstrument(); + Run(eTcoAteqG6Tests.ReadPresetParameters); + + AssertDone(); + Assert.AreEqual(11, sut._sut._control.ParameterRequest.Count.Synchron); + Assert.AreEqual(53, sut._sut._control.ParameterRequest.Ids[7].Synchron); + Assert.AreEqual(66, sut._sut._control.ParameterRequest.Ids[10].Synchron); + var set = sut._sut._status.ParameterSet; + // the simulator answers value = identifier + Assert.AreEqual(1.0f, set.FillTime.Synchron, 0.0001f); + Assert.AreEqual(2.0f, set.StabTime.Synchron, 0.0001f); + Assert.AreEqual(3.0f, set.TestTime.Synchron, 0.0001f); + Assert.AreEqual(9.0f, set.DumpTime.Synchron, 0.0001f); + Assert.AreEqual(60.0f, set.TestFail.Synchron, 0.0001f); + Assert.AreEqual(66.0f, set.SetFill.Synchron, 0.0001f); + Assert.AreEqual((short)eTcoAteqG6_TestType_v_3_5_x.Unknown, set.TestType.Synchron, "21000 is not a test type code"); + } + + [Test, Timeout(10000)] + public void SingleParameterIsQueried() + { + HealthyInstrument(); + sut._parameter.Synchron = (short)eTcoAteqG6_ParameterId_v_3_5_x.TestFail; + Run(eTcoAteqG6Tests.ReadParameter); + + AssertDone(); + var q = sut._sut._status.ParameterQuery; + Assert.IsTrue(q.Found.Synchron); + Assert.AreEqual(60.0f, q.Value.Synchron, 0.0001f); + } + + [Test, Timeout(10000)] + public void QueriedParameterNotInRequestIsNotFound() + { + HealthyInstrument(); + sut._sut._control.QueryParameter.Synchron = (ushort)eTcoAteqG6_ParameterId_v_3_5_x.SetFill; + sut._request.Count.Synchron = 1; + sut._request.Ids[0].Synchron = 3; + Run(eTcoAteqG6Tests.ReadParameters); + + AssertDone(); + Assert.IsFalse(sut._sut._status.ParameterQuery.Found.Synchron); + } + + // ------------------------------------------------------------ coordination + + [Test, Timeout(10000)] + public void BusyCommandBlocksOtherCommandsAndKeepsItsData() + { + HealthyInstrument(); + sut._sim.EndlessCycle.Synchron = true; + sut._sut._config.CycleTimeout.Synchron = TimeSpan.FromSeconds(30); + sut._program.Synchron = 3; + Run(eTcoAteqG6Tests.InvokeStartCycle); + sut.ExecuteProbeRun(20, (int)eTcoAteqG6Tests.Run); + Assert.IsTrue(sut._startCycleBusy.Synchron); + + sut._program.Synchron = 7; + Run(eTcoAteqG6Tests.InvokeSelectProgram); + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + + Assert.IsFalse(sut._selectProgramBusy.Synchron, "select program is disabled"); + Assert.AreEqual(3, sut._sut._control.ProgramNumber.Synchron, "running command data is not overwritten"); + } + + [Test, Timeout(10000)] + public void ResetAbortsARunningCommand() + { + HealthyInstrument(); + sut._sim.EndlessCycle.Synchron = true; + sut._sut._config.CycleTimeout.Synchron = TimeSpan.FromSeconds(30); + sut._program.Synchron = 3; + Run(eTcoAteqG6Tests.InvokeStartCycle); + sut.ExecuteProbeRun(20, (int)eTcoAteqG6Tests.Run); + Assert.IsTrue(sut._startCycleBusy.Synchron); + + Run(eTcoAteqG6Tests.InvokeReset); + sut.ExecuteProbeRun(1, (int)eTcoAteqG6Tests.Run); + Assert.IsFalse(sut._startCycleBusy.Synchron, "start cycle aborted"); + Assert.AreEqual(0x01, Out(0x00), "only the reset bit is on the wire"); + + Run(eTcoAteqG6Tests.Reset); + AssertDone(); + Assert.AreEqual(0, Command); + } + + [Test, Timeout(10000)] + public void RestoreClearsCommandAndError() + { + HealthyInstrument(); + sut._sim.FailMask.Synchron = 0x0001; + Run(eTcoAteqG6Tests.Reset); + AssertError(); + + Run(eTcoAteqG6Tests.Restore); + sut.ExecuteProbeRun(2, (int)eTcoAteqG6Tests.Run); + Assert.AreEqual(0, Command); + Assert.AreEqual(0, sut._sut._status.LastCommandError.Synchron); + Assert.IsFalse(sut._resetBusy.Synchron); + } + } +} diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/TcoAteqMeasurementUnitTests.csproj b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/TcoAteqMeasurementUnitTests.csproj new file mode 100644 index 00000000..ad8e5dc6 --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/TcoAteqMeasurementUnitTests.csproj @@ -0,0 +1,21 @@ + + + + net5.0;net48 + + + + + + + + + + + + + + + + + diff --git a/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/TestSetupFixture.cs b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/TestSetupFixture.cs new file mode 100644 index 00000000..abc7f10b --- /dev/null +++ b/src/TcoAteqMeasurement/tests/TcoAteqMeasurementUnitTests/TestSetupFixture.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using System; + +namespace TcoAteqMeasurementUnitTests +{ + [SetUpFixture] + [Apartment(System.Threading.ApartmentState.STA)] + public class TestSetupFixture + { + public static string TargetAmsId { get; private set; } + public static int TargetAmsPort { get; private set; } = 852; + + [OneTimeSetUp] + [Apartment(System.Threading.ApartmentState.STA)] + [STAThread] + public void OneTimeSetUp() + { + TargetAmsId = Environment.GetEnvironmentVariable("Tc3Target"); + } + [OneTimeTearDown] + public void OneTimeTearDown() + { + + } + } +} \ No newline at end of file diff --git a/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.cs-CZ.resx b/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.cs-CZ.resx index 022bdc96..e8b63365 100644 --- a/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.cs-CZ.resx +++ b/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.cs-CZ.resx @@ -267,6 +267,9 @@ Spouštěcí pohyby zíraly. + + Spuštění programu bylo přerušeno, přestože ještě nebylo dokončeno! + Program Stop byl přerušen, přestože ještě nebyl dokončen! @@ -276,6 +279,9 @@ Zastavení programu s chybou. + + Spouštění programu zahájeno. + Zastavení spuštěného programu. diff --git a/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.de-DE.resx b/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.de-DE.resx index 58300c70..53e8a684 100644 --- a/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.de-DE.resx +++ b/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.de-DE.resx @@ -267,6 +267,9 @@ Startbewegungen starrten. + + Programm starten wurde abgebrochen, obwohl es noch nicht abgeschlossen war! + Stop-Programm wurde abgebrochen, obwohl es noch nicht abgeschlossen ist! @@ -276,6 +279,9 @@ Das Programm wird mit einem Fehler beendet. + + Programmstart begonnen. + Anhaltendes Programm gestartet. diff --git a/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.es-ES.resx b/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.es-ES.resx index 76a34d06..463573bd 100644 --- a/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.es-ES.resx +++ b/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.es-ES.resx @@ -267,6 +267,9 @@ Los movimientos de inicio se quedaron mirando. + + Iniciar programa fue abortado, ¡aún no se ha completado! + Se ha interrumpido el programa Stop, ¡aún no se ha completado! @@ -276,6 +279,9 @@ Parada del programa con error. + + Inicio del programa iniciado. + Detención del programa iniciado. diff --git a/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.sk-SK.resx b/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.sk-SK.resx index 8aa5ee05..20921ef5 100644 --- a/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.sk-SK.resx +++ b/src/TcoKukaRobotics/src/TcoKukaRoboticsConnector/Properties/Localizations.sk-SK.resx @@ -267,6 +267,9 @@ Začiatok pohybov sa pozeral. + + Spustenie programu bolo prerušené, pričom ešte nebolo dokončené! + Program Stop bol prerušený, pričom ešte nebol dokončený! @@ -276,6 +279,9 @@ Zastavenie programu s chybou. + + Spúšťanie programu spustené. + Zastavenie spusteného programu.