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. Stäubli & Bosch 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

Questions about TCP Client/Server and Signal Capture in Fast IO (J212)

  • Vi NTT
  • September 3, 2024 at 2:35 PM
  • Thread is Resolved
  • Vi NTT
    Trophies
    1
    Posts
    34
    • September 3, 2024 at 2:35 PM
    • #1

    Hi everyone,

    1/ I've noticed that in SP2, on the CS9 controller with the TX2-90 Staubli at my laboratory, there is a TCP client (siClient) and a TCP server (siServer) from a previous project. If I create a new project and want to continue using these SIOs, what should I do?

    2/ In the "socket edition" section, for a client-type socket, can I leave the server IP address at the default value, or can I use any value?

    3/ I have a square wave input signal connected to J212. I'm using "setlatch" to capture the robot's position when a signal is detected at J212. How should I read the captured data for future use?

    Thank you for your help.

    Best regards,
    Vi

  • Go to Best Answer
  • ashik imam
    Posts
    1
    • September 3, 2024 at 3:22 PM
    • #2

    TCP Client/Server:
    Clients connect to servers using IP and port, with TCP ensuring reliable data transfer. Servers listen for connections and handle requests

  • Psyril
    Reactions Received
    17
    Trophies
    4
    Posts
    83
    • September 4, 2024 at 8:38 AM
    • #3

    Hello Vi NTT,

    These AI generated answers are nonsense.

    1. You can reuse these or create new ones to communicate over TCP using sioGet(), sioSet() or by writing something like:

      Code
      siServer = ”Hello World!”
      Code
      sMessage = siClient
    2. You can do both. As long as the addresses matche your network.
    3. With the function here for cartesian position or herej for joint position:

      Code
      l_pCurrentPosition = here(tTool, fFrame)
      l_jCurrentPosition = herej()

    The difference between theory and practice is greater in practice than in theory.

  • Vi NTT
    Trophies
    1
    Posts
    34
    • September 4, 2024 at 10:07 AM
    • #4

    Hi Psyril,

    I am working on a project involving a sensor device (Kreon KZ25) that measures the shape of external objects and is mounted at the end of a robot arm. This device operates by sending signals to its controller and requires the robot's position data. The software then uses this information to display point clouds of the object. The device sends a square wave signal to the port J212 to receive the robot's position data.

    I found a command called “setLatch” in the documentation, which is supposed to send the robot's position data when it receives the square wave signal. I've written a program based on this, and I need to verify if my program is correct. However, I am unsure where to read this result. In the .dtx file, I always see a value consisting of zeros, with no updated values.

    Thank you for your help.
    Best regards,
    Vi

  • Psyril
    Reactions Received
    17
    Trophies
    4
    Posts
    83
    • September 4, 2024 at 4:12 PM
    • Best Answer
    • #5

    Oh, ok. In this case after having used setLatch (which is basically just a configuration), you can use

    Code
    bAnyNewPosition = getLatch(jLatchedPosition)

    bAnyNewPosition will change to true if a new position was latched.
    jLatchedPosition will change to the latched position.

    If you do that in a loop, you can fill up an array with all the latched positions or send it to another device.

    Or you could use the functions enableContinuousLatch() and getContinuousLatch() to use an internal buffer.

    The difference between theory and practice is greater in practice than in theory.

  • Vi NTT September 4, 2024 at 5:19 PM

    Selected a post as the best answer.
  • Vi NTT
    Trophies
    1
    Posts
    34
    • September 4, 2024 at 5:19 PM
    • #6

    Thanks for the explanation. That really clarifies. I’ll try it.

  • Vi NTT
    Trophies
    1
    Posts
    34
    • October 1, 2024 at 10:20 AM
    • #7

    Hi Psyril,

    Sorry to bother you again.

    On the controller, I created a socket sClient and in the program I wrote sClient = sSend, where sSend contains a string of values j1,...j6 from jLatchedPosition, which were converted to strings using toString. I saw this value displayed on the controller when the program ran. My question is: has this value (from sClient) also been updated on SRS 2019? If not, how can I save this value to the PC?

    I also have the Polygonia software (a tool for collecting 3D scan data from a scanning device) installed on the same computer as SRS 2019. I'm not sure if there’s a way for this software to receive the data I’ve sent via TCP/IP?

    Thanks for your help,
    Vi

  • Psyril
    Reactions Received
    17
    Trophies
    4
    Posts
    83
    • October 7, 2024 at 9:10 AM
    • #8

    There might be a misunderstanding. SRS is the programming environment for Stäubli Robots. The communication between SRS and your controller is to exchange applications, configurations and to debug live. It is not meant to be used in “production” to exchange data.

    As you wish to communicate over TCP/IP, you can use any TCP server to communicate with your client. I don’t know what Polygonia software is capable of. If it can’t handle TCP/IP communication, you might have to create a software that does, communicates with the controller and translates the data so that Polygonia software can use it.

    To create that software, you can use Python for example. You could even use an emulator of SRS to make that communication, but that wouldn’t be a very clean solution.

    The difference between theory and practice is greater in practice than in theory.

  • Vi NTT
    Trophies
    1
    Posts
    34
    • October 9, 2024 at 4:58 PM
    • #9

    Hi Psyril,

    Thank you for the clarification regarding the SRS programming environment for Stäubli Robots. I was really confused until your explanation.

    Is it true that the variable values, after being executed and stored on the controller, cannot be saved on the computer using the SRS software?
    I have assigned sClient = sSend, but I’m unsure if there’s a way to verify that this data has been saved to the sClient socket and can be read by the server.

    Best regard,

    Vi

  • Psyril
    Reactions Received
    17
    Trophies
    4
    Posts
    83
    • October 9, 2024 at 5:43 PM
    • #10

    If you just want to test if the values are sent to sClient, you could run an application in SRS emulator that “talks” to the real controller. That way you are sure this is working.

    You could use something like:

    Code
    sMessage = sioServer
    popUpMsg(sMessage)

    The difference between theory and practice is greater in practice than in theory.

  • Vi NTT
    Trophies
    1
    Posts
    34
    • October 10, 2024 at 9:57 AM
    • #11

    I still don't quite understand your point. Previously, you mentioned that the SRS and controller are just applications and don't exchange data. So, with the command you provided, I'm not sure how to proceed. Will it display on the controller or the SRS?
    I'm just someone who's exploring and learning, so I may ask some questions that seem a naive. I hope you understand.
    Thank you so much for your continued support and assistance.

  • Psyril
    Reactions Received
    17
    Trophies
    4
    Posts
    83
    • October 11, 2024 at 9:36 AM
    • #12

    In SRS you can run controller emulators. These emulate the behavior of a real controller. Thus, you can use an emulator to "talk" to a controller over TCP/IP. This could be useful for testing, but by no means I would recommend using this in production.

    The instruction popUpMsg displays the message on the pendant on which the code is running (emulator or real controller/pendant).

    Example code snippet for server and client:

    Code
      do
        if bSend
          sioServer=sMessage
          bSend=false
        endIf
        delay(0)
      until sMessage=="exit"
    Code
      do
        sMessage=sioClient
        popUpMsg(sMessage)
        delay(0)
      until sMessage=="exit"

    The difference between theory and practice is greater in practice than in theory.

  • Vi NTT
    Trophies
    1
    Posts
    34
    • October 11, 2024 at 10:32 AM
    • #13

    I did two tests :

    1. I have a Client program that saves the sSend string to the sClient socket. Then, I created a other cell called Server and used your code in the "start" section.

    “begin

    sMessage = sioServer

    popUpMsg(sMessage)

    end”

    I loaded it into the real controller using the "transfert manager". After running the Client to send sSend, the Server didn’t display sMessage.

    2. I created the Server_Client cell and two new applications: Client and Server. The Client application displayed sSend, but the Server application didn’t show sMessage.

    Regarding your statement “Thus, you can use an emulator to "talk" to a controller over TCP/IP”, I’m wondering if "emulator" means a controller emulator and if "talk to a controller" refers to a real controller.

    Thanks for your help.

    Best regard,

    Vi

  • Psyril
    Reactions Received
    17
    Trophies
    4
    Posts
    83
    • October 11, 2024 at 11:00 AM
    • #14

    Writing

    Code
    begin
    	sMessage = sioServer
    	popUpMsg(sMessage)
    end

    without a loop means that your timing must be suuuuuper precise in order for your code to work. You should use a loop as I already explained and showed in my code snippet. I’m really running out of ideas on how to show you this basic concept.

    The difference between theory and practice is greater in practice than in theory.

  • Vi NTT
    Trophies
    1
    Posts
    34
    • October 11, 2024 at 2:08 PM
    • #15

    Hi Psyril,

    I really struggle to understand TCP/IP communication between devices.

    In my project, the robot acts as a client, sending the position sSend = sClient into the TCP client socket, while the Polygonia software acts as the server that reads this data.

    So, when you mentioned it, I didn't understand which is the server and which is the client for testing. For instance, it could be communication between two virtual controllers, between a virtual and a real controller, or between two applications within the same cell. Therefore, I’m unsure where to place the two programs you provided.

    Once again, thank you very much for your help. I think I need to read the documents more carefully

    Best regard,

    Vi

  • Psyril
    Reactions Received
    17
    Trophies
    4
    Posts
    83
    • October 11, 2024 at 2:27 PM
    • #16

    It doesn’t’ matter which is the client and which the server. The communication goes both ways. Important is to have one of each. So, one device is the server, and one device is the client. Device can be:

    • a real controller
    • an emulated controller which is running in SRS
    • any software that uses TCP/IP for communication
    • many more

    The difference between theory and practice is greater in practice than in theory.

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