From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting 4 bytes to float

Solved!
Go to solution

Wow, I must be onest. I didn't expect solving of my problem so fast.

 

Many thanks to crossrulz. His vi works 100% correct.

 

Regards to all!

 

Vlado

0 Kudos
Message 11 of 18
(2,269 Views)

Back again.

This time I need help with oposite conversion from float to 4 byte array.

It should be used Microchip conversion where from MSB side eight bits are used for exponent, then one bit for sign and rest of 23 bits for mantissa.

So question, how to modify attached example to get desired result?

 

Regards, Vlado

0 Kudos
Message 12 of 18
(2,180 Views)
Solution
Accepted by California_J

California_J wrote:  This time I need help with oposite conversion from float to 4 byte array.

All you actually have to do is change the Rotate Left on the MSB to a Rotate Right.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 13 of 18
(2,160 Views)

Can you make that work for LV 2013??

 

I can not ID what those elements are and when I drag the snippett, written in 2015, it will not convert...

0 Kudos
Message 14 of 18
(1,517 Views)

Here you go.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 18
(1,503 Views)

You ROCK!

 

Thanks a million!

 

How did you figure that out??

 

I have never used those structures!


VERY VERY cool!

0 Kudos
Message 16 of 18
(1,493 Views)

@davekorpi wrote:

How did you figure that out??


It's called a snippet.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 17 of 18
(1,486 Views)

I got the snippet thing... The MAGIC is that structure! VERY VERY cool!


@crossrulz wrote:

@davekorpi wrote:

How did you figure that out??


It's called a snippet.


 

0 Kudos
Message 18 of 18
(1,484 Views)