LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build .exe with 32-Bit DLL for 64-Bit OS

Hello,

 

I have a LabVIEW project which uses a 32-Bit DLL.The DLL takes several arrays as inputs and return a 2D array (also the row and column information).

The project works fine within the 32-Bit LabVIEW.

 

However, when I run its application(exe) file on the Win7 64 Bit OS, the returned 2D array are all zeros.I tried to figure out the problem and logged the returned memory address, however the logged address looks quite different between the one logged when running in LabVIEW (e.g. 633906400,633906304,633906232,638672424,638671920...) and the one logged when running as .exe (41647056,41647032,41646792,41646720,41646816...). It is a superise for me the returned row and column numbers are exactly the same! This means the DLL actually is working but the dereferencing does not work?

 

I follow the instruction by NI (https://decibel.ni.com/content/docs/DOC-9080) and use the data type Signed Pointer-sized Integer, then manually dereference it according to (https://decibel.ni.com/content/docs/DOC-9091).

 

I checked other posts relating to this issue and found that the best is to use 64 Bit DLL with 64 Bit LabVIEW for 64 Bit OS. However, I am just wondering is it possible that in my case I made some mistakes with the dereferencing?

 

Thanks,

Sparkle

 

 

DLL.PNGDereference.PNG

0 Kudos
Message 1 of 4
(3,895 Views)

You are leaving out information.

 

For example, later, you mention 64bit LabVIEW but it seems you are building a 32bit application to be run on the 64bit OS. Is this correct?

You say it works fine with 32bit LabVIEW. What is the bitness of the OS during development?

 

 

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

Hello Bach,

 

In fact, the setup includes 32Bit DLL+LabVIEW  and 64 Bit OS. I know the soultion (best)  is changing all to 64 Bit and it will work. Sorry for the possible confusion. 

 

I am just wondering why 32 Bit DLL seems still work with EXE bulit by 32 Bit LabVIEW on the 64 Bit OS without any system warning. However, the returned 2D array pointer points to a memory area contains all Zeros. But the returned row and column numbers of the 2D array are correct. Is there anything I need to be noticed when dereferencing a pointer on a 64 Bit system rather than on a 32 Bit system. (Sorry,my background is in mechanical engineering).

 

Thanks.

Sparkle

0 Kudos
Message 3 of 4
(3,864 Views)

Does the built executable work on the machine used to develop the code?

Maybe the dll depends on other dlls that are not present on the other machine?

What are the "error checking" settings in the dll setup?

0 Kudos
Message 4 of 4
(3,861 Views)