NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

PropertyObjectFile Examples

Anybody have examples on interacting with the PropertyObjectFile?  I'd like to be able to read/write custom files that could vary with PropertyObjects.  For example, I might want to store an array of string objects in one file and an integer and boolean property in another.  

 

Thanks

0 Kudos
Message 1 of 4
(1,380 Views)

PO Files, as I call them, are basically taking a property object in TestStand and storing it to an ini formatted file.  You can read/write any PO in TestStand... and basically everything in TestStand (except for the Engine) is a PO.  

 

So when you say you want to store arrays of strings or discrete values into a PO file are you assuming then that you have a local or fileglobal variable that you are storing off to a PO file and then reading back in to that local or fileglobal during execution?

 

Way back in the day we used to us PO files for a large datatype that we would use to drive our test.  It worked great until we had to change the datatype.... that's where the issues began.  Basically, if you change the datatype then you try to read in the PO files it won't work because it doesn't match up properly.  Then your PO file is useless basically.  And if you have 180 of these things then it becomes a nightmare.  Then you revert to 3rd party ascii editors like beyond compare and notepad++ to push data type changes to all of the files.

 

However, if you are just doing native data types or discrete datatypes then you should be fine.

 

Just remember....only one PO per file.

 

If you had a specific use case I could help you more.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 4
(1,359 Views)

Thanks jiggawax for reaching out.

 

I'm mainly just learning the basics now, so basically trying to understand how to interact with the PO Files.  Nothing too specific as of now.

 

If you could provide an example that would be great.  Use the SearchDirectory config file for example.  Understanding you can interact with the data via the engine, this file might be a good example to see the text format and see how it is read/written to/from objects.  An example of the Locals and FileGlobals as you mentioned might be helpful, as well.

 

.NET examples would be great, but if you have something else... I could probably understand the logic.

 

Thanks again.

0 Kudos
Message 3 of 4
(1,354 Views)

Good answer, I'd just add, in case someone else finds this thread, that you can use PropertyObjectFile.FileWritingFormat to also get Binary (fastest, smallest) or XML (most readable, diffable) formats and that you can write multiple objects if you make them, or their clones, children of PropertyObjectFile.Data.  I think you can probably also use PropertyObjectFile.HandleTypeConflicts to resolve differences in data types.

0 Kudos
Message 4 of 4
(1,348 Views)