10-31-2011 06:53 PM
I need to be able to determine, preferably without relying on conditional disable symbols, whether the system on which a VI is run uses big-endian byte order. What I came up with was to flatten a U32 containing 0xDDCCBBAA to string using the unknown system byte order, and unflatten using a big-endian byte order. If the pre- and post-flattening U32's are equal, the system must be use big-endian byte order. Two questions:
1. Will this work? It recognizes, correctly, that my PC does not use big-endian byte order, but I don't have any big-endian targets to test it out on (see #3).
2. Is there a better way? Perhaps something already built into LabVIEW?
3. Would somebody with a big-endian target verify that my VI detects it as big-endian?
Thanks,
Mark Moss
11-01-2011 03:56 AM
How about a simple OS.Name property node?
11-01-2011 08:05 AM
Take a look at this example
C:\Program Files\National Instruments\LabVIEW xxxx\vi.lib\Utility\sysinfo.llb\Get Current Platform.vi

11-01-2011 08:06 AM
You can simplify your VI a little. Since you know what the result of the string flattening should be in big endian, just compare the string.
11-01-2011 08:12 AM
The issue with using the OS Name or Platform is you have to keep track of endian order per platform. I don't know enough about Macs, but they seem to be able to run as either right now.
I think the test is the simplest, and ultimately the safest, method to find this out.