LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My LV6.001 crashed if i use the com by variant array why did?

My LV6.001 crashed if i use the com by variant array (Invoke Node output is 2D Array Byte) why did?
If used VBASIC the function run but no error?
The Obejct Modul where i use is written in Vcpp!
0 Kudos
Message 1 of 6
(2,904 Views)
You may want to see if the 6.0.2 update fixes this issue.

http://digital.ni.com/softlib.nsf/display?ReadForm&lookup=LabVIEW&view=current&node=132060_US
0 Kudos
Message 2 of 6
(2,904 Views)
Oh sorry i have update by CD now on LV 6.0.2 so its the same result ?
0 Kudos
Message 3 of 6
(2,904 Views)
I'm not sure I quite understand the problem you are having. It seems that you are trying to use a COM (activeX) invoke node to either input or output a 2D byte array. Does the crash happen when passing data to the COM object or when passing data into LabVIEW? Is this a com object you created yourself, or a common object that we can look at? Is there anything special about the datatype?; For instance, is it a safearray?
0 Kudos
Message 4 of 6
(2,904 Views)
Its happen if i try to pass datta (transfer COM acticeX) as safearray 2D (Type *CHAR / U BYTE) to LV6.02 from objekt-modul that is writte in Vcpp the common objekt is tested by VBASIC and DELPHI. The objekt modul is a commercial mikroskop control- programm whit dongel so i cant given it to you. I give in the attachment my LV programm. So i hoppe you can help me. Best regards r.rygiel
0 Kudos
Message 5 of 6
(2,904 Views)
A safearray is actually a structure with more in it than just the data. I think (heard but never tried) that to properly extract the data in a safe array, you have to duplicate the structure of the safearray with a cluster. The structure of the safe array is:

typedef struct tagSAFEARRAY
{
USHORT cDims;
USHORT fFeatures;
ULONG cbElements;
ULONG cLocks;
PVOID pvData;
SAFEARRAYBOUND rgsabound[ 1 ];
} SAFEARRAY;

A USHORT is an unsigned short (U8), and ULONG is unsigned long (U32) and PVOID is a pointer to the data and SAFEARRAYBOUND is another cluster with this structure:

typedef struct tagSAFEARRAYBOUND
{
ULONG cElements;
LONG lLbound;
} SAFEARRAYBOUND;

Here's a web page that describes all the different parameters:

http://ms
dn.microsoft.com/library/wcedoc/wcemfc/struct_25.htm

If this is too difficult, you might have to design a function in C code to extract the data. I wouldn't expect LabVIEW to crash for not converting the data correctly. I'd think that the Variant to G VI would just not return anything, but I suppose stranger things have happened. All the same, you might want to try just wiring the data from the method to a variant indicator and see if it still crashes. If it does, no point in messing around with the safearray structure stuff.
0 Kudos
Message 6 of 6
(2,904 Views)