‎08-01-2012 04:06 PM
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!
Solved! Go to Solution.
‎08-01-2012 04:15 PM
Are you talking about having the same operating system? It sounds like you have two different operating systems.
‎08-01-2012 04:25 PM
The operating systems may or may not be same. How will it effect the byte order of the machine?
‎08-01-2012 04:54 PM
Is this a dll made using LabVIEW?
‎08-01-2012 06:33 PM
‎08-02-2012 07:18 AM
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.
‎08-02-2012 09:20 AM
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. 😄
‎08-06-2012 01:50 PM
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
‎08-07-2012 01:22 PM
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.