08-26-2008 12:32 PM
I would like to read the 'Edit --> Sequences Properties --> version' in order to write it in my final report (which I generate).
I tried to locate it under RunState.SequenceFile, but didn't see it. Can anybody help?
Thansks
Rafi
08-26-2008 12:41 PM
Hi Rafi,
You must first convert it to a PropertyObjectFile. So once you have a reference to the sequence file then call the AsPropertyObjectFile method. It returns a PropertyObjectFile reference. Then use that to get the Version property.
Hope that helps,
08-27-2008 06:21 AM
Thanks jigg
"...convert it to a PropertyObjectFile....". To convert what? and how? please specify, because I have no idea what you're talking about.....
Isn't that value simply exist someplace in the context?
Thanks
Rafi
08-27-2008 07:24 AM
Hi Rafi,
Jigg is referring to the PropertyObjectFile class in the TestStand API. The SequenceFile class inherits from the PropertyObjectFile class, but the PropertyObjectFile class has it's own individual methods and properties. One of these properties is the file version. So to obtain the version of the file, we must first convert (go up the hierarchy in a sense) to obtain the property. The actual expression will look something like this:
RunState.SequenceFile.AsPropertyObjectFile.Version
Hope this helps!
08-27-2008 11:06 AM
Hi Matt,
1) I understand that I need to use an ActivX step in order to achieve this data. Am I right, or is there another way?
2) I have tried to assemble an ActiveX step (which I have no experience what's so ever....) and I did the following:
created a local.FileVersionRef of type object
In the ActiveX I set the following:
Object Reference : RunState.SequenceFile
Automation Server: NI TestStand API 3.5
Object Calss: PropertyObjectFile
Action: Call Method
Method: AsPropertyObject
ReturnValue: Locals.FileVersionRef
As a result of this I got some data in the local.FileVersionRef.
What exactly did I get?
What do I do next in order to achieve the version?
Thanks
Rafi
08-27-2008 11:18 AM - edited 08-27-2008 11:20 AM
Hi Rafi,
What version of TS are you using? If you are using 3.5 then you do need to use the ActiveX steps. In 4.0 and later you don't. You can just use the expression RunState.SequenceFile.AsPropertyObjectFile.Version
If you need to use the ActiveX steps then you will need to do it in two steps.
Step1:
Automation Server: NI TestStand API 3.5
Object Reference: RunState.SequenceFile
Object Class: SequenceFile
Action: Call Method
Method: AsPropertyObjectFile
ReturnValue: Locals.ObjFile (a local that is of type object)
Step2:
Automation Server: NI TestStand API 3.5
Object Reference: Locals.ObjFile (from step1)
Object Class: PropertyObjectFile
Action: GetProperty
Property: Version
Return Value: Locals.Version (a local that is of type String)
Let me know if you have more questions.
08-27-2008 11:26 AM
08-27-2008 11:47 AM
OK OK So you can do it without ActiveX steps. Just call RunState.SequenceFile.Data.Version. That is the lookup string. It may not exist except at runtime so if you get an error when entering it then ignore the error.
Regards,