LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Variant Arrays to An Active X Component

Hi all,
Here is what I am doing, and here is what is happening. Let me explain.

Within Labview I am using an ActiveX component that I made. I need the Labview application to pass the ActiveX control a VARIANT ARRAY. I can easily send a single Variant without a worry. The ActiveX method recieves the Variant no problem.

Here is the problem...

I am taking Data from a DB source using the "DB Tools Select Data" widget. The help file says that the widget will output a " 2-D array of variants." - so I pass this output into the input of my ActiveX method.

My ActiveX component does receieve the Array, and it has the correct dimensions, but the .vt attribute in all the elements is set to "0" (VT_EMPTY). Within lab
view I check to see that there is legitamite data, and sure enough there is.

So the question is:
How do I pass VT_ARRAY|VT_VARIANT Variant from labview to an ActiveX control? Is there another method to do this? Help!

Thanks In Advance,
Jt
0 Kudos
Message 1 of 5
(3,002 Views)
What are you trying to talk to using ActiveX? I recently discovered a problem related to the ADO AddNew method. The problem there was that the input needs to be a safearray, and V6.1 doesn't apparently handle passing safearrays to invoke nodes as well as it might. Might be the same issue...

In any case, NI said that the problem is fixed in V7.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(3,002 Views)
Hi Mike et all,

I am passing the 2D array of Variants, the output from the "DB Tools Select Data" to be exact, which contains record data from a JET DB, and I am passing the data directly to an ActiveX method call object which is calling a method in the ActiveX control that takes a variant as a parameter. I have tested this within VB, I created a freakish variant which contained arrays of variants, and the data passes fine. Regrettably, when using the control in Labview in the above described manner, and then monitoring the passed in VARIANT I see that the VAriant does have dimensions, but ALL of the VT atributes read "VT_EMPTY".

This certainly might be the SAFEARRAY issue that you speak of, as we are using labview 6.1. Can anyone refer me to the bug repo
rt that talks of this Safearray issue?

Thanks all,

Jt
0 Kudos
Message 3 of 5
(3,002 Views)
This may be the issue that mike is refering to:

"Error -2146825023 When Passing an Array into an ADO Recordset Via the AddNew method"

http://ae.natinst.com/operations/ae/public.nsf/fca7838c4500dc10862567a100753500/d2324d3e4eb763b586256d24006feb36?OpenDocument
0 Kudos
Message 4 of 5
(3,002 Views)
Well there is a recent KnowledgeBase entry that talks about something similar, but it says the workaround is to pass a array of variants--which also doesn't work. Beyond that I don't know if NI has this documented anywhere else.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 5
(3,002 Views)