Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-02111// Views: AA-02111// Created: 2022-11-24 12:34:21// Last Updated: 2022-11-24 12:43:07
HowTo
HYPERSIM: How to Exchange Data Between Two Targets Through TCP

Requirements

For this example, you will need:

  • Two simulators on the same network

Steps

  1. Create a model that will run as a TCP client. For this example, we have adapted the TCP-UDP example found in the HYPERSIM IO interfaces examples. 



  2. Open the IO interface in your model.



  3. In the IO interface configuration, add a TCP-UDP interface


  4. Add a TCP-UDP stream and configure it as follows:


      • For the TCP mode, select ‘Client’.
      • For the TCP port use 23000·
      • The NIC name should be the name of the interface that the TCP client is running on. For the linux platform, you can check this by running the command in the linux terminal. This field is ignored on Windows. 
      • The 'remote IP address' should be the TCP server’s IP address i.e., the point from which the client is receiving/transmitting data. For this example, this is Simulator #2’s IP address.  
      • If Enable transmission control and Enable reception control are enabled. Ensure these are set to 1 in the model.
  5. Add the data that will be transmitted/received by the TCP client:


  6. Apply the changes in the IO interface. In the model, map the sensors in the model to the TCP stream added in the previous steps: 



  7. Create a model that will run as a TCP server. For this example, we have adapted the TCP-UDP example found in the HYPERSIM IO interfaces examples.  


  8. Repeat step 2 and 3.
  9. Add a TCP-UDP stream and configure it as follows:

      • For the TCP mode, select ‘Server.
      • For the TCP port use 23000.
      • The NIC name should be the name of the interface that the TCP server is running on. For the linux platform, check this by running the command in the linux terminal. This field is ignored on Windows· 
      • If Enable transmission control and Enable reception control are enabled. Ensure these are set to one in the model.
  10. Add the data that will be transmitted by the TCP server:


  11. Apply the changes in the IO interface. In the model, map the sensors in the model to the TCP stream added in the previous steps:


  12. Run both models.
      • Run the model that simulates the TCP Client on simulator #1
      • Run the model that simulates the TCP Server on simulator #2 (i.e., 192.168.5.17 in this example).
  13. The client and server should be connected and exchanging data. This can be validated in ScopeView.