NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read Sequence File Version?

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

0 Kudos
Message 1 of 8
(5,117 Views)

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,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 8
(5,116 Views)

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

0 Kudos
Message 3 of 8
(5,090 Views)

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!

Matt S
National Instruments
Applications Engineer
0 Kudos
Message 4 of 8
(5,079 Views)

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

0 Kudos
Message 5 of 8
(5,070 Views)

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. 

 

Message Edited by ~jiggawax~ on 08-27-2008 11:20 AM
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 8
(5,064 Views)
Here's a simple example. 
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 7 of 8
(5,058 Views)

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,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 8 of 8
(5,052 Views)