### File Naming Convention Example Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves Illustrates the required file naming convention for output curves, which includes a timestamp and a GUID. ```text 20260109143025_a7f3e8d1-4c2b-4f9e-9a7c-3d2e1f0b8c5a.json ``` -------------------------------- ### PLC Monitoring Logic Example Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves Example logic for monitoring PLC system health, including checks for queue growth and disk space. Use this to implement alerts for potential issues. ```PLC Logic IF queued_items > 50 AND (current_time - last_transmission_time) > 300000 THEN // Queue growing and no transmission in 5 minutes - alert operator RAISE_ALARM("Output buffer transmission failure") END_IF IF is_disk_space_critical = TRUE THEN // Critical disk space - stop production RAISE_ALARM("Output buffer storage critical") END_IF ``` -------------------------------- ### Healthy Buffer Statistics Example Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves Example JSON output representing a healthy state of the output buffer. Indicates normal operation with sufficient disk space and low queue backlog. ```json { "queued_items": 2, // Small queue backlog (normal) "total_enqueued": 15234, // Lifetime count "total_transmitted": 15232, // Almost all transmitted "total_failed_attempts": 47, // Few failures (retries) "available_disk_space_mb": 8450, // Plenty of space "last_transmission_time": 1736429845000, // Recent activity "is_transmitting": true, // Active transmission "is_disk_space_critical": false // Space OK } ``` -------------------------------- ### Example appdata.json Configuration Source: https://haller-erne.github.io/Docusaurus/docs/shared/stahlwille/configuration This JSON object demonstrates a typical configuration for network settings and a parameter set. It includes IP address, port, and details for a 'JNT' type parameter set with torque limits. ```json { "IPAddress": "10.10.2.168", "IPPort": 4002, "PSets": [ { "pset": 1, "name": "My Prg 1", "desc": "sample test program", "type": "JNT", "mode": "clic", "unit": "Nm", "elen": 100.0, "t_min": 4.1, "t_tgt": 4.5, "t_max": 5.5 } ] } ``` -------------------------------- ### Healthy Buffer Statistics Example Source: https://haller-erne.github.io/Docusaurus/docs/shared/stahlwille/outputcurves Example JSON output representing a healthy output buffer system. Key indicators include low queued items, high available disk space, and recent transmission times. ```json { "queued_items": 2, // Small queue backlog (normal) "total_enqueued": 15234, // Lifetime count "total_transmitted": 15232, // Almost all transmitted "total_failed_attempts": 47, // Few failures (retries) "available_disk_space_mb": 8450, // Plenty of space "last_transmission_time": 1736429845000, // Recent activity "is_transmitting": true, // Active transmission "is_disk_space_critical": false // Space OK } ``` -------------------------------- ### Example `appdata.json` Configuration Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/configuration This JSON object represents a typical configuration for the application, including network settings and a parameter set definition. It shows the structure for IP address, port, serial number, and detailed parameter set properties like torque and angle targets. ```json { "IPAddress": "10.10.2.177", "IPPort": 4545, "SerialNumber": "GP1010003", "Psets": [ { "ParameterSetName": "Bolt M10", "ParameterSetNumber": 1, "WorkpieceId": "M10_BOLT", "ProgramNumber": "1", "TorqueTarget": 50, "TorqueMin": 45, "TorqueMax": 55, "TorqueThreshold": 5, "AngleTarget": 0, "AngleMin": 0, "AngleMax": 0, "BoltCenter": 0.5, "TimeMin": 100, "TimeMax": 5000, "Method": 1, "Direction": 1, "Unit": 1, "CurveDataEnabled": false } ] } ``` -------------------------------- ### Unhealthy Buffer Statistics Example Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves Example JSON output representing an unhealthy state of the output buffer. Highlights critical conditions like a nearly full queue, low disk space, and stalled transmission. ```json { "queued_items": 198, // Queue nearly full (critical!) "total_enqueued": 8567, // Lifetime count "total_transmitted": 8369, // 198 pending (queued_items) "total_failed_attempts": 2341, // Many failures (endpoint issues) "available_disk_space_mb": 35, // Low space (approaching threshold) "last_transmission_time": 1736429515000, // 5+ minutes ago (stalled) "is_transmitting": false, // Not transmitting (bad sign) "is_disk_space_critical": true // Critical space condition } ``` -------------------------------- ### Example Valid Psets Array Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/error-codes This JSON snippet shows a valid structure for the 'Psets' array in the appdata.json configuration file, defining parameter sets for tools. ```json { "Psets": [ { "ParameterSetName": "Bolt M10", "ParameterSetNumber": 1, "WorkpieceId": "M10_BOLT" }, { "ParameterSetName": "Bolt M12", "ParameterSetNumber": 2, "WorkpieceId": "M12_BOLT" } ] } ``` -------------------------------- ### Unhealthy Buffer Statistics Example Source: https://haller-erne.github.io/Docusaurus/docs/shared/stahlwille/outputcurves Example JSON output representing an unhealthy output buffer system. Indicators include a nearly full queue, low disk space, and stalled transmissions. ```json { "queued_items": 198, // Queue nearly full (critical!) "total_enqueued": 8567, // Lifetime count "total_transmitted": 8369, // 198 pending (queued_items) "total_failed_attempts": 2341, // Many failures (endpoint issues) "available_disk_space_mb": 35, // Low space (approaching threshold) "last_transmission_time": 1736429515000, // 5+ minutes ago (stalled) "is_transmitting": false, // Not transmitting (bad sign) "is_disk_space_critical": true // Critical space condition } ``` -------------------------------- ### PLC Monitoring Logic Example Source: https://haller-erne.github.io/Docusaurus/docs/shared/stahlwille/outputcurves This snippet demonstrates conditional logic for monitoring PLC system health. It includes checks for queue growth and transmission failures, as well as critical disk space conditions, to raise appropriate alarms. ```PLC Logic IF queued_items > 50 AND (current_time - last_transmission_time) > 300000 THEN // Queue growing and no transmission in 5 minutes - alert operator RAISE_ALARM("Output buffer transmission failure") END_IF IF is_disk_space_critical = TRUE THEN // Critical disk space - stop production RAISE_ALARM("Output buffer storage critical") END_IF ``` -------------------------------- ### DataLayer Curve Data Encoding Example Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves Shows how tightening curve data is encoded into an integer array format for the DataLayer, with scaling constants. ```text [125, 18453, 45678, 250, 19876, 47234, 375, 20102, 48901] ``` -------------------------------- ### REST API Success Response Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/error-codes Example of a successful operation response from the REST API's Enable endpoint. ```json { "success": true, "errorCode": 0, "message": "Operation completed successfully" } ``` -------------------------------- ### REST API Error Response Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/error-codes Example of an error response from the REST API's Enable endpoint, indicating a tool connection issue. ```json { "success": false, "errorCode": -6, "message": "Tool is not connected" } ``` -------------------------------- ### Complete JSON Payload Example for Tightening Result Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves A comprehensive JSON payload representing a completed tightening operation. This includes cycle-level metadata, tightening steps, and graph data for angle, torque, and time. ```JSON { "nr": 1, "cycle": 818523569.441723, "result": "NOK", "channel": "GP1010003", "prg nr": 2, "prg name": "Bolt M12 Angle 45", "prg date": "2025-12-08T15:39:29", "nominal torque": 4.5, "date": "2025-12-08 15:39:29", "torque unit": "Nm", "last cmd": "Bolt M12 Angle 45", "quality code": "1", "total time": "0.000000", "tool serial": "GP1010003", "tightening steps": [ { "result": "NOK", "name": "Tightening", "step type": "standard", "last cmd": "Bolt M12 Angle 45", "torque": 0.34, "angle": 47.5, "duration": 0, "quality code": "1", "speed": 50, "tightening functions": [ { "name": "TF Angle", "nom": 45, "min": 30, "max": 59.9, "act": 47.5 }, { "name": "MFs TimeMax", "nom": 100, "act": 0 }, { "name": "MFs TorqueMax", "nom": 4.5, "min": 5, "max": 4, "act": 0.34 } ], "graph": { "angle values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], "torque values": [1.8, 1.5, 1.4, 1.4, 1.4, 1.2, 1.2, 1.2, 1.3, 1.1, 1.2, 1.3, 1.2, 1.1, 1, 1.1, 1.5, 1.9, 3.4, 1.5, 1.4, 1.3, 1.4, 1.2, 1.1, 1.5, 1.4, 1.4, 1.4, 1.6, 1.6, 1.9, 1.7, 1.9, 1.8, 1.9, 1.7, 1.8, 1.9, 2.1, 1.8, 2, 1.7, 1.6, 1.2, 1.3, 1.4, 1.8], "time values": [0, 0.01, 0.02, 0.03, 0.04, 0.049999997, 0.06, 0.07, 0.08, 0.089999996, 0.099999994, 0.11, 0.12, 0.13, 0.14, 0.14999999, 0.16, 0.17, 0.17999999, 0.19, 0.19999999, 0.21, 0.22, 0.22999999, 0.24, 0.25, 0.26, 0.26999998, 0.28, 0.29, 0.29999998, 0.31, 0.32, 0.32999998, 0.34, 0.35, 0.35999998, 0.37, 0.38, 0.39, 0.39999998, 0.41, 0.42, 0.42999998, 0.44, 0.45, 0.45999998, 0.47] } } ] } ``` -------------------------------- ### Production Configuration (External Storage) Source: https://haller-erne.github.io/Docusaurus/docs/shared/stahlwille/outputcurves This configuration directs buffered output to external storage such as an SD card or USB drive. Ensure the 'removable-media' snap interface is connected for external storage access. ```json { "OutputHttpURL": "http://127.0.0.1:8889/x", "MinStorageAvailable": 50, "MaxItemsInQueue": 200, "StoragePath": "/media/mmcblk1p1/Buffer/Stahlwille", "_comment": "StoragePath examples - external storage requires removable-media plug:", "_examples": { "external_sd_card": "/media/mmcblk1p1/Buffer/Stahlwille", "external_usb": "/media/usb-device/outputbuffer", "default_snap_storage": "" } } ``` -------------------------------- ### Production Configuration (External Storage) Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves This configuration uses external storage (SD card or USB) for buffered files. Ensure the 'removable-media' snap interface is connected for external storage access. ```json { "OutputHttpURL": "http://127.0.0.1:8889/x", "MinStorageAvailable": 50, "MaxItemsInQueue": 200, "StoragePath": "/media/mmcblk1p1/Buffer/CommGO", "_comment": "StoragePath examples - external storage requires removable-media plug:", "_examples": { "external_sd_card": "/media/mmcblk1p1/Buffer/CommGO", "external_usb": "/media/usb-device/outputbuffer", "default_snap_storage": "" } } ``` -------------------------------- ### Development/Testing Configuration (Disabled Output) Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves This configuration disables output buffering and HTTP posting. It is useful for testing tool functionality without external dependencies. ```json { "EnableOutput": false, "OutputHttpURL": "http://127.0.0.1:8889/x", "MinStorageAvailable": 50, "MaxItemsInQueue": 200, "StoragePath": "" } ``` -------------------------------- ### Connect Removable Media Snap Interface Source: https://haller-erne.github.io/Docusaurus/docs/shared/stahlwille/outputcurves Connect the removable-media interface for the commsw snap if using external storage. This is required for the snap to access SD cards or USB drives. ```bash snap connect he-ctrlx-app-commsw:removable-media ``` -------------------------------- ### Production Configuration (Default Storage) Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves A standard production configuration with a higher disk space threshold for a safety margin. It utilizes the default storage location for buffered files. ```json { "EnableOutput": true, "OutputHttpURL": "http://localhost:2222/x", "MinStorageAvailable": 500, "MaxItemsInQueue": 200, "StoragePath": null } ``` -------------------------------- ### Ping Tool IP Address Source: https://haller-erne.github.io/Docusaurus/docs/shared/stahlwille/error-codes Use this command to check network connectivity to the tool's IP address. Ensure the IP address matches the configuration. ```bash ping 10.10.2.126 ``` -------------------------------- ### Enable Endpoint Source: https://haller-erne.github.io/Docusaurus/docs/shared/stahlwille/error-codes The Enable endpoint allows for enabling a tool with a specified parameter set. It returns a success or error code indicating the operation's outcome. ```APIDOC ## POST /he-ctrlx-app-commsw/api/v1/tool/enable?iPSet=2 ### Description Enables a tool with a specified parameter set. Returns a success or error code. ### Method POST ### Endpoint /he-ctrlx-app-commsw/api/v1/tool/enable ### Parameters #### Query Parameters - **iPSet** (integer) - Required - The parameter set number to enable the tool with. ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **errorCode** (integer) - The error code of the operation (0 for success). - **message** (string) - A message describing the operation's outcome. #### Response Example ```json { "success": true, "errorCode": 0, "message": "Operation completed successfully" } ``` #### Error Response (400) - **success** (boolean) - Indicates if the operation was successful. - **errorCode** (integer) - The error code of the operation (e.g., -6 for tool not connected). - **message** (string) - A message describing the error. #### Response Example ```json { "success": false, "errorCode": -6, "message": "Tool is not connected" } ``` ``` -------------------------------- ### Test HTTP Endpoint Connectivity Source: https://haller-erne.github.io/Docusaurus/docs/shared/stahlwille/error-codes Use this curl command to test if the HTTP endpoint is running and accessible. It sends a POST request with a test JSON payload. ```bash curl -X POST http://127.0.0.1:8889/x -d '{"test": true}' ``` -------------------------------- ### Handle Enable Command Response and CommandRejected Event Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/error-codes This TypeScript/Angular code demonstrates how to handle responses from an enable tool command and SignalR CommandRejected events, displaying user-friendly error messages. ```typescript import { OperationErrorCode, getOperationErrorMessage } from './models/operation-error-code'; // Handle Enable command response toolService.enableTool(psetNumber).subscribe({ next: (response) => { if (response.errorCode === OperationErrorCode.Success) { console.log('Tool enabled successfully'); } else { const message = getOperationErrorMessage(response.errorCode); alert(`Enable failed: ${message}`); } }, error: (err) => { console.error('HTTP error:', err); } }); // Handle SignalR CommandRejected event signalRService.commandRejected$.subscribe((event) => { const message = getOperationErrorMessage(event.errorCode); this.showNotification(`Command ${event.command} rejected: ${message}`, 'error'); }); ``` -------------------------------- ### PLC Tool Controller Logic Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/error-codes This Structured Text program reads tool state, checks for errors, and handles specific error codes to manage production alarms, warnings, and connection retries. It writes commands to the DataLayer based on the tool's status. ```structured-text PROGRAM ToolController VAR toolState : ToolState; // Read from he/commgo/app/tool1/state enableCommand : BOOL; lastErrorCode : INT; errorMessage : STRING[255]; END_VAR // Read tool state from DataLayer toolState := DataLayer.Read('he/commgo/app/tool1/state'); // Check for errors before enabling IF enableCommand AND NOT toolState.enabled THEN IF toolState.error_code < 0 THEN // Negative error code - cannot enable lastErrorCode := toolState.error_code; errorMessage := toolState.error_message; CASE toolState.error_code OF -1: (* NoLicense - Critical, stop production *) ProductionAlarm := TRUE; AlarmMessage := 'License invalid'; -2: (* NoStorageAvailable - Warning, may continue if output not critical *) ProductionWarning := TRUE; -6: (* ToolNotConnected - Common, retry connection *) RetryConnection := TRUE; END_CASE; ELSE // No errors, send Enable command DataLayer.Write('he/commgo/app/tool1/command', enableCommand); END_IF; END_IF; ``` -------------------------------- ### PLC Tool Controller Logic Source: https://haller-erne.github.io/Docusaurus/docs/shared/stahlwille/error-codes This Structured Text program reads the state of a tool, checks for error codes, and implements specific handling logic for various error conditions before enabling the tool. It maps negative error codes to specific actions and messages. ```Structured Text PROGRAM ToolController VAR toolState : ToolState; // Read from he/commsw/app/tool1/state enableCommand : BOOL; lastErrorCode : INT; errorMessage : STRING[255]; END_VAR // Read tool state from DataLayer toolState := DataLayer.Read('he/commsw/app/tool1/state'); // Check for errors before enabling IF enableCommand AND NOT toolState.enabled THEN IF toolState.error_code < 0 THEN // Negative error code - cannot enable lastErrorCode := toolState.error_code; errorMessage := toolState.error_message; CASE toolState.error_code OF -1: (* NoLicense - Critical, stop production *) ProductionAlarm := TRUE; AlarmMessage := 'License invalid'; -2: (* NoStorageAvailable - Warning, may continue if output not critical *) ProductionWarning := TRUE; -6: (* ToolNotConnected - Common, retry connection *) RetryConnection := TRUE; END_CASE; ELSE // No errors, send Enable command DataLayer.Write('he/commsw/app/tool1/command', enableCommand); END_IF; END_IF; ``` -------------------------------- ### DataLayer Tool State Structure Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/error-codes FlatBuffers structure for the tool state node in DataLayer, including error code and message. ```json { "connected": false, "enabled": false, "pset": 0, "error_code": -6, "error_message": "Tool is not connected" } ``` -------------------------------- ### Buffer Status Node Structure Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves Defines the JSON structure for the buffer status node in the DataLayer, detailing available fields and their types. ```json { "queued_items": 0, "total_enqueued": 0, "total_transmitted": 0, "total_failed_attempts": 0, "available_disk_space_mb": 0, "last_transmission_time": 0, "last_enqueue_time": 0, "last_time_connected": 0, "is_transmitting": false, "is_disk_space_critical": true } ``` -------------------------------- ### DataLayer Curve Data Decoding Logic Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/outputcurves Provides the logic for decoding the integer array format of curve data back into time, torque, and angle values. ```plaintext for i = 0 to (array.length / 3) - 1: time_seconds = array[i * 3] / 1000.0 torque_nm = array[i * 3 + 1] / 1000.0 angle_degrees = array[i * 3 + 2] / 1000.0 ``` -------------------------------- ### SignalR CommandRejected Event Payload Source: https://haller-erne.github.io/Docusaurus/docs/shared/opex-gwk/error-codes Structure of the SignalR CommandRejected event payload, used for real-time error notifications. ```json { "errorCode": -5, "errorMessage": "Requested parameter set not available or configuration is empty", "command": "Enable", "timestamp": "2026-01-09T14:32:15Z" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.