LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pass a pointer to an array from Labview to OCX (activex)

I am trying to pass an array of interegers to the ocx (activex) using a pointer or a handle. How do I do that?
Should I create DLL first, or can I use existing ocx with some additional functions?

I don't have any experience with this kind of programming, please help ...
0 Kudos
Message 1 of 4
(3,139 Views)
Hi,

You can put an ActiveX Container on your front panel that contains the OCX object. Now on your block diagram, use Automation Open function (All Functions>>Communication>>ActiveX)to get an ActiveX refnum to this object. Wire this to a property node/invoke node (also found in the same palette). The object should have some property /method like 'set value' that would let you wire in an integer array to it (you might need to convert the array to a variant first).

I hope it'll help.

Ankita A.
0 Kudos
Message 2 of 4
(3,123 Views)
Hi Ankita,

thank you for helping.

I tried what you suggested. I have a "Write Block to..." method that uses the pointer to array input. If I connect array, or array transfered to variant, into this input - I get an error. Obviously, I have to give it a real pointer, not a variant or array.

Any other suggestion?
0 Kudos
Message 3 of 4
(3,112 Views)
Hi Vlade,

I guess then the other option would be to write a dll that takes in the array as input. Within the dll, you would need to access the ActiveX control.

Hope this helps.

Ankita
0 Kudos
Message 4 of 4
(3,094 Views)