lemonfullpac

To Vb.net Rs485 Component Connection S7 Siemens

To Vb.net Rs485 Component Connection S7 Siemens Rating: 8,9/10 2540 reviews
  1. S7 Net Siemens
Component

Using Visual Studio 2008 (VB.net) on an XP platform, I'm trying to. I am working on communication of S7-200 & VB6 which you had already done. Protocol converter. Since s7-200 has an RS 485 free port, you need to use. The Siemens S7 Ethernet/MPI Server is a Microsoft Windows application program that acts as a communication protocol Server and allows Windows application programs to access the data from Siemens S7-300 and S7-400 controllers using the Ethernet Gateway for MPI,providing interface between 10/100 Mbps Ethernet and Siemens MPI bus.

IntroductionIn this series of articles, we will make use of technologies that deviate somewhat from what you usually see - web applications with ASP.NET for example, or management applications - in short, the classic development of common applications. We will enter a completely different world, we can say that in part it has to do with the internet of things. We'll talk about industrial automation and management machine tools PLC. You may wonder: but what does all this have to do with development with Microsoft and Visual Studio? It partly does, and partly doesn't. If it is true that we speak of other areas, and true that with Visual Studio, we can safely create interfaces and applications that interact with a machine tool and / or an automation system, we'll start with what are the tools needed to create a system which will interact with a Siemens PLC. We will continue creating a project with WPF technology.

To Vb.net Rs485 Component Connection S7 Siemens

In the next article, we will create the project with TIAPORTAL V13, and will perform the sample application text.Necessary toolsBelow, we see what instruments and software we need to make what we described previously. Let's start with Microsoft. S7.NET library for communication with the Siemens PLC, available on NuGet.Now, we come to the part of Siemens. (TIA Portal V13), is nothing more or less than the development IDE of Siemens with which we should create all the PLC program. On the latter, you should talk a lot, that is, as should be used, what are the principles for good logic PLC, and how to learn the languages dedicated for development.

We will give some advice necessary to the creation of the project, but the invitation for good learning to access the official website where there will be all the information available, necessary for learning.At the software level, we have everything we need. Let's see what you should have on hardware level. To best perform the sample project, the ideal is to have as in my case a PLC, will make use of the CPU 1211C, the family of Siemens S7-1200 products. A power supply that provides a 24V DC voltage and output current of at least 2 Amperes.

RJ45 network patch cable (uncrossed)Link for Siemens productsI leave briefly the necessary link for Siemens products. From this, you can download the trial version of TIAPORTAL V13, and for those who lack access to a PLC, can download the emulators of the CPU S7-1200 family. Install them so that you can run the emulation CPU without necessarily having a physical PLC at home.

Proper use of Siemens products. Note the following: WARNING. Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens.

At the end to the page, you will find the files to download and install. Else, those who do not use a physical PLC should install. This to emulate a network connection between the PLC and the interface that we will create later.Creating the project with Visual StudioGot to this point, we just should create the sample project from Visual Studio. Once downloaded and installed Visual Studio, you are moving and we create a WPF project entitled S71200 TEST, as in the image.Image 1: Creation of the WPF project.Created the project, we should add two buttons, a text box, and a TextBlock. The buttons will be used to set to true and a false PLC variables, if one bit, that if we want to compare it to.NET and C #, it is a bool variable.

Connection

The text box is used to enter the value that we want to set for the variable PLC, then the TextBlock will show the actual / set value of the PLC variable. In your project, copy the following XAML code.

After entering the code, we should have the interface, as shown below.Image 2: Interface creation of the WPF project. Now, let's add, as told by NuGet, the reference to the library S7.NET. In exploring solutions, we are going to select References, right-click and select -. Manage NuGet packages.Image 3: Research S7NET library on NuGet.Sprint found the library. Now, install it by clicking on Install. After the installation, we are now ready to implement all the functionality within the test project.

S7 Net Siemens

Let's go back to Visual Studio 2015 and access the editor of C # code. The first thing to do is to include the class MainWindow.cs S7.NET namespace, as shown in the following code. Plc S71200 = new Plc (CpuType.S71200, '192.168.0.25', 0, 1);The previous code creates a new object S7NET, where we need to implement each of the topics requested by its manufacturer, that is,. CpuType, the family to which the PLC belongs. In our case, it is a series CPU S7-1200. We will see how to set the IP address of the CPU by using TIAPORTAL V13 Siemens software in next article. The last parameter of the PLC station is location.

Leave it to 1 for S7-1200.Now that we have created the object of S7NET type, you must open the Ethernet connection to the PLC. The Open method must be implemented here, as follows.