NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Write UUT Serial Number scanned at beginning of test sequence to a text file

Is there a way to get the Serial Number string / value that every default test stand sequence scans and store it to a text file? What variable / parameter is that scanned value even stored in? 

 

I tried using a Call Executable function like in the screenshot attached. But whenever I go to that output file, it is blank. Am I calling the wrong parameter? 

 

 

0 Kudos
Message 1 of 9
(1,190 Views)

Think you are missing the redirection of the echo command to the file

 

echo somtehing > test.txt

0 Kudos
Message 2 of 9
(1,111 Views)

Do you happen to know if that parameter of "Runstate.Root.Locals.UUT.SerialNumber" is the correct parameter to pull this data from? I fixed the echo command by adding > and I even tried >> to just have it overwrite whatever is in the test.txt file. But nothing is still written to that file. 

0 Kudos
Message 3 of 9
(1,098 Views)

Does the Write to file operation work with a constant string?

 

RunState.Root.Locals.UUT.SerialNumber is correct, yet it is only existing when the process model is run

0 Kudos
Message 4 of 9
(1,094 Views)

I tried to just put in "hello" as a string in that command and nothing got written to the test.txt file.

0 Kudos
Message 5 of 9
(1,083 Views)

I am confirming this behaviour ☹️

 

I could get a file created when redirecting STDOUT to the file. Yet the file seems to get overwritten each time, so no appending

0 Kudos
Message 6 of 9
(1,079 Views)

This attached picture allowed me to print the string "test" into the test.txt file I had on my desktop. 

 

Now just need to get this to work on actually pulling the UUT serial number during runtime to get that recorded into a .txt file.

0 Kudos
Message 7 of 9
(1,071 Views)

I had tried the \\ as well but failed, seems I still made another mistake

 

Suggesting another solution: have you considered using a data stream step type to write in a kind of nicely formatted csv File?

 

 

 

0 Kudos
Message 8 of 9
(1,054 Views)

I will have to try this. My concern is that I cannot pull the UUT serial number into any file (whether .txt like I am attempting now, or via a .csv data stream) as I cannot find the Runtime variable that it gets stored to. But will need to at least try to see what I get. 

0 Kudos
Message 9 of 9
(1,018 Views)