LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OLE Variant Control: Is it Practically Useless?

I have an interesting observation (or problem) concerning the OLE
Variant Control. I have written some code that includes reading and
writing a cluster to the DataSocket. I found an advanced datasocket VI
called "DataSocket Write Variant" which uses the OLE Variant on its
front panel to pass data to the "value" property. Interestingly, the
OLE Variant control will accept no data wired to it except that of the
OLE variant type, while the property node that requires OLE Variant
data coerces just about anything.

Since the OLE Variant control does not coerce datatypes the way a
property node does, and there seems to be no function for type-casting
a datatype to OLE Variant type (the "typecast" function does ac
cept the
OLE Variant at the "type" input), is the OLE Variant control
practically useless? I have used it for providing "dummy" values to
methods that produce errors without inputs at some of there parameters,
but that's about it.

I got around my DataSocket app problem by not using the "DataSocket
Write Variant" VI and instead just unbundling the DataSocket session
and using the property node to wire my cluster directly to the "value"
property. But what if I wanted to write a large reusable subVI that
would accept any data type? Why does a Variant property node input
coerce data types and not Variant control? Unless I am missing
something obvious (and please let me know if I am), the OLE Variant
Control is useless as an input to subVI's.


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
0 Kudos
Message 1 of 1
(2,616 Views)