LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting TI floating point format to IEEE

I've created a VI that converts TI floating point numbers into IEEE floating point format, and I'm looking for some extra eyes on it to see if I've made an error I didn't catch.

 

I used the information that can be found in the TMS320C3x User's Guide this link, in section 5. While my VI does not perform a bit-wise conversion exactly, I do end up with proper numbers. I do not handle the infinity cases.

 

The VI takes a string input which is data read from a serial port and an offset into that string that points to the 4 bytes of TI floating point data.

 

Anyway, please take a look and give me feedback Smiley Very Happy

 

Message 1 of 10
(5,582 Views)

The conversion looks about right with the proviso about not handleing infinitys (looks like an easy fix to implement).  Some VI documentation would help the vi.  also- SHOW the radix of your BD constants and use a consistant radix on your integers those decimal constants would actually make more sense in hex.  Add lables to the constants too and cut and paste the TI format info into a free lable to prevent the need to open a largeish PDF to examine two paragraphs.

 

Nice little utility.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 10
(5,579 Views)

A couple of things could be simplified dramatically. For example the index array function at the beginning could be resized to four outputs, with the offset wired to the first index and the remaining three left unwired. I see a few other overcomplications....

 

(Why not cast ot to U32 and do some bit manipulations before casting to SGL, for example?)

 

I'll look at it later. 

0 Kudos
Message 3 of 10
(5,568 Views)

My VI above has a flaw in handling negative numbers. I sure hope no one has started using it! Should I simply remove the thread? Can I even do that?

0 Kudos
Message 4 of 10
(5,542 Views)

@Xooch wrote:

My VI above has a flaw in handling negative numbers. I sure hope no one has started using it! Should I simply remove the thread? Can I even do that?


No- Its a work in progress- declair the limitation and see what can be done to fix it.  we'll keep you honest


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 10
(5,540 Views)

I am not able to execute the VI whatever you have posted. That VI is in 2011 format and if down-converted to 2009 am getting an error that RD Library.lvlib is missing. Can you post same code in 2009 format.

 

Thanks and Regards,

Ratheendiranaath B.R.

Larsen & Toubro Ltd.,

Mysore

0 Kudos
Message 6 of 10
(5,452 Views)

Hi Rathi,

 

copy the entire block diagram and paste it in a new VI. Save the new VI to any location you want...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 10
(5,442 Views)

Ya i did the same already. Anyhow thanks

0 Kudos
Message 8 of 10
(5,438 Views)

I saw some activity on this thread and wanted to let everyone know I never worked on this VI again... So, it is what it is.

 

I ended up using a C++ routine from another piece of software we use that's built into a DLL to do the conversion. The routine originally came from a TI manual.

0 Kudos
Message 9 of 10
(5,426 Views)

I Like picking up old threads, but I took a look at the version you provided and found it a little wanting, I wonder about the overall accuracy though because it was transformed directly into a double. I don't have access to a method that would validate the outputs of this vi.  I just used the TI references The VI has the reference document sections that were used baked into it which made it a bit larger. 

I based a version off of http://www.ti.com/lit/an/spra400/spra400.pdf

I wasn't easy and I had some issues with the logic provided not making sense (MANT0 seemed like it needed to be inverted).

and it seemed to match the results that I got with the version I based on: http://www.ti.com/lit/ug/spru031f/spru031f.pdf

which is great. since it was the more efficient of the two representations. I did use a helper vi but it could be removed and replaced to increase performance. Mostly I was trying to match the documentation as much as possible.

Let me know if there are any errors. 

 

0 Kudos
Message 10 of 10
(3,432 Views)