comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Unpacking packed BCD in Ionosonde SAO files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Unpacking packed BCD in Ionosonde SAO files [message #54481] Wed, 13 June 2007 01:23
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Andrew Cool <andrew.cool@dsto.defence.gov.au> writes:
> Hi All,
>
> Does anyone have an existing routine to unpack
> packed BCD (Binary Code Decimal) data?

I would probably do something like this,
n_digits = number of digits in input
bcd = binary coded decimal value

fact = 1L
dec = 0L
for i = 0, n_digits-1 do begin
dec = dec + (bcd AND '0f'xl)*fact
bcd = ishft(bcd,-4)
fact = fact * 10L
endfor

The output is the DEC variable. The code has a loop, but it only does
a few iterations, and is fast even if BCD is an array.

> If you've got a routine to decipher ionosonde SAO (Standard
> Archiving Output) files, that'd be even better!! ;-)

Sorry, can't help you there, but I do have telemetry extraction
routines for bit-packed values, if that's what you need.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Unpacking packed BCD in Ionosonde SAO files
Next Topic: widen the edge

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 22:33:06 PDT 2025

Total time taken to generate the page: 0.39653 seconds