1104 new featureaxovisionpro alternative#1159
Open
peterbarancek wants to merge 5 commits into
Open
Conversation
Introduces AxoVisionProNet component for Cognex VisionPro PC-based vision systems, including: - PLC-side S7-extern class with task-based control, config, and status structures - .NET Twin integration for data marshaling and remote task invocation - Generic containers for user-specific data exchange - Robust async TCP client using a JSON protocol for runtime communication - Extensible protocol message definitions and envelope Enables seamless, type-safe PLC ↔ VisionPro PC integration in industrial automation projects.
Major protocol and client refactor for Cognex VisionPro integration: - Add new PLC remote tasks: ReceiveSpecificData, TriggerWithSpecificData, SendSpecificDataAndTypes, with corresponding methods and execution logic. - Extend protocol: triggerId (short) and Variant (string) in requests/responses; new InspectionFault and ReceiveSpecificData payloads; support for type-annotated data. - VisionTcpClient: switch to per-request Channels for response correlation, support multi-step trigger flows, improve error diagnostics, and increase timeouts to 5s. - Add VisionTypedPayloadSerializer for round-tripping .NET objects with type metadata. - Update status and control structures for new protocol fields. - Remove obsolete protocol code and improve extensibility for future data flows.
Implement full TriggerWithSpecificData flow in AxoVisionProNet and VisionTcpClient, including sending/receiving specific data payloads and handling returned data. Extend error handling to propagate runtime error messages from all remote tasks to the messenger and status descriptions. Add new message types, payload fields, and configurable timeouts to support the new functionality.
- Introduce RunWithLifecycleAsync for consistent task status updates - Add TaskLifecycleCodes for clear action/error code mapping - Refactor error/action message handling and remove legacy messenger logic - Update all remote task methods to set status before exceptions - Add ConnectTimeout and unified per-task timeout config to VisionTcpClientOptions - Implement TCP connection timeout with descriptive errors - Remove obsolete DataEntity property and related status logic - Modernize and streamline component lifecycle and error reporting
- Added `USING AXOpen.Components.Abstractions;` for required abstractions.
- Introduced `DeviceIpAddress` and `Proxy` properties with `{S7.extern=ReadWrite}`.
- Improved task execution with error handling for remote exceptions.
- Added logic to disable tasks based on busy states or manual mode.
- Updated `Restore` method to reset additional status fields.
- Added `CallTimers` method for timer-based logic using `_infoTimer` and `_errorTimer`.
- Enhanced `AxoVisionProNet_Component_Status` with new fields for detailed status reporting.
- Refactored redundant fields in `AxoVisionProNet_Component_Status` for consistency.
| { | ||
| var payload = envelope.GetPayload<TriggerAcceptedPayload>(); | ||
| return payload?.Accepted == true | ||
| ? TriggerResult.Ok(payload?.TriggerId ?? 0) |
| { | ||
| var payload = envelope.GetPayload<TriggerAcceptedPayload>(); | ||
| return payload?.Accepted == true | ||
| ? TriggerResult.Ok(payload?.TriggerId ?? 0) |
Comment on lines
+210
to
+217
| foreach (var prop in properties) | ||
| { | ||
| if (!prop.CanRead || prop.GetIndexParameters().Length > 0) | ||
| continue; | ||
|
|
||
| if (DerivesFromOpenGeneric(prop.PropertyType, openGenericBase)) | ||
| return prop.GetValue(this) as ITwinObject; | ||
| } |
Comment on lines
+233
to
+237
| foreach (var iface in type.GetInterfaces()) | ||
| { | ||
| if (iface.IsGenericType && iface.GetGenericTypeDefinition() == openGenericBase) | ||
| return true; | ||
| } |
| if (_receiveLoop is not null) | ||
| { | ||
| try { await _receiveLoop; } | ||
| catch { /* already cancelled */ } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.