LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

detecting reference types and/or other inputs

Solved!
Go to solution

I have a situation where i want/need to detect what type of activex reference a particular reference is, and then output that reference type to another part of my code.  Is this possible?

 

I could/would also make great use of a bit of code that could detect what an input is.  By this i mean numbers (I8, U32, DBL, CXT.....), strings, references, paths, or boolean.  Is this also possible?

 

I realise that polymorphic VIs may be one answer, but i don't have the ability to create them.  Please, are there any other ways of achieving my aim(s)?

 

James



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 1 of 10
(4,457 Views)
Solution
Accepted by topic author J.Mamakos

The OpenG toolkit has a function called Get Type Enum from Data

 

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 10
(4,441 Views)
@James: I'm not sure how a bit of code that detects the datatype of numerics is going to help you with an ActiveX reference. These are totally different beasts. Exactly how were you intending to use the ability to determine whether an input is an I8 or a DBL to tell you what class an ActiveX reference is?
Message Edited by smercurio_fc on 05-27-2009 01:22 PM
0 Kudos
Message 3 of 10
(4,437 Views)

smercurio_fc wrote:
@James: I'm not sure how a bit of code that detects the datatype of numerics is going to help you with an ActiveX reference. These are totally different beasts. Exactly how were you intending to use the ability to determine whether an input is an I8 or a DBL to tell you what class an ActiveX reference is?

 

Sorry - these were two different questions, but i put them together since they are asking something similar only using different data types.


TonP wrote:

The OpenG toolkit has a function called Get Type Enum from Data


 

Thanks for that. I have the toolkit, but haven't found this VI.  Which section is it in?



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 4 of 10
(4,426 Views)

It's in the LVData palette:

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 10
(4,398 Views)
Thank you - just the thing i wanted. 🙂


Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 6 of 10
(4,384 Views)
Just another question - a slight extension of the first.  Is there any way of telling what a particular reference links to (programatically)?


Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 7 of 10
(4,377 Views)

James Mamakos wrote:
Just another question - a slight extension of the first.  Is there any way of telling what a particular reference links to (programatically)?

This has been brought up before, but no solution was ever found. 

0 Kudos
Message 8 of 10
(4,363 Views)
Darn!  Thank you for the link though.  No generic activex reference manipulation VIs for me then!  😞


Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 9 of 10
(4,356 Views)
That's not entirely true. While there is no silver bullet solution, as I pointed out in that thread, if you have the GUID of the class you can look it up in the registry to get the name. For LabVIEW 8.x the Flatten To String function can provide the GUID by making it operate like it did back in 7.x. This is done by right-clicking on it and selecting "Convert 7.x Data" (I think OpenG has an equivalent VI to provide this information). The GUID is in the type string array and you can look this up in the registry. Attached is an example. On the top-level VI I have 2 ActiveX references. One is for the MSXML Document class and the other is to an Excel application class. I have no idea if it will work in all cases.
Download All
0 Kudos
Message 10 of 10
(4,343 Views)