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. Kawasaki 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

E_Con TCP/IP Communication question.

  • saberlars
  • March 16, 2024 at 1:45 AM
  • Thread is Resolved
  • saberlars
    Robot, beyond Human..
    Reactions Received
    22
    Posts
    223
    • March 16, 2024 at 1:45 AM
    • #1

    Hi KAWASAKI forum!

    Previous data communication experiences were all based on the RS232C(Serial) method.

    I'm never used TCP/IP communication.

    That code based on Chapter 6.2.2 of the 90210-1248DEB.pdf manual, but I am not sure if it will work properly.

    also, I hadn't any OLP program.

    Please let me know if there are any areas that need improvement or if you have any advice. Thank you.

    Code
    .PROGRAM ip_connect()
    ; Client(Rob) connection request to Server(PC)
    
    ; Server Port Define
      svr_port = 10000
    
    ; Server IP Define
      svr_ip[1] = 192
      svr_ip[2] = 168
      svr_ip[3] = 125
      svr_ip[4] = 200
    
    ; Timeout /sec
      timeup = 10
    
      TIMER (2) = 0
      TCP_CONNECT svr_id, svr_port, svr_ip[1], timeup
     
      IF svr_id = 0 THEN
        PRINT "_"
        PRINT ".Prog Ip_Connect"
        PRINT "Connection Error"
        STOP
      ELSE
        PRINT "_"
        PRINT ".Prog Ip_Connect"
        PRINT "TCP/iP Established!"
        PRINT "Server ID= ", svr_id
        PRINT "Taken Time= ", TIMER(2)
      END
    .END
    
    .PROGRAM data_recv()
    ; Data Receive from Server
    
    ; Return ID (for Status Check)
      rtn_id = 0
    
    ; Define String Length
      str_length = 255
    
    ; Data's array count starting num
      recv_ary = 1
    
    ; Timeout /sec
      timeup = 10
    
      TIMER(3) = 0
      TCP_RECV rtn_id, svr_id, $recv_data[1], recv_ary, timeup, str_length
    
      IF rtn_id <> 0 THEN
        PRINT ""
        PRINT ".Prog Data_Get"
        PRINT "Data Receive Error= ", rtn_id
        STOP
      ELSE
        IF recv_ary > 0 THEN
          IF (recv_ary * max_length) <= 255 THEN
            PRINT ""
            PRINT ".Prog Data_Get"
            PRINT "Data Recv OK"
            PRINT "Number of array : ", recv_ary
            PRINT "Final Raw data= ", $recv_data[1]
            PRINT "Taken Time= ", TIMER(3)
            $align = $recv_data[1]
          ELSE
            PRINT ""
            PRINT ".Prog Data_Get"
            PRINT "String too long= ", recv_ary
            PRINT $recv_data[1]
            STOP
          END
        END
      END
    .END
    
    .PROGRAM data_send()
    ; String send to Server
    
    ; Get Model number from PLC
      WAIT BITS(1057,8) <> 0
      model = BITS(1057, 8)
    
    ; Trigger String Define
    ; "START" + "01" = "START01"
      $img_num[1] = "01"
      $img_num[2] = "02"
      $header = "START"
      $send_str[1] = $header + $img_num[model]
    
    ; Send String ($send_str) Array Index
      start_idx = 1
    
    ; Return ID (for Status Check)
      rtn_id = 0
    
    ; Timeout /sec
      timeup = 10
    
      TIMER(4) = 0
      TCP_SEND rtn_id, svr_id, $send_str[1], start_idx, timeup
    
      IF rtn_id <> 0 THEN
        PRINT ""
        PRINT ".Prog Data_Send"
        PRINT "Data Send Error= ", rtn_id
        STOP
      ELSE
        PRINT ""
        PRINT ".Prog Data_Send"
        PRINT "Data Send OK"
        PRINT "Sent String= ", $send_str[1]
        PRINT "Taken Time= ", TIMER(4)
      END
    .END
    
    .PROGRAM ip_close()
    ; TCP Connection Terminate
    
    ; Return ID (for Status Check)
      rtn_id = 0
    
      TCP_CLOSE rtn_id, svr_id
     
      IF rtn_id <> 0 THEN
        PRINT ""
        PRINT ".Prog Ip_Close"
        PRINT "TCP Close Error= ", svr_id
        STOP
      ELSE
        PRINT ""
        PRINT ".Prog Ip_Close"
        PRINT "TCP Close OK"
      END
    .END
    Display More

    ABB, FANUC, Hyundai, Kawasaki

  • Go to Best Answer
  • Alexandru
    Reactions Received
    49
    Trophies
    6
    Posts
    407
    • March 16, 2024 at 4:37 PM
    • #2

    what you want to send on TCP/IP?

  • saberlars
    Robot, beyond Human..
    Reactions Received
    22
    Posts
    223
    • March 16, 2024 at 5:57 PM
    • #3
    Quote from Alexandru

    what you want to send on TCP/IP?

    Server is “3D Vision PC" and camera will mount fixed bracket. (Above robot)

    I hope TCP/iP communicate as like a RS232C.

    Rob > PC "Trigger" (Request snapshot string)

    PC > Rob "Result" (Ok or NG & Coord Align string)

    Vision PC is operation thru Customized program.

    Different retail product. (ie - Cognex)

    ABB, FANUC, Hyundai, Kawasaki

  • kwakisaki
    Reactions Received
    694
    Trophies
    11
    Posts
    4,763
    • March 17, 2024 at 11:09 AM
    • #4

    Code is full of syntax errors on all your IF statements.

    Get KRoset and Hercules applications and you can test as much TCP/IP as you can eat.

    View my channel at Industrial Robotics Consultancy Limited - YouTube

  • saberlars
    Robot, beyond Human..
    Reactions Received
    22
    Posts
    223
    • March 17, 2024 at 8:05 PM
    • #5
    Quote from kwakisaki

    Code is full of syntax errors on all your IF statements.

    space character error.. right?

    ABB, FANUC, Hyundai, Kawasaki

  • kwakisaki
    Reactions Received
    694
    Trophies
    11
    Posts
    4,763
    • March 17, 2024 at 9:12 PM
    • #6

    No...............parentheses.

    Remember an IF is an evaluation expression of condition(s).

    Kawasaki does not care about spaces or tabs.

    View my channel at Industrial Robotics Consultancy Limited - YouTube

  • saberlars
    Robot, beyond Human..
    Reactions Received
    22
    Posts
    223
    • March 17, 2024 at 9:48 PM
    • #7
    Quote from kwakisaki

    No...............parentheses.

    Remember an IF is an evaluation expression of condition(s).

    Kawasaki does not care about spaces or tabs.

    I found wrong syntax expression!
    (TIMER statement lost =)
    (IF statement = -> ==)

    Quote from kwakisaki

    Get KRoset and Hercules applications and you can test as much TCP/IP as you can eat.

    and upload confirmed K-iDE & K-ROSET!

    Thanks!

    ABB, FANUC, Hyundai, Kawasaki

    Edited once, last by saberlars (March 17, 2024 at 10:13 PM).

  • kwakisaki
    Reactions Received
    694
    Trophies
    11
    Posts
    4,763
    • March 17, 2024 at 10:51 PM
    • Best Answer
    • #8

    If you get Hercules application too, you can test data exchange like in attached video examples.

    Files

    KROSET TCP_IP Basic connection.mp4 3.04 MB – 43 Downloads KROSET TCP_IP and Hercules Tests.mp4 7.24 MB – 38 Downloads KROSET TCP_IP Pitfalls with Hercules.mp4 19.51 MB – 40 Downloads

    View my channel at Industrial Robotics Consultancy Limited - YouTube

  • saberlars
    Robot, beyond Human..
    Reactions Received
    22
    Posts
    223
    • March 18, 2024 at 1:40 AM
    • #9
    Quote from kwakisaki

    If you get Hercules application too, you can test data exchange like in attached video examples.

    Yes Yes! It is really good for begineer!

    Have a nice day! :guru:

    ABB, FANUC, Hyundai, Kawasaki

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
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • 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
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Tags

  • TCP/IP
  • TCPIP
  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