Announcement

Collapse
No announcement yet.

2 16bit ints to 1 32bit float

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts


  • 2 16bit ints to 1 32bit float

    Hello,

    I am getting a 32bit float sent via io-link as 2 16 bit ints. I a getting data conflict errors on pack word, pack bit, copy array. etc. What is the proper way to move this over?


  • #2
    Here is the compile error it gives me when I try to manually back the bits into a 32 bit float.
    "1 [Error] Invalid type 'Float, 32 Bit' for tag 'test data read', expecting a type from a category of 'Numerical'/'System Unsigned Int-16' excluding Analog Input, Integer, 32 Bit/Analog Input, Float, 32 Bit/Float, 32 Bit/Float, 32 Bit, 1D Array/Float, 32 Bit, 2D Array/Integer, 16 Bit BCD/Integer, 32 Bit BCD/Integer, 16 Bit System, Read Only at rung 3 column 11 of 'ioLinkTest'"

    Comment



    • #3
      Try packing to 32bit int as an intermediate value, then do a copy binary of the 32but int to the float.

      Comment



      • #4
        That worked thank you!

        Comment

        Working...
        X