NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

sequence file version

How do you access the sequence file version you are running, for purposes of reporting. This will also be compared with a value that should be run. If a change has been made to the sequence file without being saved is it possible to access this to?
0 Kudos
Message 1 of 4
(3,296 Views)
Yes,
It is possible to access it.
From the sequence context get the reference to the "Sequence File" than use invoke node to get reference to as a "property object file" then using the property node get the v"ersion".
I have the code for this let me know if you want it.

Thanks,
Naresh
0 Kudos
Message 2 of 4
(3,296 Views)
Hi ADL,
You can obtain a reference to the sequence file that is being executed from your SequenceContext. You can use the property RunState.SequenceFile for this purpose. Once you have that reference, you can call the method AsPropertyObjectFile to change your reference to a PropertyObjectFile reference. Once you have the second reference, you can call the method Version; this method returns the version of your file as a string. I have attached a sample sequence that implements this procedure.
Best regards,
Diego F. Reyes
Applications Engineer
National Instruments
0 Kudos
Message 3 of 4
(3,296 Views)
ADL -
In addition to the PropertyObjectFile.Version property on the class, you can use PropertyObjectFile.IsModified and PropertyObjectFile.IsModifiedByUser to determine if the sequence file was altered. Keep in mind that alterations of a sequence file are only know by TestStand if the component that alters the file calls PropertyObjectFile.IncChangeCount. The Sequence Editor always does this when it make an edit to the file.

As far as placing this information in a report, the information in a SequenceCall step result does not contain a direct reference to the file object, but it does have the name of the sequence and its path. You would have to call Engine.GetSequenceFileEx using the path and I recommend using the etSeqFile_DoNotRunLoadCallb
ack option, get the above required information, and then call Engine.ReleaseSequenceFileEx using the ReleaseSeqFile_DoNotRunUnloadCallback option. The two options prevent the load/unload callbacks from running just in case the file is not currently in memory. It is likely to be in memory.

Scott Richardson (NI)
Scott Richardson
https://testeract.com
0 Kudos
Message 4 of 4
(3,296 Views)