Example Code

Reading and Writing TXT to Report with DIAdem Script

Code and Documents

Attachment

Overview

This example shows File I/O (read and write) with TXT's and also inserts the read strings into a report.

 

Description

  • First, we declare a global variable which is available to Script and Report (in my case "valar(4)").
  • In the report, we write the variables entries (e.g. @@valar(0)@@) to the desired locations.
  • In the script, the TXT gets opened, read and the strings are written into our variable (some TXT output is also produced).
  • Generate and refresh the report.

 

Hardware and Software Requirements

DIAdem Base 2012 SP2 (or compatible)

 

Steps to Implement or Execute Code

1. Unzip TXT Read Write Report - DIA2012SP2.zip.

2. Run Read TXT.VBS.

 

Additional Information or References

-

Eric H.
Applications Engineering
National Instruments

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

Contributors