LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

byte order of dll

Solved!
Go to solution

Hi All,

I have a very general question regarding to the byte order of a dll.

I have a dll which was compiled on a little endian machine. I want to use that dll in my application and my machine is big endian. So, in my application, before sending the data to the dll, do I have to convert that data to little endian?

 

Thanks!

0 Kudos
Message 1 of 9
(4,167 Views)

Are you talking about having the same operating system? It sounds like you have two different operating systems.

0 Kudos
Message 2 of 9
(4,163 Views)

The operating systems may or may not be same. How will it effect the byte order of the machine?

0 Kudos
Message 3 of 9
(4,158 Views)

Is this a dll made using LabVIEW?

0 Kudos
Message 4 of 9
(4,154 Views)
No, its made using Visual Studio 2010
0 Kudos
Message 5 of 9
(4,144 Views)

Well, the bottom line is that you have to provide the data in the format that's expected. If the DLL expects little-endian, then you have to make sure the data you pass to it is in little-endian format.

0 Kudos
Message 6 of 9
(4,129 Views)
Solution
Accepted by topic author LVCoder

Do you know what kind of outputs are exepcted based on typical inputs?

 

Even without overthinking things, you have a 50% chance to get it right on the first try and a 100% chance to get it right on the second try. Why not simply try both? Would probably get you a faster result than the time it took to wait for answers here. 😄

0 Kudos
Message 7 of 9
(4,118 Views)

Thanks alten!

I was using a third party dll, so I had problems figuring out the byte order. I called the support of that company and got it work.

 

Thanks,

Ritesh

0 Kudos
Message 8 of 9
(4,083 Views)

A DLL doesn't have a prefered byte order, the CPU it was compiled for does. And since all x86 are little endian it is only logical that your DLL is actually little endian and that is also the same format LabVIEW uses on x86. Only on PPC and 68K systems did LabVIEW use Big Endian which is the prefered format for those CPUs but these do not play any role anymore except for the PPC based cRIO systems and Smart Camera systems LabVIEW can target. For desktop systems, every platform LabVIEW runs nowadays on is x86 based and therefore little endian.

 

LabVIEW does use Big Endian format for its flattened data and this format is used when you flatten data to a file or string, or when LabVIEW communicates with a different LabVIEW system through the network, but LabVIEW uses in memory whatever format the actual CPU prefers. And since the DLL calling interface is working on the same system it also uses little endian for calling DLLs.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 9 of 9
(4,063 Views)