LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Will this work to determine the system byte order?

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

0 Kudos
Message 1 of 5
(3,019 Views)

How about a simple OS.Name property node?

0 Kudos
Message 2 of 5
(3,002 Views)

Take a look at this example

C:\Program Files\National Instruments\LabVIEW xxxx\vi.lib\Utility\sysinfo.llb\Get Current Platform.vi

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 5
(2,975 Views)

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.

 

 

 

ScreenHunter_01 Nov. 01 09.04.jpg

0 Kudos
Message 4 of 5
(2,975 Views)

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.

0 Kudos
Message 5 of 5
(2,973 Views)