1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. ABB Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Floating point value over PROFINET

  • DS186
  • November 10, 2022 at 12:19 AM
  • Thread is Resolved
  • DS186
    Reactions Received
    201
    Trophies
    6
    Posts
    1,076
    • November 10, 2022 at 12:19 AM
    • #1

    Guys,

    I have an IRC5 controller connected to a Siemens PLC via PROFINET. Is it somehow possible to directly receive floating point values, e.g. 3.75 or -1.25? Somebody told me to use the analog signal type. Is that possible and if yes, could somebody give an example on how to set it up on the robot side?

    Appreciate your help!

  • Go to Best Answer
  • xanmanx
    Trophies
    1
    Posts
    2
    • November 10, 2022 at 12:55 AM
    • #2

    I read a great example today in the forums.robot.studio where somebody tested this out with success for GO to PLC. You will still have to scale your floating point to a whole number before sending over profinet. From what I understand as long as the bit values are the maximum + and - values needed and twos compliment is selected in the signal params you will be okay. Although you will still have to do some math as the value will be a int when received in the robot.

    I will be testing this out tomorrow as well. I have the forum discussion open on my desk that I am referring to and can post a link tomorrow.

    In the ABB Technical Overview for System Parameters there is a section going over analog outputs.

  • hermann
    Reactions Received
    412
    Trophies
    9
    Posts
    2,628
    • November 10, 2022 at 8:38 AM
    • #3

    You can use folllowing code:

    Code
       FUNC num IEEE2Float(byte value1, byte value2, byte value3,byte value4)
        var num result;
    
        !============================================
        ! Conversion of 4 bytes of a IEEE float
        ! to normal num variable
        !============================================
    Var rawbytes rawvalue;
        packrawbytes value1,rawvalue,1,\Hex1;
        packrawbytes value2,rawvalue,2,\Hex1;
        packrawbytes value3,rawvalue,3,\Hex1;
        packrawbytes value4,rawvalue,4,\Hex1;
        unpackrawbytes rawvalue,1,result,\Float4;
        Return result;
        !============================================
      ENDFUNC
    
      PROC Float2IEEE(num floatvalue, var byte value1, var byte value2, var byte value3, var byte value4)
        !============================================
        ! Conversion of a normal numerical float to 
        ! IEEE format as 4 bytes, for setting 
        ! 4 corresponding group outputs
        !============================================
    Var rawbytes rawvalue;
        packrawbytes floatvalue,rawvalue,1,\Float4;
        unpackrawbytes rawvalue,1,value1,\Hex1;
        unpackrawbytes rawvalue,2,value2,\Hex1;
        unpackrawbytes rawvalue,3,value3,\Hex1;
        unpackrawbytes rawvalue,4,value4,\Hex1;
        !============================================
      ENDPROC
    Display More

    those byteX are 8 bitwise grouped outputs/inputs to/from PLC, and should be set/read in the calling routines.

    No analog signals used (that would be kind of nogo imho)

  • DS186
    Reactions Received
    201
    Trophies
    6
    Posts
    1,076
    • November 10, 2022 at 9:03 AM
    • #4

    Thanks hermann for the example. That means I have 4 groups of 8 bit each or do I have to group the whole 32 bits together on the robot side? And the same for the PLC side?

  • hermann
    Reactions Received
    412
    Trophies
    9
    Posts
    2,628
    • November 10, 2022 at 10:14 PM
    • Best Answer
    • #5

    You need 4 groups, each 8 bits. The value of those 4 bytes are represented by the variables value1, value2 ...

    On PLC side you can just copy a float value onto the same address that goes to those 4 bytes on the robot, no conversion on PLC side needed. On Siemens PLC a float occupies 4 bytes, in standard IEEE format. With the two routines these 4 bytes are raw copied into/from the storage of a real value on the robot. Then the robot has the same bytes in his storage as the PLC. By addressing them as a real value, you get the same real value as on the PLC, because the robot internally also uses the same IEEE format.

  • DS186
    Reactions Received
    201
    Trophies
    6
    Posts
    1,076
    • November 11, 2022 at 6:26 AM
    • #6

    Got it, thank you very much for the detailed explanation.

  • hermann
    Reactions Received
    412
    Trophies
    9
    Posts
    2,628
    • December 7, 2022 at 4:37 PM
    • #7

    My above code lacks the declaration of rawvalue, please insert the declaration in every procedure. Have added it now.

    Code
    Var rawbytes rawvalue;

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download