NI Home > Community > NI Discussion Forums

NI TestStand

Showing results for 
Search instead for 
Do you mean 
Reply
Member
mwcmwc
Posts: 12
0 Kudos
Accepted Solution

Dumping Variables to Text File, separate from TS Report

Hi All,

 

I know I can probably do this in TestStand using LabView, however, that is not a luxury I have.

 

What I am trying to do is, when a failure occurs, dump a specific set of information into a separate (most likely text file) log file apart from the standard test stand report.  For example, I might be keeping track of some buffer or test equipment status in stationglobals, when a test fails, I want to dump part of the station global into a different log, again, apart from the test stand report, is this possible?

 

Seems like the closest thing I found looking through TS and the support forums is to use ActiveX calls to maybe MS Word or Excel and generate something from there?  I was hoping for something a bit more simple?

 

Regards,

Mike

Member
Captain_Jack
Posts: 199

Re: Dumping Variables to Text File, separate from TS Report

Hi Mike,

 

Try This:

 

Write Method

Syntax

PropertyObject.Write ( pathString, objectName, RWoptions)

Purpose

Writes the contents of an object to the file specified by pathString and associates the name specified by objectName with the object in the file.

Remarks

If you call this method on an alias object, TestStand generates the stream using the object to which the alias refers. This method does not include alias subproperty objects in the stream. Refer to IsAliasObject for more information about alias objects.

Parameters

pathString As String

[In] Pass the pathname of the file to which to write the object data.

objectName As String

[In] Pass the name to associate with the object.

RWoptions As Long

[In] Pass 0 to specify the default behavior, or pass one or more ReadWriteOptions constants. Use the bitwise-OR operator to specify multiple read/write options.

 

 

For example, make a statement step in a sequence with local variables and run it:

 

Locals.Write ("C:\\temp\\Locals.txt","Locals",0)

 

This will generate a text file with the values of the local variables. You can use this on any object, but you'll probably need to lay with the options to get what you want.

 

Hope this helps.

 

-Jack

Member
mwcmwc
Posts: 12
0 Kudos

Re: Dumping Variables to Text File, separate from TS Report

Awesome, totally didn't see that, and I can use read to get the variable back.  Thanks!!!