From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert project item type string to type GUID

Hi all,

 

Is there a generic way of getting the type GUID associated to a project item type string ?

Also, I don't necessarily have an instance of the project item in my project, so I cannot use directly the ProjectItem property "Type GUID".

 

Example:

"Elemental IO"          gives  "{A117026A-AD51-4C63-8341-085C842E9D22}"

"Library"                    gives  "{ABC740D6-F254-4BBC-5675-8858F35B820E}"

"FPGA Base Clock"  gives  "{EF04866F-AE99-4C3F-B28B-879B709E5BBE}"

 

Second question to go further:

Are the type GUIDs always the same for a given type string ? Or is it dependent from projects or LV versions ?

For example, will items of type string "Elemental IO" ALWAYS have a type GUID of "{A117026A-AD51-4C63-8341-085C842E9D22}" ?

If the answer is yes, I could definitely have an hardcoded conversion table and the problem would be solved 😅.

 

Thanks.

0 Kudos
Message 1 of 2
(501 Views)
@raphschru wrote:

Hi all,

 

Is there a generic way of getting the type GUID associated to a project item type string ?

Also, I don't necessarily have an instance of the project item in my project, so I cannot use directly the ProjectItem property "Type GUID".

 

Example:

"Elemental IO"          gives  "{A117026A-AD51-4C63-8341-085C842E9D22}"

"Library"                    gives  "{ABC740D6-F254-4BBC-5675-8858F35B820E}"

"FPGA Base Clock"  gives  "{EF04866F-AE99-4C3F-B28B-879B709E5BBE}"


Not that I know of.

 

You can use ProjectItem - LabVIEW Wiki, and indeed make a lookup VI...

 


@raphschru wrote:

Second question to go further:

Are the type GUIDs always the same for a given type string ? Or is it dependent from projects or LV versions ?

For example, will items of type string "Elemental IO" ALWAYS have a type GUID of "{A117026A-AD51-4C63-8341-085C842E9D22}" ?

If the answer is yes, I could definitely have an hardcoded conversion table and the problem would be solved 😅.


The GUIDs seem to be stable across version. These GUID serve a purpose, and it would be inconvenient for everybody including NI to change them. There's no guarantee though. If this is a good reason for NI to change them, they will change.

 

Even if those GUIDs change in a future version, you can make a hardcoded conversion table. That would solve the problem. If they change, you can use a conditional disabled structure to make the table version sensitive.

Message 2 of 2
(483 Views)