"Industrial serial and network software Communication Platform (Superio) tutorial" eight. Superio communication mechanism and device-driven docking instructions

Source: Internet
Author: User

Superio Related information Download: http://pan.baidu.com/s/1pJ7lZWf
1.1 Description of the communication mechanism

The general mechanism of communication using call answering, is the host computer software to send the request Data command, the next computer terminal received the command, and verify the success, return the corresponding data.

(1) Serial communication mechanism includes: polling mode.

Serial bus involves one-to-two communication, a pair of communication, in order to avoid the bus data conflicts and environmental interference problems, in the premise of ensuring the stability of communications, only the use of polling communication mechanism. One device sends and receives complete data before it communicates with the next device. However, this communication efficiency is relatively low, if you want to improve communication efficiency, you can increase the serial server, in the Superio platform to achieve a serial port corresponding to multiple field equipment to communicate, that is, the field of all equipment balance load to different serial.

(2) network communication mechanism includes: polling mode, concurrency mode and automatic control mode.

Polling mode is the same as the polling mode in the serial communication mechanism, but the efficiency of the operation mode is very low for network communication, which can not embody the advantage of network communication. Based on this consideration, the concurrency mode and auto-control mode are added on the basis of polling mode.

The concurrency pattern, coordinated by the internal Superio, is implemented by invoking the Getsendbytes function of the Irundevice device interface to obtain the Sent command packet, which sends the data of all devices centrally. The receiving data part uses the asynchronous listening method, receives the corresponding device the data. The communication period of the concurrency mode is scheduled by the Superio platform, and the cycle of the request data cannot be controlled autonomously, and the automatic control mode is added on this basis.

Self-control mode, two times developers in the development of device drivers, can be timed through the Onsenddatahandler send request data commands, receive data part of the use of asynchronous listening, receive the corresponding device data, instant request instant response.

Another situation, the field hardware terminal will actively send state Word data to the host computer software, this time it is necessary to be able to actively listen to receive data events, this is the polling mode can not be done. In such cases, it is recommended to use self-control mode for communication.

1.2 Communication mechanism and device-driven docking

The Superio consists of two parts: the communication section and the device driver section.

(1) How does the communication section work in coordination with the device driver? Two parts mainly through the Irundevice interface to achieve the coordination between the two parts, thread, asynchronous, synchronization mechanism by the Superio internal to complete.

(2) How to transfer to the corresponding device after receiving the data from the communication section? Polling mode does not have this problem, mainly involves the concurrency mode and the automatic control mode, because these two parts adopt the way of the asynchronous listening data. There are two ways to solve this problem: the first, by receiving the protocol driver to obtain the device ID to identify the corresponding device. The second, the device set by the IP address to identify the appropriate device. The Superio platform now uses the second approach.

(3) How does the concurrency mode and auto-control mode achieve the communication interrupt state? In the case of a link failure, send the request command, do not return the corresponding data, but also trigger the interface to run the device, so the communication status will not change, and will not react. The way to solve this problem is to send the request data command more than 3 times, each time does not return the corresponding data, it will trigger the running device interface to complete the process of running the device.

Author qq:504547114

QQ Group: 54256083

Official website: http://www.bmpj.net

Source Article address: http://www.bmpj.net/index.php?m=article&f=view&id=8

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

"Industrial serial and network software Communication Platform (Superio) tutorial" eight. Superio communication mechanism and device-driven docking instructions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.