[SciPy-User] dtype of LabView binary files

LittleBigBrain braingateway@gmail....
Wed Nov 10 04:23:10 CST 2010


On Wed, Nov 10, 2010 at 5:08 AM, Christoph Gohlke <cgohlke@uci.edu> wrote:
>
>
> On 11/9/2010 2:34 PM, Xunchen Liu wrote:
>>
>> Hello,
>>
>> It seems there is only one web page here talking about the dtype of the
>> binary file saved from Labview:
>>
>> http://www.shocksolution.com/2008/06/25/reading-labview-binary-files-with-python/
>>
>> I followed Travis' suggestion on that page to convert one of my Labview
>> binary file using
>>
>> data=numpy.fromfile('name',dtype='>d')
>>
>> but this gives a array doubled the shape of my recorded data and also
>> the value of the data are not right.
>>
>> For example, the attached is the text file and binary file saved by Labview.
>>
>> the text file reads:
>>
>> array([-2332., -2420., -2460., ...,  1660.,  1788.,  1804.])
>>
>> while the binary file reads (with dtype='>d')
>>
>> array([-3.30078125,  0.        , -3.30297852, ...,  0. ,
>> -2.6953125 ,  0.        ])
>>
>> Anyone knows what dtype I should use, or how should I build the correct
>> dtype for it?
>>
>> Thanks a lot!
>>
>> Xunchen Liu
>>
>
> Those data are big Endian, 80-bit IEEE extended-precision numbers,
> flattened to 128-bit extended-precision in the binary file. Not sure
> if/how such data can be read into numpy without bit manipulations.
>
> <http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/how_labview_stores_data_in_memory/>
> <http://zone.ni.com/reference/en-XX/help/371361E-01/lvconcepts/flattened_data/>
You are probably right. He can use float128 in Labview, but I really
do not see the point, because most of the DAQ-boards just give 16bit
value top most... So he either change the Labview code or need to
check if his numpy build support float128,
unfortunately in windows  there is not float128 support. Maybe someone
can contribute a float128 routine for numpy ;>
>
> Christoph
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-User mailing list