NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the type version of a custom data type programmatically

Solved!
Go to solution

Hi,

I have created a new custom data type and now I am wondering if it is possible to get its Version programmatically.

I am using this custom data type as a result container and I want to store the Version of the data type as a string inside itself. I want to use this as a version control.

lwi94_1-1675501217951.png

In my sequence I have created a container in FileGlobals named Result. I have found the option of getting the TypeVersion of a propertyobject but I couldn't get it work this way:

FileGlobals.Result.Version = FileGlobals.Result.AsPropertyObject.TypeVersion

 

Is there a way to do this?

 

Thanks in advance! Any help appreciated.

 

0 Kudos
Message 1 of 3
(1,166 Views)
Solution
Accepted by topic author lwi94

Hi  lwi94

 

I help you try it 30 mins to get answer. 

When you creat a custimized container and have it's name.

 

螢幕擷取畫面 2023-02-06 104207.png

Then ues statement "RunState.Engine.GetTypeDefinition("XXXXX").TypeVersion" to get the version

XXXXX means your container's name.

 

螢幕擷取畫面 2023-02-06 104257.png

 

 

Thanks,

Ricky

 

Message 2 of 3
(1,100 Views)

Hi Ricky_76,

thank you so much for your help, it works perfectly.

0 Kudos
Message 3 of 3
(1,078 Views)