From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem in calling DLLs with complex structure

When I use dll to generate the VI. Some VIs including complex structure can not be created. As the picture below shows

0.png

 

This VI including cluster, so I create a custom control, and access to the control when caling dll,

1.png

2.png

 

 

then the VI generated but can not be executed,

 

 

3.png

 

4.png

 

it shows that the data type is different from cluster, then I change the data type

 

4.png

6.png

 

Now the VI has no error,

 

7.png

But when I run the VI, it shows that when it input the data from cluster, there will be an error number,

 

8.png

 

But when I delete the cluster and change to the numeric data, It reads only the first 3 input value and recognize as NodeId, SlotId and Inputstate, the digital input IO number can not be read.

 

9.png

 

 

So I want to know what problem it has? Because I can not understand this case.

0 Kudos
Message 1 of 2
(1,997 Views)

The last option (using 4 parameters instead of 3) appears to be the correct configuration, because the DLL expects that you will pass a struct by value. Try making the enums 16-bit values, instead of 32-bit. If that doesn't work, you could also try configuring the call for 3 parameters, and pass a single 32-bit value that is the result of joining the two 16-bit enums.

0 Kudos
Message 2 of 2
(1,962 Views)