OpcCmd Utility Tips and Tricks: Difference between revisions

From OPC Labs Knowledge Base
(Created page with "Category:OpcCmd Utility Category:Tips and tricks ; Displaying exception information from an event : If a command produces events that contain errors, you may want to d...")
 
No edit summary
Line 2: Line 2:
; Displaying exception information from an event
; Displaying exception information from an event
: If a command produces events that contain errors, you may want to display the details of the exception information related to particular event in a nicely formatted way, analogically to what the <code>error?</code> (shortened: <code>er?</code>) command does. To do so, determine the index ''eventIndex'' of the event in the sequence, and then enter the following command: <code>events? ''eventIndex'' --!extractMember EventArgs.ErrorDescendInfos</code> (shortened: <code>ev? ''eventIndex'' -!xm EventArgs.ErrorDescendInfos</code>). The resulting table starts with a row for the outmost exception, and the subsequent row(s) contain the inner exception(s), recursively. An error ID and the full error message is listed with each exception.
: If a command produces events that contain errors, you may want to display the details of the exception information related to particular event in a nicely formatted way, analogically to what the <code>error?</code> (shortened: <code>er?</code>) command does. To do so, determine the index ''eventIndex'' of the event in the sequence, and then enter the following command: <code>events? ''eventIndex'' --!extractMember EventArgs.ErrorDescendInfos</code> (shortened: <code>ev? ''eventIndex'' -!xm EventArgs.ErrorDescendInfos</code>). The resulting table starts with a row for the outmost exception, and the subsequent row(s) contain the inner exception(s), recursively. An error ID and the full error message is listed with each exception.
; How can I enable the log (trace) entries from OPC UA stack and SDK with commands like uaClient or uaServer?
: <code>!diagnostics sources setSwitchValue Verbose OpcLabs.EasyOpc.UA.UAEngineBase.SdkLog</code>

Revision as of 14:29, 13 December 2024

Displaying exception information from an event
If a command produces events that contain errors, you may want to display the details of the exception information related to particular event in a nicely formatted way, analogically to what the error? (shortened: er?) command does. To do so, determine the index eventIndex of the event in the sequence, and then enter the following command: events? eventIndex --!extractMember EventArgs.ErrorDescendInfos (shortened: ev? eventIndex -!xm EventArgs.ErrorDescendInfos). The resulting table starts with a row for the outmost exception, and the subsequent row(s) contain the inner exception(s), recursively. An error ID and the full error message is listed with each exception.
How can I enable the log (trace) entries from OPC UA stack and SDK with commands like uaClient or uaServer?
!diagnostics sources setSwitchValue Verbose OpcLabs.EasyOpc.UA.UAEngineBase.SdkLog