CN107864141A - TCP/IP network communication methods based on LabVIEW - Google Patents

TCP/IP network communication methods based on LabVIEW Download PDF

Info

Publication number
CN107864141A
CN107864141A CN201711107236.5A CN201711107236A CN107864141A CN 107864141 A CN107864141 A CN 107864141A CN 201711107236 A CN201711107236 A CN 201711107236A CN 107864141 A CN107864141 A CN 107864141A
Authority
CN
China
Prior art keywords
tcp
pin
modules
data
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201711107236.5A
Other languages
Chinese (zh)
Other versions
CN107864141B (en
Inventor
李鹏
徐海亭
张佶
侯玮杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Aerospace Electromechanical Equipment Research Institute
Original Assignee
Tianjin Aerospace Electromechanical Equipment Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Aerospace Electromechanical Equipment Research Institute filed Critical Tianjin Aerospace Electromechanical Equipment Research Institute
Priority to CN201711107236.5A priority Critical patent/CN107864141B/en
Publication of CN107864141A publication Critical patent/CN107864141A/en
Application granted granted Critical
Publication of CN107864141B publication Critical patent/CN107864141B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a kind of TCP/IP network communication methods based on LabVIEW, by the data Caching Mechanism for establishing server end, server end ceaselessly updates previous frame data by the mobile register of loop structure, once there is error flag in communication connection, the data of the shift register latest update of loop structure are sent to client by server end, and this method to set up can effectively avoid frame losing phenomenon;By establishing ID screenings and fault tolerant mechanism, invalid connection ID caused by server end and client communication mistake is screened and closed, the client for making server end no longer be made a mistake to communication continues executing with write-in or read action, can so mitigate the burden of server processor significantly;Reconnection mechanism is circulated by establishing, client, which often carries out one cycle, can all create new connection, even if disconnecting occurs in network connection or unstable state result in present communications connection failure, client will also create new connection in circulate next time, enable the fast quick-recovery of network connection.

Description

TCP/IP network communication methods based on LabVIEW
Technical field
The invention belongs to network communication field technical field, more particularly, to a kind of based on LabVIEW active reconnections TCP/IP network communication methods.
Background technology
Network service, it is to be attached each isolated equipment by network, is exchanged by information and realize person to person, people With the communication between computer, computer and computer, most important in network service is exactly network communication protocol.Existing net Network agreement is a lot, the most frequently used in LAN to have three procotols:MICROSOFT NETBEUI, NOVELL IPX/SPX And ICP/IP protocol, wherein, only TCP/IP allows to be fully connected with Internet.TCP/IP is provided simultaneously with scalability and can By the demand of property.TCP/IP communication agreement is the most basic agreements of Internet, while is also the basis of Internet.
As a kind of data protocol towards communication, TCP provides reliable data transfer between two computers, and TCP can With ensure data from a grid be sent to another grid when, data can accurately, safety be sent to, it is thus suitable The occasion higher for reliability requirement.In mode of operation, it is connect using I-shaped throttling of reliably enjoying a double blessing, stream byte streams The modes such as mouth.TCP can establish a tunnel between the double hairs of network service, pass through this approach of interface channel, structure Go out a kind of information processing manner of two-way byte stream.
Traditional network service, which is debugged, uses high-level language, such as VC, VB, C#, Java, and these language program codes are superfluous Long, inconvenience carries out functions expanding, if analyzed network communication data, needs to overthrow original program structure, again Work out code.
Compared with traditional programming language, LabVIEW is programmed using figure (i.e. various icons, graphical symbol, line etc.), With programming is succinct, intuitive is strong, human-computer interaction interface is friendly, data visualization is analyzed and the excellent feature of equipment control ability. The existing TCP/IP network services based on LabVIEW programmings have following problem:One, in general TCP/IP network communicating systems When server end constantly writes data using loop structure, client reads less than or read empty data sometimes;Two, work as use When the single server of LabVIEW progress communicates to multi-client, once some or certain several client and servers communications occur Mistake, invalid connection ID will be produced, but the client that server end still makes a mistake to communication continues executing with write-in or read Action is taken, and these write-ins or read action belong to invalid communication operation, and these actions can increase server processor With the occupancy of resource, if server thread is more, the system of may result in smooth can not be run, and delay system operation Slowly;Three, due to the unstability of network in itself, it is easier to by external interference, causes network connection to occur disconnecting or unstable State, and fast automatic can not recover connection.
The content of the invention
In view of this, the present invention is directed to propose a kind of TCP/IP network communication methods based on LabVIEW, existing to solve TCP/IP network services in the client read error that occurs, client make a mistake caused by invalid communication operation and net The problem of network reconnection.
To reach above-mentioned purpose, the technical proposal of the invention is realized in this way:
A kind of TCP/IP network communication methods based on LabVIEW, comprise the following steps:
S1:Hardware system, including server-side computer, chiasma type netting twine, the network switch and an at least visitor are set Family end computer;
By the network interface of the both ends difference connection server end cyber-net interchanger of a chiasma type netting twine, specifically connect Connect 1 pin, 2 pin, 3 pin, 4 pin, 5 pin, 6 pin, 7 pin, 8 pin that mode is chiasma type netting twine one end crystal head and correspond to other end crystal head 3 pin, 6 pin, 1 pin, 7 pin, 8 pin, 2 pin, 4 pin, 5 pin;
The both ends of one chiasma type netting twine are connected to the network interface of client computer and the network switch respectively, specific connection Mode corresponds to other end crystal head for 1 pin, 2 pin, 3 pin, 4 pin, 5 pin, 6 pin, 7 pin, 8 pin of chiasma type netting twine one end crystal head 3 pin, 6 pin, 1 pin, 7 pin, 8 pin, 2 pin, 4 pin, 5 pin;
S21:It is soft in server-side computer load software system, installation LabVIEW softwares, TCP/IP network services driving Part;
S22:Port numbers, establishment are set to wait TCP detectaphone modules in server-side computer by LabVIEW softwares, And then produce and intercept ID;
S23:The connection request for waiting TCP detectaphones module to wait client to send, set and wait TCP detectaphone modules It is 10ms to intercept time-out time;
If waiting TCP detectaphones module intercepting the connection request that listens to client in time-out time, judging should Connection request is effectively connection, accordingly produces a connection ID, connection ID is non-zero numerical value, while gets and send connection request Client remote address, if waiting TCP detectaphone modules to listen to the connection request of multiple client, accordingly produce respectively Raw multiple connection IDs, while obtain the remote address of client;
If wait TCP detectaphones module not intercept client connection request is listened in time-out time if produce time-out Error signal, connection ID value are 0, and confirmation belongs to invalid connection ID, remove error signal and continue executing with wait TCP detectaphone moulds Block, so circulation perform;
S24:TCP read modules, TCP read modules set according to amount of communication data size and read time-out time;
If TCP read modules read data success, server-side computer has been received by TCP data and to the TCP Data carry out data dissection process;
If TCP read modules read data failure, TCP read modules identify wrong cluster information and by wrong cluster information And current connection ID is sent to error handle and ID screening modules;
S25:TCP writing modules, TCP writing modules set write-in time-out time according to amount of communication data size;
It is used for preserving TCP write-in success flags and current standard in the shift register of network service thread creation cluster type The data of standby TCP write-ins, the mark initial value of TCP write-in success or not are set to True, and the data initial value for preparing TCP write-ins is Empty data;
The data of TCP writing modules can be selected to be loaded onto according to write-in success flag, be if writing successfully ident value True, then load new data;If it is False to write successfully ident value, the data in shift register are loaded;Led to The data of letter are also write to shift register while TCP writes, and are updated all the time in such shift register and are saved one Frame data;
If the write-in data success of TCP writing modules, server-side computer have sent TCP data, have been written to simultaneously Work(ident value is that True is write to shift register, if TCP writing modules write data failure, the identification of TCP writing modules Mistake cluster information simultaneously sends wrong cluster information and current connection ID to error handle and ID screening modules, is written to simultaneously Work(ident value is that False is write to shift register;
Judged according to the TCP write-ins frequency of failure and decide whether to load shift register data;
S26:Error handle and ID screening modules, the shift register array of connection ID, initial value are created by LabVIEW It is set to empty, connection ID is added in shift register array when TCP read modules or TCP writing modules run succeeded, when When TCP read modules or TCP writing modules perform failure, specific feelings caused by the error code identification mistake in wrong cluster are utilized Condition, remove wrong cluster information and carry out closing TCP connections processing, the connection ID is not then added in shift register array, complete Screened into ID, retain effective connection ID, close the ID that reports an error;
S31:It is soft in client computer load software system, installation LabVIEW softwares, TCP/IP network services driving Part;
S32:TCP link blocks are created in client computer by LabVIEW softwares, TCP link blocks are opened TCP and connected Connect, address, remote port request connection time-out time are set;
S33:TCP writing modules, TCP writing modules set connection time-out time according to amount of communication data size;
If the write-in data success of TCP writing modules, client computer have sent TCP data;
If TCP writing modules write data failure, TCP writing modules identify wrong cluster information and by wrong cluster information And current connection ID is sent to error handle and ID screening modules;
S34:TCP read modules, TCP read modules set according to amount of communication data size and read time-out time;
If TCP read modules read data success, client computer has been received by TCP data, then can be right The data carry out data dissection process;
If TCP read modules read data failure, TCP read modules identify wrong cluster information and by wrong cluster information And current connection ID is sent to error handle and ID screening modules;
S35:Error handling module, wrong cluster information is removed using the error code identification mistake in wrong cluster.
Further, in addition to step:
S27:TCP close and detectaphone closedown module, it is necessary to exit network communication when, be first shut off detectaphone ID, then All TCP connections are closed, exit network communication thread.
Further, in addition to step:
S36:TCP closedown modules, close TCP connections;
If active client carries out continuous communiction, TCP closedown modules reenter after performing creates TCP connections Module;
If active client carries out discontinuous communication, exit network communication thread.
Further, in the S22 steps, it is 6341 that LabVIEW softwares set port numbers in server-side computer.
Further, the shift register is array type register.
Relative to prior art, the TCP/IP network communication methods of the present invention based on LabVIEW have following excellent Gesture:
Problem present in ICP/IP protocol network service of the invention based on LabVIEW, one kind is devised for problem TCP/IP network connection active reconnecting systems based on LabVIEW.
The data Caching Mechanism of server end is established, server end is ceaselessly updated by the mobile register of loop structure Previous frame data, once error flag occurs in communication connection, server end is by the shift register latest update of loop structure Data are sent to client, and this method to set up can effectively avoid frame losing phenomenon;
ID screenings and fault tolerant mechanism are established, invalid connection ID caused by server end and client communication mistake is sieved Choosing and closing, the client for making server end no longer be made a mistake to communication continue executing with write-in or read action, so can be big The big burden for mitigating server processor, make server-side system operation more smooth;
Circulation reconnection mechanism is established, client, which often carries out one cycle, can all create new connection, even if network connection goes out Now disconnect or unstable state result in present communications connection failure, still, client will also create new in circulate next time Connection, enable the fast quick-recovery of network connection.
The inventive method has stability good and the advantages of reliability is high.
Brief description of the drawings
The accompanying drawing for forming the part of the invention is used for providing further understanding the invention, present invention wound The schematic description and description made is used to explain the invention, does not form the improper restriction to the invention. In accompanying drawing:
Fig. 1 is the signal conveying flow of the TCP/IP network communication methods based on LabVIEW described in the embodiment of the present invention Figure;
Embodiment
It should be noted that in the case where not conflicting, the feature in embodiment and embodiment in the invention can To be mutually combined.
In the description of the invention, it is to be understood that term " " center ", " longitudinal direction ", " transverse direction ", " on ", " under ", The orientation or position relationship of the instruction such as "front", "rear", "left", "right", " vertical ", " level ", " top ", " bottom ", " interior ", " outer " are Based on orientation shown in the drawings or position relationship, it is for only for ease of description the invention and simplifies description, rather than instruction Or imply that signified device or element must have specific orientation, with specific azimuth configuration and operation, therefore be not understood that For the limitation to the invention.In addition, term " first ", " second " etc. are only used for describing purpose, and it is not intended that instruction Or imply relative importance or the implicit quantity for indicating indicated technical characteristic.Thus, " first ", " second " etc. are defined Feature can express or implicitly include one or more this feature.In the description of the invention, unless separately It is described, " multiple " are meant that two or more.
, it is necessary to which explanation, unless otherwise clearly defined and limited, term " are pacified in the description of the invention Dress ", " connected ", " connection " should be interpreted broadly, for example, it may be fixedly connected or be detachably connected, or integratedly Connection;Can be mechanical connection or electrical connection;Can be joined directly together, can also be indirectly connected by intermediary, It can be the connection of two element internals.For the ordinary skill in the art, on being understood by concrete condition State concrete meaning of the term in the invention.
Describe the invention in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
The technical program technical problem to be solved is:The client occurred in existing TCP/IP network services is read Mistake, client make a mistake caused by invalid communication operation influence communication efficiency and the slow of network reconnection is asked Topic.
In order to solve the above-mentioned technical problem, as shown in figure 1, present embodiments providing a kind of TCP/IP based on LabVIEW Network communication method, comprise the following steps:
S1:Hardware system, including server-side computer, chiasma type netting twine, the network switch and an at least visitor are set Family end computer;
By the network interface of the both ends difference connection server end cyber-net interchanger of a chiasma type netting twine, specifically connect Connect 1 pin, 2 pin, 3 pin, 4 pin, 5 pin, 6 pin, 7 pin, 8 pin that mode is chiasma type netting twine one end crystal head and correspond to other end crystal head 3 pin, 6 pin, 1 pin, 7 pin, 8 pin, 2 pin, 4 pin, 5 pin;
The both ends of one chiasma type netting twine are connected to the network interface of client computer and the network switch respectively, specific connection Mode corresponds to other end crystal head for 1 pin, 2 pin, 3 pin, 4 pin, 5 pin, 6 pin, 7 pin, 8 pin of chiasma type netting twine one end crystal head 3 pin, 6 pin, 1 pin, 7 pin, 8 pin, 2 pin, 4 pin, 5 pin;
S21:It is soft in server-side computer load software system, installation LabVIEW softwares, TCP/IP network services driving Part;
S22:Port numbers, establishment are set to wait TCP detectaphone modules in server-side computer by LabVIEW softwares, And then produce and intercept ID;
S23:The connection request for waiting TCP detectaphones module to wait client to send, set and wait TCP detectaphone modules It is 10ms to intercept time-out time;
If waiting TCP detectaphones module intercepting the connection request that listens to client in time-out time, judging should Connection request is effectively connection, accordingly produces a connection ID, connection ID is non-zero numerical value, while gets and send connection request Client remote address, if waiting TCP detectaphone modules to listen to the connection request of multiple client, accordingly produce respectively Raw multiple connection IDs, while obtain the remote address of client;
If wait TCP detectaphones module not intercept client connection request is listened in time-out time if produce time-out Error signal, connection ID value are 0, and confirmation belongs to invalid connection ID, remove error signal and continue executing with wait TCP detectaphone moulds Block, so circulation perform;
S24:TCP read modules, TCP read modules set according to amount of communication data size and read time-out time;
If TCP read modules read data success, server-side computer has been received by TCP data and to the TCP Data carry out data dissection process;
If TCP read modules read data failure, TCP read modules identify wrong cluster information and by wrong cluster information And current connection ID is sent to error handle and ID screening modules;
S25:TCP writing modules, TCP writing modules set write-in time-out time according to amount of communication data size;
This step includes the data Caching Mechanism for establishing server end, comprises the following steps that:
It is used for preserving TCP write-in success flags and current standard in the shift register of network service thread creation cluster type The data of standby TCP write-ins, the mark initial value of TCP write-in success or not are set to True, and the data initial value for preparing TCP write-ins is Empty data;
The data of TCP writing modules can be selected to be loaded onto according to write-in success flag, be if writing successfully ident value True, then load new data;If it is False to write successfully ident value, the data in shift register are loaded;Led to The data of letter are also write to shift register while TCP writes, and are updated all the time in such shift register and are saved one Frame data;
If the write-in data success of TCP writing modules, server-side computer have sent TCP data, have been written to simultaneously Work(ident value is that True is write to shift register, if TCP writing modules write data failure, the identification of TCP writing modules Mistake cluster information simultaneously sends wrong cluster information and current connection ID to error handle and ID screening modules, is written to simultaneously Work(ident value is that False is write to shift register;
Judged according to the TCP write-ins frequency of failure and decide whether to load shift register data;
S26:Error handle and ID screening modules, this step, which includes, establishes ID screenings and fault tolerant mechanism, passes through LabVIEW The shift register array of connection ID is created, initial value is set to empty, when TCP read modules or TCP writing modules run succeeded Connection ID is added in shift register array, when TCP read modules or the execution failure of TCP writing modules, utilizes mistake Concrete condition caused by error code identification mistake in cluster, remove wrong cluster information and carry out closing TCP connections processing, the company Meet ID not being then added in shift register array, complete ID screenings, retain effective connection ID, close the ID that reports an error;
S27:TCP close and detectaphone closedown module, it is necessary to exit network communication when, be first shut off detectaphone ID, then All TCP connections are closed, exit network communication thread;
S31:It is soft in client computer load software system, installation LabVIEW softwares, TCP/IP network services driving Part;
S32:TCP link blocks are created in client computer by LabVIEW softwares, TCP link blocks are opened TCP and connected Connect, address, remote port request connection time-out time are set;
S33:TCP writing modules, this step include establishing circulation reconnection mechanism, and TCP writing modules are according to amount of communication data Size sets connection time-out time;
If the write-in data success of TCP writing modules, client computer have sent TCP data;
If TCP writing modules write data failure, TCP writing modules identify wrong cluster information and by wrong cluster information And current connection ID is sent to error handle and ID screening modules;
S34:TCP read modules, TCP read modules set according to amount of communication data size and read time-out time;
If TCP read modules read data success, client computer has been received by TCP data, then can be right The data carry out data dissection process;
If TCP read modules read data failure, TCP read modules identify wrong cluster information and by wrong cluster information And current connection ID is sent to error handle and ID screening modules;
S35:Error handling module, wrong cluster information is removed using the error code identification mistake in wrong cluster;
S36:TCP closedown modules, close TCP connections.
The technical scheme that the embodiment is provided has the technical effect that:TCP/IP network connections based on LabVIEW are actively Reconnecting system, the system establish the data Caching Mechanism of server end, server end by the mobile register of loop structure not The renewal previous frame data stopped, once there is error flag in communication connection, server end by the shift register of loop structure most The data newly updated are sent to client, and this method to set up can effectively avoid frame losing phenomenon;ID screenings and fault tolerant mechanism are established, will Invalid connection ID caused by server end and client communication mistake is screened and closed, and server end is no longer sent out communication The client of raw mistake continues executing with write-in or read action, can so mitigate the burden of server processor significantly, make clothes The end system operation of business device is more smooth;Circulation reconnection mechanism is established, client, which often carries out one cycle, can all create new connection, i.e., Make that disconnecting occurs in network connection or unstable state result in present communications connection failure, still, client circulates next time In will also create new connection, enable the fast quick-recovery of network connection.
The preferred embodiment of the invention is the foregoing is only, is not intended to limit the invention creation, it is all at this Within the spirit and principle of innovation and creation, any modification, equivalent substitution and improvements made etc., the invention should be included in Protection domain within.

Claims (5)

1. the TCP/IP network communication methods based on LabVIEW, it is characterised in that comprise the following steps:
S1:Hardware system, including server-side computer, chiasma type netting twine, the network switch and an at least client are set Computer;
By the network interface of the both ends difference connection server end cyber-net interchanger of a chiasma type netting twine, specific connection side Formula corresponds to the 3 of other end crystal head for 1 pin, 2 pin, 3 pin, 4 pin, 5 pin, 6 pin, 7 pin, 8 pin of chiasma type netting twine one end crystal head Pin, 6 pin, 1 pin, 7 pin, 8 pin, 2 pin, 4 pin, 5 pin;
The both ends of one chiasma type netting twine are connected to the network interface of client computer and the network switch, specific connected mode respectively For 1 pin of chiasma type netting twine one end crystal head, 2 pin, 3 pin, 4 pin, 5 pin, 6 pin, 7 pin, 8 pin correspond to other end crystal head 3 pin, 6 pin, 1 pin, 7 pin, 8 pin, 2 pin, 4 pin, 5 pin;
S21:In server-side computer load software system, installation LabVIEW softwares, TCP/IP network service drive softwares;
S22:Port numbers, establishment are set to wait TCP detectaphone modules in server-side computer by LabVIEW softwares, and then ID is intercepted in generation;
S23:The connection request for waiting TCP detectaphones module to wait client to send, set and wait intercepting for TCP detectaphone modules Time-out time is 10ms;
If waiting TCP detectaphones module intercepting the connection request that listens to client in time-out time, the connection is judged Ask, effectively to connect, accordingly to produce a connection ID, connection ID is non-zero numerical value, while gets the visitor for sending connection request Family end remote address, if waiting TCP detectaphone modules to listen to the connection request of multiple client, accordingly produce respectively more Individual connection ID, while obtain the remote address of client;
If wait TCP detectaphones module not intercept client connection request is listened in time-out time if produce time-out and report an error Signal, connection ID value are 0, and confirmation belongs to invalid connection ID, remove error signal and continue executing with wait TCP detectaphone modules, So circulation performs;
S24:TCP read modules, TCP read modules set according to amount of communication data size and read time-out time;
If TCP read modules read data success, server-side computer has been received by TCP data and to the TCP data Carry out data dissection process;
If TCP read modules read data failure, TCP read modules identify wrong cluster information and by wrong cluster information and Current connection ID is sent to error handle and ID screening modules;
S25:TCP writing modules, TCP writing modules set write-in time-out time according to amount of communication data size;
It is used for preserving TCP write-in success flags and current preparation in the shift register of network service thread creation cluster type The data of TCP write-ins, the mark initial value of TCP write-in success or not are set to True, and the data initial value for preparing TCP write-ins is sky Data;
The data of TCP writing modules can be selected to be loaded onto according to write-in success flag, if it is True to write successfully ident value, Then load new data;If it is False to write successfully ident value, the data in shift register are loaded;Communicated Data are also write to shift register while TCP writes, and are updated all the time in such shift register and are saved a frame number According to;
If the write-in data success of TCP writing modules, server-side computer has sent TCP data, while writes and successfully mark Knowledge value is that True is write to shift register, if TCP writing modules write data failure, TCP writing modules identification mistake Cluster information simultaneously sends wrong cluster information and current connection ID to error handle and ID screening modules, while writes and successfully mark Knowledge value is that False is write to shift register;
Judged according to the TCP write-ins frequency of failure and decide whether to load shift register data;
S26:Error handle and ID screening modules, the shift register array of connection ID is created by LabVIEW, and initial value is set to Sky, connection ID is added in shift register array when TCP read modules or TCP writing modules run succeeded, when TCP is read When modulus block or TCP writing modules perform failure, concrete condition caused by mistake is identified using the error code in wrong cluster, clearly Except wrong cluster information and carry out closing TCP connections processing, the connection ID is not then added in shift register array, completes ID sieves Choosing, retain effective connection ID, close the ID that reports an error;
S31:In client computer load software system, installation LabVIEW softwares, TCP/IP network service drive softwares;
S32:TCP link blocks are created in client computer by LabVIEW softwares, TCP link blocks open TCP connections, Address, remote port request connection time-out time are set;
S33:TCP writing modules, TCP writing modules set connection time-out time according to amount of communication data size;
If the write-in data success of TCP writing modules, client computer have sent TCP data;
If TCP writing modules write data failure, TCP writing modules identify wrong cluster information and by wrong cluster information and Current connection ID is sent to error handle and ID screening modules;
S34:TCP read modules, TCP read modules set according to amount of communication data size and read time-out time;
If TCP read modules read data success, client computer has been received by TCP data, then can be to the number According to progress data dissection process;
If TCP read modules read data failure, TCP read modules identify wrong cluster information and by wrong cluster information and Current connection ID is sent to error handle and ID screening modules;
S35:Error handling module, wrong cluster information is removed using the error code identification mistake in wrong cluster.
2. the TCP/IP network communication methods according to claim 1 based on LabVIEW, it is characterised in that also include step Suddenly:
S27:TCP close and detectaphone closedown module, it is necessary to exit network communication when, be first shut off detectaphone ID, be then shut off All TCP connections, exit network communication thread.
3. the TCP/IP network communication methods according to claim 1 based on LabVIEW, it is characterised in that:Also include step Suddenly:
S36:TCP closedown modules, close TCP connections;
If active client carries out continuous communiction, TCP closedown modules reenter after performing creates TCP connection moulds Block;
If active client carries out discontinuous communication, exit network communication thread.
4. the TCP/IP network communication methods according to claim 1 based on LabVIEW, it is characterised in that:S22 steps In, it is 6341 that LabVIEW softwares set port numbers in server-side computer.
5. the TCP/IP network communication methods according to claim 1 based on LabVIEW, it is characterised in that:Shift LD Device is array type register.
CN201711107236.5A 2017-11-10 2017-11-10 LabVIEW-based TCP/IP network communication method Active CN107864141B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711107236.5A CN107864141B (en) 2017-11-10 2017-11-10 LabVIEW-based TCP/IP network communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711107236.5A CN107864141B (en) 2017-11-10 2017-11-10 LabVIEW-based TCP/IP network communication method

Publications (2)

Publication Number Publication Date
CN107864141A true CN107864141A (en) 2018-03-30
CN107864141B CN107864141B (en) 2020-05-22

Family

ID=61700149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711107236.5A Active CN107864141B (en) 2017-11-10 2017-11-10 LabVIEW-based TCP/IP network communication method

Country Status (1)

Country Link
CN (1) CN107864141B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602204A (en) * 2019-09-10 2019-12-20 广东技术师范大学 Remote data receiving method, system and terminal based on LabVIEW

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104184772A (en) * 2013-05-25 2014-12-03 海信(山东)空调有限公司 Air-conditioner remote experimental data monitoring method based on Labview platform and system thereof
CN105938464A (en) * 2016-04-14 2016-09-14 北京化工大学 LabVIEW-based accelerometer signal acquisition device and method
CN106525468A (en) * 2016-10-28 2017-03-22 南京工程学院 Labview-based rail vehicle door system monitoring platform and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104184772A (en) * 2013-05-25 2014-12-03 海信(山东)空调有限公司 Air-conditioner remote experimental data monitoring method based on Labview platform and system thereof
CN105938464A (en) * 2016-04-14 2016-09-14 北京化工大学 LabVIEW-based accelerometer signal acquisition device and method
CN106525468A (en) * 2016-10-28 2017-03-22 南京工程学院 Labview-based rail vehicle door system monitoring platform and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
徐超: "LabVIEW在实时测控系统中的应用研究", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》 *
邢立伟: "基于LabVIEW的车身过程设备信息网络化管理系统的研制", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602204A (en) * 2019-09-10 2019-12-20 广东技术师范大学 Remote data receiving method, system and terminal based on LabVIEW

Also Published As

Publication number Publication date
CN107864141B (en) 2020-05-22

Similar Documents

Publication Publication Date Title
CN106657370B (en) Data transmission method and device
CN103404113B (en) A kind of notice method for pushing, device and system
CN108040108A (en) Communication handover method, device, coordination service device and readable storage medium storing program for executing
CN105871743B (en) The machinery of consultation of aggregation port state and device
CN103139039A (en) Virtual network capable of achieving flow isolation control and construction method
AU2012384904A1 (en) Method, device, system and storage medium for implementing packet transmission in PCIE switching network
CN108062230A (en) Serial ports transparent transmission and program updating system and its method in a kind of Internet wide
CN105451299B (en) A kind of method and its electronic equipment controlling WiFi connection
CN101179438A (en) Remote diagnosis system and method
CN105323165A (en) Communication device and multi-hop network
CN109582335A (en) It is a kind of without interrupt storage cluster node online upgrading method, device and equipment
CN103034183A (en) Setting method of field device and setting system of field device
CN108574583A (en) A kind of device updating method and access device
CN107864141A (en) TCP/IP network communication methods based on LabVIEW
CN101540699A (en) Method and device for realizing remote maintenance of network equipment
CN106255172A (en) Communication means based on multipath and device
KR20160022327A (en) Methods for managing transaction in software defined networking network
CN105337801A (en) State machine-based test case design method applicable to switch protocol
CN208597089U (en) A kind of network tunnel automatic switching control equipment based on network quality
CN101540696A (en) Complex dynamic routing analysis method for realizing telecommunication network based on intelligent routing simulation technique
CN106130863A (en) The transfer approach of LAN protocol message, device and system
CN107070872B (en) A kind of data processing method and device for client
CN106936927A (en) A kind of socket communication means based on pc client
CN113138732A (en) Multi-display controller system, access control system, and display controller
CN103338124B (en) The processing method of abnormal chain scission, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant