LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow imc COM (ActiveX)-libraries inside LabView

Hi
I'm using the imc COM (ActiveX)-libraries inside labview. The key command is the "automation open" block from LabView and selecting the desired ActiveX class.
 
Here his the definition of one of this function:
Function DChannel.GetDataDoubleStartIndex As Long, Count As Long,
                Data As Double() ) As Long

Copies the specified samples in an array of 8Byte real numbers.

Parameters

StartIndex

Index of the 1st sample to copy. The first sample in a channel has an index of 1.

Count

Number of samples to copy.

Data

Array to receive the values. See remarks section.

Return Value

Number of valid samples in <Data>. May be smaller than <count>, when there are not enough samples in the channel (StartIndex + Count -1 > Length).

The problem and also question is why the parameter Data apears as a variant when I use a invoke node for the above method (should be double()??)

When using large Data arrays the libraries are very slow in comparison with VB6. I tested the same functions in VB6 and LabView. In VB6 the COM libraries are very fast! Does anybody know how to improve performance with COM Variants?

Thank you

 

 

 

0 Kudos
Message 1 of 2
(3,017 Views)
I'm not sure you can do anything about the speed as long as you use ActiveX. At least that was the answer I got when I asked a similar question here. It seems that there is a lot of data copying between memory spaces that goes on between ActiveX and LabVIEW and, if there is much data involved, it can take a while. Search these forums for the terms safearray or "safe array" or marshal data and you will find more info on what you are up against.
0 Kudos
Message 2 of 2
(2,969 Views)