Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You've already figured it out, it seems that you just don't realize it. The conversion <code>DWORD_TO_REAL</code> is taking the integer (hex) value stored in <code>4bytesData</code> and converting it to IEEE754 REAL format. </p> <p>This is not what you want to do. <code>4479FFFF</code> is <strong>already</strong> in IEEE754 REAL format - you're taking that value, interpreting the REAL as a DWORD, and then converting the DWORD value to a REAL. The short answer is that you don't need the conversion - <code>4bytesData</code> is already in the correct format.</p> <p><strong>edit</strong> </p> <p>follow up on comments : </p> <p><img src="https://i.stack.imgur.com/i9wEy.png" alt="enter image description here"></p> <p>here FunctionBlock2 delclares rIn(REAL), rOut(REAL) and sets <code>rOut:=rIn;</code>. This gets around the forced typecasting of ST. Nothing is changing about the data stored in <code>D2000</code> here - it's the same binary data. The top function block is storing it into memory and the bottom one is reading it from memory. The only difference is that the top rung is interpreting it as a DWORD (for display purposes) and the bottom rung is interpreting it as REAL. </p> <p><em>edit</em></p> <p>I've been reading the Beckhoff manual. It seems you may have other options. Try perhaps <a href="http://infosys.beckhoff.com/english.php?content=../content/1033/tcplccontrol/html/tcplcctrl_variables_allocated.htm&amp;id=14211" rel="nofollow noreferrer">declaring a DWORD and REAL at the same memory location</a>. If not, perhaps <a href="http://infosys.beckhoff.com/english.php?content=../content/1033/tcplccontrol/html/tcplcctrl_%5E.htm&amp;id=14183" rel="nofollow noreferrer">pointers would let you do it</a> (not sure if type restrictions also apply to pointers with Beckhoff?) </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload