LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read cluster of array from a c++ dll through postLv user event

Hi all,

Here is my problem.

I have a c++ dll that I call with Labview thanks to CLF node and postLv user event. It works fine.

Now, I'd like the DLL to send to Labview a cluster of array through the postLv user event but I failed at doing it, getting a 1097 error.

I'm aware that this error refers to a memory allocation problem of the arrays in my cluster. But i don't know where I have to set the size of the arrays (in the dll or in labview).

I attached some pictures:

- ReadEvent.png is the vi that init the cluster and the user event, calls the dll and get the data from dll through the postLv user event

- CLF_node.png is the configuration of the CLF node where i called the function of the dll

- Struct.png is the creation of the cluster in the dll code

- init.png is the function in the dll posting the cluster to labview through user event

 

Thanks for your help.

 

PS: Sorry for the labview vi, its a fast made test vi so its not well coded 

 

Download All
0 Kudos
Message 1 of 4
(2,693 Views)

up!

0 Kudos
Message 2 of 4
(2,652 Views)

Don't post pictures of your code, post actual code, then you're much more likely to get help.

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

It's not clear if your LabVIEW cluster is compatible with your stest structure. To match the struct, the LabVIEW cluster needs to contain clusters (not arrays) that have the same number of elements as the fixed-size arrays in the struct. You might also need to add some padding elements to the cluster to match the struct alignment. As was previously suggested, posting the actual code would make it much easier to help.

0 Kudos
Message 4 of 4
(2,617 Views)