Example Code

DIAdem Script to Print All Error Codes and Messages

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Diadem

Code and Documents

Attachment

Overview
This example demonstrates how to print all error codes and messages with DIAdem Script. 


Description
DIAdem uses native VBscript error functionality. Errors in VBscript are represented by the Err Object. The Err object can have a number between 0 and 65535 (2^16-1). Some of these error numbers are already reserved and used by DIAdem to display specific errors and error messages. The attached script enumerates all the errors and, if they are unique errors then they will be logged. You can use the information this script produces to handle specific errors in your code, or to define custom errors outside of the range of the predefined errors.

After opening and running the script in DIAdem, you will see the list of errors appear in the Logfile view beneath the VBscript.

To find out more about the Err Object in VBScript, click here

 
Requirements

  • DIAdem


Steps to Implement or Execute Code

  1. Open in DIAdem SCRIPT
  2. Change constants as needed
  3. Run script

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Regards,
Basil
Applications Engineering
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.