[Dry goods sharing] Some thoughts on the development of .NET host computer

 

 

                                                                                            Live today

​ Course topic: [Handwriting Modbus Communication Library]
                                                                                     Lecturer: Teacher Fu

                                                                                 Course time:
                                                                                       Scan the code to enter the live broadcast at 20:00 tonight

 

 

(1) It is recommended that most technicians should learn a computer language, maybe you will not be able to use it immediately for your work. But programming thinking and programming thinking will help you to understand many technical issues. [Official account: thinger_swj]

(2) If you want to learn a technique by reading the technical articles on the official account, I advise you to die. Technical articles can expand your knowledge and let you know the direction of your next study, but you won’t Teach you exactly how to do it.

(3) In the Internet age, resources and information are the most lacking, and the ability to filter is the most lacking. If you find what you want in the vast ocean of resources, you need to constantly explore it yourself.

★Body:

      Today, as a technician, I will share with you a technical case developed by the host computer. I hope it can be helpful to everyone.

      I believe everyone is familiar with the term host computer. From a broad perspective, all HMIs that can communicate with a lower computer can be called a host computer. From a narrow perspective, it refers to a computer written in a high-level computer language. For the upper monitoring system, the commonly used programming languages ​​here include C++, JAVA, Python, and C#. There is no doubt that in the industrial control industry, the most suitable programming language for the development of industrial control upper computers is the C# language under Microsoft.

       This host computer case is a relatively early development project. The target lower computer is Siemens S7-1500 PLC. Since there is no corresponding hardware for data interaction, the data you may see is not normal working data. This host computer is a typical host computer monitoring system, including the operating parameters and operating status monitoring of various sub-stations, the setting of important parameters, and the functions of real-time alarm, log query, parameter setting, user management, and authorization management.

 

 

 

★Analysis of development process:

      If you want to develop such a system independently, you need some technical reserves. Let me briefly analyze it with you:

(1) First of all, if we are doing PLC programming ourselves, then this block is much simpler; if we are not doing PLC programming ourselves, we need to understand the format and data types of communication variables.

(2) The second is the communication mode between the host computer and the PLC. There are many types and brands of PLC. Commonly used brands include Siemens, Omron, Mitsubishi, Keyence, Panasonic, AB, etc. The protocols supported by different brands of PLC are different. For the S7-1500 PLC used in this project, it actually supports many communication methods, such as S7, Modbus, TCP/IP, OPCUA, etc. Here we choose the most convenient S7 communication protocol.

(3) Finally, it involves C# programming, which is also the core of host computer development. The construction of the basic interface framework, multi-threaded applications, data communication and analysis, real-time alarm detection and historical data storage, etc. all require us to be proficient in the use of C# language.

With the above technical reserves, then let's talk about the specific development process.

 

★Specific development process:

(1) Implementation of the login module: If there are no special requirements, I generally use a relatively simple login interface, and the logic of the login module has a certain degree of versatility.

(2) User authority management: For different users, there is generally a problem of authority assignment, which can be in the form of user groups, such as administrators, team leaders, and operators, and can also be assigned to each user.

(3) The overall interface layout: The interface layout should be designed completely according to the aesthetics of individuals and customers. First, determine the structural form, such as upper, middle, lower, left and right, or a combination of multiple forms. I generally follow the principle of simplicity and refreshment, and then combine the actual process and user preferences to make some optimizations.

(4) Data communication display: Data communication is the core of the entire upper computer, which provides data sources for subsequent development through data communication and processing. Data communication mainly includes a series of operations such as device connection, data reading, data analysis, data writing, disconnection, disconnection reconnection, etc. Generally, a series of knowledge such as multithreading, asynchrony, and delegation are required, such as simple projects. The corresponding function can also be realized through the timer.

(5) Real-time historical alarm: For real-time alarm and historical alarm, both will involve the problem of alarm detection. Generally, alarms are divided into discrete alarms and analog alarms according to variable conditions. Discrete alarms are mainly used to detect the change state of the rising or falling edge of Boolean variables, and analog alarms are mainly used to judge the output value of non-Boolean variables. , The analog alarm status is divided into high limit, high high limit, low limit, low low limit. For alarm detection, the main principle is to compare the current value with the last scan value to determine whether the alarm is triggered.

(6) Real-time historical curve: Real-time and historical curves are an important part of the host computer. Generally, the display of real-time curves is to update the currently collected data to the curve control in real time. Due to the display limitations of the curve control, it is impossible to keep all Data, generally can be set to keep the data of the last half an hour or 1 hour. The historical data is mainly used for query, which is convenient for fault tracing or data analysis later.

(7) Data report printing: For some projects, data report design and printing and export may be involved. This is mainly related to data analysis and query. Depending on the complexity, different methods can be used, such as commonly used ones. Form controls, RDLC, crystal reports or other three-party plug-ins.

 

 

Guess you like

Origin blog.csdn.net/xiketangAndy/article/details/107210327