NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Read and write txt file

Hi 

 

I am writing a teststand sequence that can publish a device's serial number into a text file or ini, (or publish it into the environment) and then having another teststand sequence to read that file or grab that environment variable. 

 

I can't just combine the two teststand sequences because I have to run a program in the middle and I need the console output of that program on cmd (and potentially jenkins).

 

When I'm publishing it to environment variable using SetEnvironmentVariable(String, String, EnvironmentVariableTarget) function, I get a .net fatal error from teststand. 

 

I am able to write into a text file from teststand using cmd, but I am not sure how to read from it in the 2nd program.

 

Please help ~  and thank you in advance 🙂

0 Kudos
Message 1 of 3
(2,841 Views)

Have you checked out the method in this forum post for reading from text files in TestStand?

Lindsey Nestor
Program Manager, Hardware Services
National Instruments
0 Kudos
Message 2 of 3
(2,803 Views)

Hey, thanks for replying. I did check that out but it didn't seem to work for me. Fortunately I was able to pass in the variable into command prompt so all is well 🙂

 

Thanks again.

0 Kudos
Message 3 of 3
(2,800 Views)