LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CALL dll STRUCT

I have a dll,Function parameter define as follow

 

typedef struct 
{
uint32_t LocId;
uint32_t EESize;

uint8_t SerialNumber[64];
uint8_t Description[4096];
const char* FileInfo;
} IoData_t;

 

I try the attach picture method, at run program then labview crash.

what can I do for solve this probram

Looking forward to your advice, thanks!!!!

0 Kudos
Message 1 of 4
(2,476 Views)

I suspect you need to allocate the memory for the const char* FileInfo parameter. At the moment you're passing in a value of 0. The dll function will then try to de-refence that (invalid) memory location, causing the crash. Instead you should allocate some memory and pass that into the function for the FileInfo parameter. See this knowledge base article (under the Additional Information section) for details: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P6tcSAC




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 2 of 4
(2,451 Views)

Thanks!!!

my problem is the struct's array

dll function declaration

   uint8_t SerialNumber[64]
   uint8_t Description[4096]
In labview I try use U8 array and size is 64, U8 array and size is 4096,then labview crash

In labview I try use cluster include 64 u8 element, cluster include 4096 u8 element then labview could run and receive dll's result

but use cluster include 4096 u8 element is very hard, so use array in cluster can complete this work?

 


0 Kudos
Message 3 of 4
(2,444 Views)

but use cluster include 4096 u8 element is very hard

Why?

 

George Zou
0 Kudos
Message 4 of 4
(2,437 Views)