LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a cluster with array to a dll

Solved!
Go to solution

 

I am passing an structure to DLL and structure has an character array.

When it Calls dll function its taking address value of the array instead of value.

I tried converting array into cluster of size 1(In this example i m sending only one byte) and then swap bytes swap words.

and it is passed to DLL.But function call crashes.

 

Here i have attached actual problem VI(LVPassThruIoctl_fivebaudinit.vi) and the tried VI(LVPassThruIoctl_fivebaudinit_temp.vi).And header file.

 

Function prototype

PassThruIoctl(unsigned long ulChannelID,J2534IOCTLID enumIoctlID,void *pInput,void *pOutput);

 

Passing this structure

typedef struct

{

unsigned long ulNumOfBytes; // number of bytes in the array

unsigned char *pucBytePtr;    // array of bytes

}SBYTE_ARRAY;

Example:

No Of Bytes:1

BytePtr[0]=0x33

 

Please suggest me i am doing anything wrong here.

This problem i am getting in all functions.

 

0 Kudos
Message 11 of 13
(622 Views)

Please keep your related questions to one thread.  Thank you for finally posting the header file, but why not include it in the thread where you first asked for help?

0 Kudos
Message 12 of 13
(615 Views)

Since in this example I am sending cluster with array to a dll.So thought to post in this thread.

Thanks for your help.I will try with your solution.

0 Kudos
Message 13 of 13
(596 Views)