NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Open a .json file and store it in a string (Teststand)

Solved!
Go to solution

Hi everyone, 

 

does anybody know if it's possible to open a .json-file in Teststand and store the text in a string?

 

Thank you

Tobi

0 Kudos
Message 1 of 7
(1,682 Views)

You mean like a build in function?

0 Kudos
Message 2 of 7
(1,651 Views)

Yea, maybe a build in function or if not possible any workaround. Because I have a .json file with text in it and want to store it in a variable to search for specific words.

0 Kudos
Message 3 of 7
(1,639 Views)

I'd reccommend creating a code module returning the JSON string for storing in a variable.

 

Yet I don't recommend string parsing using TestStand string functions. You should use code moules for this as well!

0 Kudos
Message 4 of 7
(1,635 Views)

I have tried to inform myself about code modules but unfortunately have found very little. Does this mean the action step with which you can call python/.net/c++... scripts from the desktop, for example, or what exactly is a code module?

0 Kudos
Message 5 of 7
(1,621 Views)
Solution
Accepted by to0bi

You should've taken the course 😉

 

https://www.ni.com/docs/de-DE/bundle/teststand/page/code-modules.html  gives an introuction into the concept.

 

And there's lots of stuf to learn from in %teststandpublic%\Examples 

 

Basically, the whole architecture of TestStand relies on calling external code to perform tests, complex calculations, ...

 

As far as I remember your past postings, you used command line operations and evaluating stdout. Guess you have to take the next step now and go for a real programming language or Python 😉

 

P.S. you can do a certain amount of programming in TestStand, but it is no programming language itself

 

 

Message 6 of 7
(1,618 Views)

Hi Oli,

 

sorry for the late reply, I was pretty busy. 

 

Now I did it by implementing a python script.

 

Thank you 🙂 

0 Kudos
Message 7 of 7
(1,484 Views)