Jump to content

Logging for Unwired Errors: Difference between revisions

From LabVIEW Wiki
Created page with "'''Logging for Unwired Errors''' is a feature in LabVIEW that stores any errors from any error output terminal that isn't connected, to a wikipedia:JSON-formatted log file. When enabled, a new log file is created in the data directory, under ''UnwiredErrors'' every time the application starts. ==Usage== Logging for Unwired Errors can be enabled in the ''Block Diagram'' section of the Options dialog under ''Error Handling'', by checking the ''Log unwired err..."
 
m Show line numbers on JSON data
 
Line 9: Line 9:
Unwired errors are logged in a JSON-formatted file, using the following schema (unofficial):
Unwired errors are logged in a JSON-formatted file, using the following schema (unofficial):


<syntaxhighlight lang="json">
<syntaxhighlight lang="json" line>
{
{
   "type": "object",
   "type": "object",
Line 42: Line 42:
           "Node": {
           "Node": {
             "type": "string",
             "type": "string",
             "description": "The label of the node that caused the error."
             "description": "The name of the node that caused the error."
           },
           },
           "Error Code": {
           "Error Code": {
Line 81: Line 81:
The following example illustrates a log file created for unwired errors in LabVIEW (formatted for readability):
The following example illustrates a log file created for unwired errors in LabVIEW (formatted for readability):


<syntaxhighlight lang="json">
<syntaxhighlight lang="json" line>
{
{
     "Application": "LabVIEW",
     "Application": "LabVIEW",

Latest revision as of 13:35, 17 August 2025

Logging for Unwired Errors is a feature in LabVIEW that stores any errors from any error output terminal that isn't connected, to a JSON-formatted log file. When enabled, a new log file is created in the data directory, under UnwiredErrors every time the application starts.

Usage

Logging for Unwired Errors can be enabled in the Block Diagram section of the Options dialog under Error Handling, by checking the Log unwired errors option, or by adding LogUnwiredErrors=True to the configuration file. It works regardless of the settings for automatic error handling and application contexts. This means that unwired errors are also logged for internal functions (e.g., the runtime environment).

The option can also be enabled for executables, using the aforementioned configuration key.

File structure

Unwired errors are logged in a JSON-formatted file, using the following schema (unofficial):

{
  "type": "object",
  "properties": {
    "Application": {
      "type": "string",
      "description": "The name of the application that the error log was created for."
    },
    "Session Start Time": {
      "type": "string",
      "description": "The date and time when the session started (may or may not be the same as the start time of the application)."
    },
    "Unwired Errors": {
      "type": "array",
      "description": "Contains the list of unwired errors that were captured during the session.",
      "items": {
        "type": "object",
        "properties": {
          "VI": {
            "type": "string",
            "description": "The name of the VI for which the error is reported."
          },
          "Project": {
            "type": "string",
            "description": "The name of the project that the VI belongs to, or \"Not In Project\" if the error was captured for a VI that did not run in a particular project."
          },
          "Node Id": {
            "type": "string",
            "description": "The unique identity of the node that caused the error.",
            "pattern": "[0-9]+"
          },
          "Node": {
            "type": "string",
            "description": "The name of the node that caused the error."
          },
          "Error Code": {
            "type": "string",
            "description": "The error code of the error that was captured.",
            "pattern": "[-]{0,1}[0-9]+"
          },
          "Description": {
            "type": "string",
            "description": "The error message associated with the captured error."
          },
          "Time": {
            "type": "string",
            "description": "The time at which the error was captured."
          }
        },
        "required": [
          "VI",
          "Project",
          "Node Id",
          "Node",
          "Error Code",
          "Description",
          "Time"
        ]
      }
    }
  },
  "required": [
    "Application",
    "Session Start Time",
    "Unwired Errors"
  ]
}

Example

The following example illustrates a log file created for unwired errors in LabVIEW (formatted for readability):

{
    "Application": "LabVIEW",
    "Session Start Time": "August 17 2025, 15:28:55",
    "Unwired Errors": [
        {
            "VI": "Create Zip File.vi",
            "Project": "Not In Project",
            "Node Id": "1749",
            "Node": "Delete",
            "Error Code": "7",
            "Description": "LabVIEW: (Hex 0x7) File not found. The file might be in a different location or deleted. Use the command prompt or the file explorer to verify that the path is correct.",
            "Time": "15:28:55"
        }
    ]
}

History

See also