Binary representation of floating point numbers
Torsten Bronger
bronger at physik.rwth-aachen.de
Thu Dec 15 10:45:47 EST 2005
Hallöchen!
Sorry for the late response, but the subject didn't catch my
attention ...
Mike Meyer <mwm at mired.org> writes:
> 63q2o4i02 at sneakemail.com writes:
>
>> In float mode, the instrument returns a sequence of bits that are
>> exactly the ieee754 number in the case of floats, or just the
>> flags in the case of flags. PyVisa, when set to float mode, will
>> convert everything to float, because it is unaware apriori that
>> one of the fields returned is actually intended to be used as
>> binary flags.
>
> You need to get PyVisa to return strings of bytes to you.
PyVISA does so when calling the read_raw() method.
> [...]
>
> Struct is the right tool for the job.
Exactly.
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus ICQ 264-296-646
More information about the Python-list
mailing list