Iam having a problem using PLCSIM v15.1. I keep getting an error 33:17090 which says "A connection between your PC/programming device and the PLC cannot be established." I do have PLCSIM.MPI.1 set up through the Control Panel. What am I doing wrong?
I have a WeMos D1 Uno type board with builtin ESP8266 Wi-Fi . I will like to transfer an integer value from the board to a PC running a C# application with data transfer over Wi-Fi. A mobile phones hotspot is used for the Access point. For starters i need to get the correct sketch going before i can even start to work on the C# application. I am not sure if my approach is correct. Here is my sketch. It fails to connect to the pc.
There is an assumption that your PC is connected to a WiFi Router.
Connect to that WiFi router and once connected, you should be able to establish a connection to the Server on the PC (providing the PC is on the same network as the WiFi Router).
NB i don't have a separate router and am using the Access point of my mobile device. I've redone the code. The ESP8266 connects to the Access point on the mobile device as expected. However i am struggling to get the connection to the PC to write the data across. The client.connect(host,port) is the issue. Now ive tried to get the IP address and port for my pc by running a command prompt ipconfig/all and netstat -a. I used the iPv4 Address under Wireless LAN Adapter Wifi. This didnt work. I also tried to create a Wireless hotspot at admin command prompt using my PC without using my mobile device.
Just to be clear - from what you have said, it seems like you are trying to transmit data from your ESP8266 to your PC via a mobile hotspot. So you have the ESP8266 and your PC both connected to your mobile hotspot. I am assuming that your PC has WiFi capabilities ??
Connect your PC directly to the ESP8266 and eliminate your mobile phone completely from the equation.
Set up your ESP8266 as an access point, and then get your computer to connect to that access point.
My laptop has Wi-Fi capabilities for connecting to my mobile phone which i use to connect to the internet. It does not have a visible hot-spot feature (Using Windows Eight). I have configured a hot-spot manually as i've illustrated which shows up on my mobile phone when doing a Wi-Fi scan. However it wouldn't release its IP address.
I am aware that the ESP8266 can be used as an Access Point. However i have found the connection is not stable and breaks up more frequently. I prefer to rather have it connect to an access point like my mobile device which is more stable. In principle if two devices are connected to a network then the ESP8266 should be able to connect to the PC and vice versa. I am clearly missing out something here and i suspect it either has to do with
a) The port and IP address i am using is incorrect.
b) My interpretation of using the client.connect(host,port) is incorrect as host may only apply to website URLs.
c) In order for the ESP8266 to connect it also requires acceptance from the server side. So the server needs to be running first before i run the client
I get two different IP addresses generated if the code is executed with an without Wi-Fi connected via my mobile device access point. My understanding is that each machine should have a unique IP address.
My guess is that your ESP8266 and your computer are on two different networks.
Your WiFi hotspot on your phone should be indicating 2 connections - one from the ESP8266 and the other from your computer. Is that the case ?
I don't understand why the connection between the ESP8266 and your PC would be better by introducing an extra point of access, unless the physical distance between your PC and the ESP8266 is large. The phone could be used a stepping stone I guess... but if the physical distance is close, then that does not make sense to me.
For the port number i opened a command prompt typed netstat -a and pulled up the matching IP address for the laptop as above. There were six TCP "local address" connections with the same IP but each having different port numbers. I had used 139 its "State" was set on listening and its "Foreign Address" was the name of my laptop.
The client cannot connect to the server unless it knows where it is and what port to connect to.
When you run a server on the PC (which has an IP address of AAA.BBB.CCC.2), you will need to tell your ESP8266's Client where the server is located.
The port does not come from the PC, the phone or the ESP8266. It is determined by the server running on that device. If you don't have a server running, then there is nothing the client can connect to.
NB Just some general info for other readers. I was able to run a ping command from the laptop to the ESP8266 over Wi-Fi using its IP address and it succeeded. So the laptop can see the ESP8266 over the network.
This document describes how to a make practical example of TCP/IP communication between Aurora Vision Studio and a PLC device. For this case Aurora Vision Studio 4.11 and Simatic S7- 1200 CPU 1212C AC/DC/RLY with TIA Portal V15 have been used. For more theory you can check out TCP/IP Communication article.
In this example, you will create an application which sends a number from Aurora Vision Studio to a PLC and receives the square of this value calculated by the PLC. The application will be configured as a master and the PLC as a slave.
Create a new project in the TIA Portal environment and add your device by double-clicking on Add new device. Select your controller model, its CPU etc. in the list of controllers available in a dialog box. Click on OK button if you are ready.
Expand a Program blocks list and double-click on the Main icon. Now you should see a network view. Find the Communication tab on the right side and double-click on the TCON icon available in Communication -> Open user communication -> Others.
In the Configuration tab, you need to set the IP address of your PC. To check the IP address, you can use the Command Prompt and the ipconfig command. Other parameters should be set like in the next figure. If you use these settings, the IP of the PLC device should be set automatically. If you cannot establish the connection, please follow steps described in next chapter about troubleshooting.
If you have not been able to properly set the IP address of the PC, as described in the previous chapter, you should set a static IP following steps described below or otherwise, feel free to skip this step.
Choose Accessible devices from a toolbar to open the configuration window. Select PN/IE type of the PG/PC interface and select the Ethernet card connected to the PLC. Click the Start search button, choose your PLC from the list of accessible nodes and click on the Show button. You should get a new static IP which you can use in steps from the previous chapter.
You should already have the TCON function block in the Network view. Now it is time to create a Variable Table by double-clicking on the Add new block in the Project Tree like it is shown here. Select the Data block (DB) and name the block as shown in the image below.
Now define variables in the Data block. Use the same names and data types as shown in the image below. If you want to create a new row, just right click on any row and select Insert row. Please note that setting the right values of Start Values is essential in this step.
Label all the inputs and outputs of the TCON block in the network view. To label connection drag and drop variables from Data block to the Program block (for example TYCON) or double click on a connection and select displayed icon like in the image shown below.
Insert additional communication block, TDISCON, from the Communication tab like on this previous picture. Label all connections as shown in the image below. TCON block will be used to establish TCP/IP connection while TDISCON will be used to close the connection.
The next step is to allow exchanging data between Aurora Vision Studio and PLC. Use TRCV block for receiving messages and TSEND block for sending messages to Aurora Vision Studio. Label added blocks as shown in the image below:
To start connection over TCP/IP using TCON you need to use rising edge signal on REQ input. Same applies to other function blocks (in TRCV a rising edge signal should be set on EN_R input). You can switch these values manually by right-clicking on the connection and selecting Modify. In this sample application, an automatic pulse generator will be used in order to avoid switching the values manually. Insert a new network and add a TP block located in the Basic instructions tab inside the Timer operation folder (picture below).
In the last step please add a sample math function e.g. multiplying. In this example a number received from Aurora Vision Studio will be squared and the result calculated on the PLC's side will be sent back to Aurora Vision Studio.
In this chapter, the individual steps how to create an Aurora Vision Studio application to communicate with a PLC over TCP/IP are described. Before proceeding to the next steps, make sure that all previous steps have been done correctly.
Aurora Vision Studio provides a set of ready-to-use filters for communication over the TCP protocol. A full list of the filters is available here. To get more detailed information on how to work with TCP filters, please refer to our official example IO Simple TCPIP Communication and the article Using TCP/IP Communication in the Aurora Vision Studio documentation.
First of all, create a new project and add a TcpIp_Accept filter. This filter, as well as other TCP/IP filters, are available in the Program I/O category of a Toolbox. Please note that TcpIp_Accept filter accepts a connection from a remote client, so in this case the Aurora Vision Studio program will be working as a server. If you want the program to work as a Client, the TcpIp_Connect filter should be used.
3a8082e126