Storing a REAL in a data module

Hello All,

I’m running into a strange issue with a data module in my project, I’m attempting to store 4 REAL values for a PID loop and the values that are loaded from the data module are way off.

What exactly am I doing wrong? I followed the formatting from the help, and this is the result.

image

image

image

Hello Kyle,

It looks like you are byte-shifted off by 2-bytes. Data objects are byte aligned, so make sure you don’t have any leading bytes which are throwing off your offsets.

Ex: 0.2

2.234791E-41

Link to website used: IEEE-754 Floating Point Converter

2 Likes

Austin,

Thank you for your answer!

Everything else in the data module is a UINT value, so adding one additional UINT before my REAL values shifted everything by the 2 bytes that I needed. All My values are now loading correctly.

image

1 Like