CN103235533A - Circuit structure and method for achieving data communication between motion control card and terminal block - Google Patents

Circuit structure and method for achieving data communication between motion control card and terminal block Download PDF

Info

Publication number
CN103235533A
CN103235533A CN201310098675XA CN201310098675A CN103235533A CN 103235533 A CN103235533 A CN 103235533A CN 201310098675X A CN201310098675X A CN 201310098675XA CN 201310098675 A CN201310098675 A CN 201310098675A CN 103235533 A CN103235533 A CN 103235533A
Authority
CN
China
Prior art keywords
data
terminal strip
motion control
control card
uart interface
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
CN201310098675XA
Other languages
Chinese (zh)
Other versions
CN103235533B (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.)
Shanghai Weihong Electronic Technology Ltd
Original Assignee
Shanghai Weihong Electronic Technology Ltd
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 Shanghai Weihong Electronic Technology Ltd filed Critical Shanghai Weihong Electronic Technology Ltd
Priority to CN201310098675.XA priority Critical patent/CN103235533B/en
Publication of CN103235533A publication Critical patent/CN103235533A/en
Application granted granted Critical
Publication of CN103235533B publication Critical patent/CN103235533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

The invention relates to a circuit structure and a method for achieving data communication between a motion control card and a terminal block. A host interface of the motion control card is connected with an outer computer, a UART (universal asynchronous receiver) interface of the motion control card is connected with a first UART interface of the terminal block, a second UART interface of the terminal block is connected with a first expansion terminal block UART interface on an expansion terminal block, a second expansion terminal block UART interface on the expansion terminal block is serially connected with the rest expansion terminal blocks in sequence. The invention further relates to the method for achieving data communication between the motion control card and the terminal block by utilizing the circuit structure. By the aid of the circuit structure and the method, the data communication between the motion control card and the terminal block is few in connecting wires, low in cost, and high in integration level of data processing and communication protocol achievement. Equilong data frame transferring is adopted, check information is carried, the data communication has a retransmission mechanism, so data transmission is effective and reliable, fine in performance, simple in design, high in reliability, easy to expand, stable and reliable in working performance, and is wide in application scope.

Description

Realize circuit structure and the method for data communication between motion control card and terminal strip
Technical field
The present invention relates to industrial automation control field, be particularly related to digital control system motion control card control technology field, specifically refer to realize based on asynchronous serial bus in a kind of digital control system circuit structure and the method thereof of data communication between motion control card and the terminal strip.
Background technology
Parallel communications and serial communication dual mode have appearred between motion control card and the terminal strip in the industrial automation control field.Wherein the many employings of parallel communications mode are direct-connected, do not have communication protocol between the two, are simple port data input and output.Interface mode as shown in Figure 1.
The simplicity of design of this kind parallel communications mode, communication speed is very fast, but is not easy to expansion, and the line between integrated circuit board and the terminal strip is more, is subject to disturb, and along with the increase of signal, cost of products is higher.
Along with the raising of manufacturing process, chip speed is more and more faster, and transmission speed no longer is the subject matter of restriction data transmission.In recent years, industrial automation control field serial communication is risen, and as CAN bus, 485 buses, Industrial Ethernet etc., uses the equipment of serial communication mode to emerge in an endless stream.CAN bus and industrial ethernet protocol real-time height, better performances, but its agreement is comparatively complicated, and cost of development is higher.Therefore, press for that a kind of low cost, performance are good, simplicity of design, reliability height, the new communication mechanism that is easy to expand.
Summary of the invention
The objective of the invention is to have overcome above-mentioned shortcoming of the prior art, the circuit structure and the method thereof that provide that a kind of data signaling rate is very fast, agreement are simple, the construction cycle is short, properties of product are reliable, integrated level is higher, extendability is strong, stable and reliable working performance, the scope of application realize data communication between motion control card and the terminal strip comparatively widely in the digital control system based on asynchronous serial bus.
In order to realize above-mentioned purpose, realize that based on asynchronous serial bus circuit structure and the method thereof of data communication between motion control card and the terminal strip are as follows in the digital control system of the present invention:
Realize the circuit structure of data communication between motion control card and the terminal strip in this digital control system based on asynchronous serial bus, comprise motion control card, terminal strip and several extended terminal plates, described motion control card is connected with outer computer, and described motion control card, terminal strip and several extended terminal plates are connected in series successively, its principal feature is, carry host interface and UART interface on the described motion control card, carry terminal strip the one UART interface and terminal strip the 2nd UART interface on the described terminal strip, all carry separately extended terminal plate the one UART interface and extended terminal plate the 2nd UART interface on described each extended terminal plate, the host interface of described motion control card is connected with outer computer, and the UART interface of this motion control card is connected with described terminal strip the one UART interface, described terminal strip the 2nd UART interface is connected with extended terminal plate the one UART interface on the extended terminal plate, and extended terminal plate the 2nd UART interface on this extended terminal plate is connected in series successively with remaining extended terminal plate.
Host interface based on the motion control card in the circuit structure of data communication between asynchronous serial bus realization motion control card and the terminal strip in this digital control system is that the PCI golden finger is transplanted a cutting.
Be the High Speed UART interface based on UART interface and terminal strip the one UART interface in the circuit structure of data communication between asynchronous serial bus realization motion control card and the terminal strip in this digital control system.
This utilizes above-mentioned circuit structure to realize the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the digital control system, comprising motion control card carry out that data receive and send handle operation, terminal strip carries out data and receives response and transmit data processing operation, described motion control card carries out data and receives and send the processing operation, may further comprise the steps:
(11) described motion control card carries out initial configuration and sets timer interrupting;
(12) when timer expiry, start the timer break in service;
(13) judge whether the Frame of receiving that outer computer sends;
(14) if do not receive, then send retransmit frames, and finish; If receive, judge then whether CRC check is correct;
(15) if CRC check is incorrect, then sends retransmit frames, and finish; If CRC check is correct, judge then whether last communication is normal;
(16) if undesired, then finish; If normal, then read the buffering control register, operation is handled in the row buffering of going forward side by side control;
(17) look-up command frame address mapping table;
(18) command frame is packed;
(19) retransmit frames being set is command frame, and is sent to described terminal strip;
Described terminal strip carries out data and receives response and transmit data processing operation, may further comprise the steps:
(21) described terminal strip carries out initial configuration and timer is set interrupting initialization;
(22) when timer expiry, start the timer break in service, will be stored in the corresponding buffer zone from the received data of described terminal strip the one UART interface;
(23) judge whether configuration data start frame;
(24) if arrange then that more new model is effective;
(25) judge whether the data that receive are the OUT Frame;
(26) if it is effective that normal mode then is set;
(27) judge whether to be configuration mode;
(28) if then carry out the terminal strip configuration operation and handle; If not, then carry out data buffer memory and forwarding operational processes;
(29) with the zero clearing of timer variable.
The Frame that carries out in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in this realization digital control system can be data start frame, pulse data frame, OUT frame or growth data frame.
Carry out carrying out initial configuration and setting timer in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in this realization digital control system and interrupt, may further comprise the steps:
(111) described motion control card reads configuration data;
(112) described motion control card is set up mapping table;
(113) retransmit frames being set is initial frame;
(114) time-out time of initialization timing device;
(115) the opening timing device interrupts;
(116) described motion control card carries out data mapping tables calculating.
Operation is handled in the control of carrying out in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in this realization digital control system that cushions, and may further comprise the steps:
(161) described motion control card has judged whether buffering control;
(162) if buffering control is arranged, then continue step (163); If not buffering control then continues step (165);
(163) whether the fifo queue of judging terminal strip pulse data frame expires;
(164) if full, then send the OUT frame, and return above-mentioned steps (17); If discontented, then send the pulse data frame, and return above-mentioned steps (17);
(165) judge that the fifo queue of terminal strip pulse data frame is whether empty;
(166) if empty, then send the pulse data frame, and return above-mentioned steps (17); If not empty, then send the OUT frame, and return above-mentioned steps (17).
The terminal strip that carries out in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in this realization digital control system carries out initial configuration and timer is set interrupting initialization, may further comprise the steps:
(211) open serial ports and interrupt initialization;
(212) judge whether to be in more new model;
(213) if then be configured to upgrade and handle operation;
(214) if not, then carry out the data buffer memory and transmit the processing operation.
Carry out being configured in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in this realization digital control system and upgrade and handle operation, may further comprise the steps:
(2131) judge that flash memory wipes whether not finish and identify ID be native system;
(2132) if, erasing flash memory then;
(2133) judging whether that flash memory is wiped finishes and disposes buffer zone data are arranged;
(2134) if then continue step (2135); If not, then continue step (2137);
(2135) data that will dispose in the buffer zone are written in the flash memory, read back again and more whether with buffer zone in data whether identical;
(2136) if not, it is effective the configuration error sign then to be set;
(2137) whether the address of judging the configuration data buffer zone is that first address and the configuration of wiping do not have mistake;
(2138) if the configuration complement mark then is set effectively and returns step (22); Otherwise directly return step (22).
The data buffer memory that carries out that carries out in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in this realization digital control system is transmitted and is handled operation, may further comprise the steps:
(2141) judge whether interrupt time-out;
(2142) if not, the data of then getting output OUT buffer zone write output OUT port, read input IN port data simultaneously and write input IN buffer zone, and continue step (2144);
(2143) if, then carry out timeout treatment, with corresponding port shutdown, and continue step (2144);
(2144) write data into the transmission buffer zone of terminal strip the one UART interface;
(2145) write data into the transmission buffer zone of terminal strip the 2nd UART interface, and return step (22).
The terminal strip configuration operation that carries out that carries out in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in this realization digital control system is handled, and may further comprise the steps:
(281) judge whether to be the configuration data start frame;
(282) if then continue step (283); If not, then continue step (288);
(283) initializing variable;
(284) configuration information is carried out caching process;
(285) reply answer to described terminal strip the one UART interface;
(286) empty the data of described terminal strip the 2nd UART interface;
(287) send the configuration data start frame to described terminal strip the 2nd UART interface, and return step (29);
(288) configuration information is carried out caching process;
(289) reply answer to described terminal strip the one UART interface;
(2810) judge whether configuration data;
(2811) if then the configuration data buffer mark is effective;
(2812) data of described terminal strip the 2nd UART interface of reception;
(2813) judge whether that data receive successfully and with the CRC check zone bit of downlink communication effectively and the configuration data buffer data effective;
(2814) if not, then continue step (2817); If judge that then the previous frame data are configuration data start frames or wipe sign and finish, and previous frame data downstream system receives;
(2815) if then continue step (2816); If not, then continue step (2817);
(2816) send the configuration data frame to described terminal strip the 2nd UART interface, and return step (29);
(2817) send retransmit frames to described terminal strip the 2nd UART interface, and return step (29).
Carry out carrying out the data buffer memory and transmitting operational processes in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in this realization digital control system, may further comprise the steps:
(291) judge whether to be the data start frame;
(292) if then continue step (293); If not, then continue step (295);
(293) information data of terminal strip is carried out caching process;
(294) reply answer to described terminal strip the one UART interface, and continue step (2911);
(295) judge whether the transmission buffer zone is effective;
(296) if then continue step (297); If not, then continue step (299);
(297) reply the transmission buffer data to described terminal strip the one UART interface;
(298) clear to send buffer zone effective marker, and continue step (2911);
(299) terminal strip is imported the IN data and carried out caching process;
(2910) reply answer to described terminal strip the one UART interface, and continue step (2911);
(2911) it is effective to judge whether successfully to receive data and the CRC check zone bit of described terminal strip the one UART interface;
(2912) if then continue step (2913); If not, then continue step (2917);
(2913) remove error count ErrCnt;
(2914) judge whether effective withdraw from warning EXT_ALARM indicates;
(2915) if then continue step (2921); If not, then reply the transmission buffer data to described terminal strip the one UART interface;
(2916) clear to send buffer zone effective marker, and return above-mentioned steps (29);
(2917) whether misjudgment counting ErrCnt is less than the maximum wrong number of systemic presupposition;
(2918) if not, then continue step (2921); If then continue step (2919);
(2919) error count ErrCnt is increased by 1;
(2920) retransmit frames is returned back to described terminal strip the one UART interface, and return above-mentioned steps (29);
(2921) the data start frame is returned back to described terminal strip the one UART interface, and return above-mentioned steps (29).
The maximum wrong number that carries out in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in this realization digital control system is 100.
The circuit structure and the method thereof that realize data communication between motion control card and the terminal strip in the digital control system of this invention based on asynchronous serial bus have been adopted, owing to wherein adopt and carry out data transmission between serial differential communication mode and the terminal strip, adopt the mode of cascade to carry out the terminal strip expansion between terminal strip and the terminal strip, and adopt the DB9 heart yearn to connect, line is less, cost is lower, and the fpga chip of employing xilinx spantar6 series, the data of total system are handled and communication protocol realizes finishing by FPGA, and integrated level is higher, and Frame adopts the isometric data frame transfer of 16 bytes, carry check informations such as CRC, have retransmission mechanism, guaranteed the effective of data, reliable transmission, performance is good, simplicity of design, the reliability height is easy to expansion, stable and reliable working performance, the scope of application is comparatively extensive.
Description of drawings
Fig. 1 is the communication interface mode synoptic diagram between motion control card of the prior art and the terminal strip.
Fig. 2 is the overall schematic that realizes the circuit structure of data communication between motion control card and the terminal strip in the digital control system of the present invention based on asynchronous serial bus.
Fig. 3 is the overall system architecture synoptic diagram of realizing the circuit structure of data communication between motion control card and the terminal strip in the digital control system of the present invention based on asynchronous serial bus.
Fig. 4 is based on the motion control card function structure synoptic diagram in the circuit structure of data communication between asynchronous serial bus realization motion control card and the terminal strip in the digital control system of the present invention.
Fig. 5 is based on the terminal strip function structure synoptic diagram in the circuit structure of data communication between asynchronous serial bus realization motion control card and the terminal strip in the digital control system of the present invention.
Fig. 6 is based on the motion control card circuit layout structure synoptic diagram in the circuit structure of data communication between asynchronous serial bus realization motion control card and the terminal strip in the digital control system of the present invention.
Fig. 7 is based on the terminal board circuit layout structure synoptic diagram in the circuit structure of data communication between asynchronous serial bus realization motion control card and the terminal strip in the digital control system of the present invention.
Fig. 8 is for carrying out fpga logic functional block diagram in the motion control card in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system of the present invention.
Fig. 9 is for carrying out fpga logic functional block diagram in the terminal strip in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system of the present invention.
Figure 10 is for carrying out Frame communication protocol synoptic diagram in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system of the present invention.
Figure 11 is for carrying out motion control card and terminal strip communication process synoptic diagram in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system of the present invention.
Figure 12 carries out initial configuration and sets timer interrupting process flow diagram for the motion control card that carries out in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system of the present invention.
Figure 13 carries out data and receives and send the interrupt service routine processing flow chart of handling in the operating process for carrying out motion control card in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system of the present invention.
Figure 14 carries out initial configuration and timer is set interrupting initialization flowchart for the terminal strip that carries out in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system of the present invention.
Figure 15 carries out data and receives response and transmit interrupt service routine processing flow chart in the data processing operation process for carrying out terminal strip in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system of the present invention.
Embodiment
In order more to be expressly understood technology contents of the present invention, describe in detail especially exemplified by following examples.
See also Fig. 2 to shown in Figure 7, realize the circuit structure of data communication between motion control card and the terminal strip in this digital control system based on asynchronous serial bus, comprise motion control card, terminal strip and several extended terminal plates, described motion control card is connected with outer computer, and described motion control card, terminal strip and several extended terminal plates are connected in series successively, carry host interface and UART interface on the wherein said motion control card, carry terminal strip the one UART interface and terminal strip the 2nd UART interface on the described terminal strip, all carry separately extended terminal plate the one UART interface and extended terminal plate the 2nd UART interface on described each extended terminal plate, the host interface of described motion control card is connected with outer computer, and the UART interface of this motion control card is connected with described terminal strip the one UART interface, described terminal strip the 2nd UART interface is connected with extended terminal plate the one UART interface on the extended terminal plate, and extended terminal plate the 2nd UART interface on this extended terminal plate is connected in series successively with remaining extended terminal plate.
Wherein, the host interface of described motion control card is transplanted a cutting for the PCI golden finger, and described UART interface and terminal strip the one UART interface are the High Speed UART interface.
See also Fig. 8 again to shown in Figure 15, this utilizes above-mentioned circuit structure to realize the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the digital control system, comprising motion control card carry out that data receive and send handle operation, terminal strip carries out data and receives response and transmit data processing operation, described motion control card carries out data and receives and send the processing operation, may further comprise the steps:
(11) described motion control card carries out initial configuration and sets timer interrupting, and may further comprise the steps:
(a) described motion control card reads configuration data;
(b) described motion control card is set up mapping table;
(c) retransmit frames being set is initial frame;
(d) time-out time of initialization timing device;
(e) the opening timing device interrupts;
(f) described motion control card carries out data mapping tables calculating;
(12) when timer expiry, start the timer break in service;
(13) judge whether the Frame of receiving that outer computer sends; This Frame can be data start frame, pulse data frame, OUT frame or growth data frame;
(14) if do not receive, then send retransmit frames, and finish; If receive, judge then whether CRC check is correct;
(15) if CRC check is incorrect, then sends retransmit frames, and finish; If CRC check is correct, judge then whether last communication is normal;
(16) if undesired, then finish; If normal, then read the buffering control register, operation is handled in the row buffering of going forward side by side control; This cushions control and handles operation, may further comprise the steps:
(a) described motion control card has judged whether buffering control;
(b) if buffering control is arranged, then continue step (c); If not buffering control then continues step (e);
(c) whether the fifo queue of judging terminal strip pulse data frame expires;
(d) if full, then send the OUT frame, and return step (17); If discontented, then send the pulse data frame, and return step (17);
(e) judge that the fifo queue of terminal strip pulse data frame is whether empty;
(f) if empty, then send the pulse data frame, and return step (17); If not empty, then send the OUT frame, and return step (17);
(17) look-up command frame address mapping table;
(18) command frame is packed;
(19) retransmit frames being set is command frame, and is sent to described terminal strip;
Described terminal strip carries out data and receives response and transmit data processing operation, may further comprise the steps:
(21) described terminal strip carries out initial configuration and timer is set interrupting initialization, may further comprise the steps:
(a) open serial ports and interrupt initialization;
(b) judge whether to be in more new model;
(c) if, then be configured and upgrade handle operation, may further comprise the steps:
(i) judge that flash memory wipes whether not finish and identify ID be native system;
(ii) if, erasing flash memory then;
Judging whether (iii) that flash memory is wiped finishes and disposes buffer zone data are arranged;
(iv) if then continue step (v); If not, then continue step (vii);
(data that v) will dispose in the buffer zone are written in the flash memory, read back again and more whether with buffer zone in data whether identical;
(it is effective vi) if not, the configuration error sign to be set then;
(whether the address of vii) judging the configuration data buffer zone is that first address and the configuration of wiping do not have mistake;
(viii) if the configuration complement mark then is set effectively and returns step (22); Otherwise directly return step (22);
(d) if not, then carry out the data buffer memory and transmit the processing operation, may further comprise the steps:
(i) judge whether interrupt time-out;
(ii) if not, the data of then getting output OUT buffer zone write output OUT port, read input IN port data simultaneously and write input IN buffer zone, and continue step (iv);
(iii) if, then carry out timeout treatment, with corresponding port shutdown, and continue step (iv);
(iv) write data into the transmission buffer zone of terminal strip the one UART interface;
(v) write data into the transmission buffer zone of terminal strip the 2nd UART interface, and return step (22);
(22) when timer expiry, start the timer break in service, will be stored in the corresponding buffer zone from the received data of described terminal strip the one UART interface;
(23) judge whether configuration data start frame;
(24) if arrange then that more new model is effective;
(25) judge whether the data that receive are the OUT Frame;
(26) if it is effective that normal mode then is set;
(27) judge whether to be configuration mode;
(28) if then carry out the terminal strip configuration operation and handle; If not, then carry out data buffer memory and forwarding operational processes; This carries out the terminal strip configuration operation handles, and may further comprise the steps:
(i) judge whether to be the configuration data start frame;
(ii) if then continue step (iii); If not, then continue step (viii);
(iii) initializing variable;
(iv) configuration information is carried out caching process;
(v) reply answer to described terminal strip the one UART interface;
(vi) empty the data of described terminal strip the 2nd UART interface;
(vii) send the configuration data start frame to described terminal strip the 2nd UART interface, and return step (29);
(viii) configuration information is carried out caching process;
(ix) reply answer to described terminal strip the one UART interface;
(x) judge whether configuration data;
(xi) if then the configuration data buffer mark is effective;
(xii) data of described terminal strip the 2nd UART interface of reception;
(xiii) judge whether that data receive successfully and with the CRC check zone bit of downlink communication effectively and the configuration data buffer data effective;
(xiv) if not, then continue step (xvii); If judge that then the previous frame data are configuration data start frames or wipe sign and finish, and previous frame data downstream system receives;
(xv) if then continue step (xvi); If not, then continue step (xvii);
(xvi) send the configuration data frame to described terminal strip the 2nd UART interface, and return step (29);
(xvii) send retransmit frames to described terminal strip the 2nd UART interface, and return step (29); This carries out the data buffer memory and transmits operational processes, may further comprise the steps:
(I) judge whether to be the data start frame;
(II) if then continue step (III); If not, then continue step (V);
(III) information data of terminal strip is carried out caching process;
(IV) reply answer to described terminal strip the one UART interface, and continue step (XI);
(V) judge whether the transmission buffer zone is effective;
(VI) if then continue step (VII); If not, then continue step (IX);
(VII) reply the transmission buffer data to described terminal strip the one UART interface;
(VIII) clear to send buffer zone effective marker, and continue step (XI);
(IX) terminal strip is imported the IN data and carried out caching process;
(X) reply answer to described terminal strip the one UART interface, and continue step (XI);
(XI) it is effective to judge whether successfully to receive data and the CRC check zone bit of described terminal strip the one UART interface;
(XII) if then continue step (XIII); If not, then continue step (XVII);
(XIII) remove error count ErrCnt;
(XIV) judge whether effective withdraw from warning EXT_ALARM indicates;
(XV) if then continue step (XXI); If not, then reply the transmission buffer data to described terminal strip the one UART interface;
(XVI) clear to send buffer zone effective marker, and return above-mentioned steps (29);
(XVII) whether misjudgment counting ErrCnt is less than the maximum wrong number of systemic presupposition; The maximum wrong number that carries out in the method for data communication between motion control card and the terminal strip based on asynchronous serial bus in this realization digital control system is 100;
(XVIII) if not, then continue step (XXI); If then continue step (XIV);
(XIX) error count ErrCnt is increased by 1;
(XX) retransmit frames is returned back to described terminal strip the one UART interface, and return above-mentioned steps (29);
(XXI) the data start frame is returned back to described terminal strip the one UART interface, and return above-mentioned steps (29).(29) with the zero clearing of timer variable.
In the middle of reality was used, total system of the present invention adopted the DB9 heart yearn to connect, and line is less, and cost is lower.
Wherein adopt the fpga chip of xilinx spantar6 series, the data of total system are handled and communication protocol realizes finishing by FPGA, and integrated level is higher.
Please consult shown in Figure 5ly again, adopt cascade system to expand between each terminal strip, adopt the difference serial bus communication, transmit in the mode of Frame.
See also shown in Figure 8 again, it is motion control card fpga logic functional block diagram, wherein, Uart IP be responsible for setting up the data transmission between microblaze processor and the PC system and set up control card and terminal strip between data transmission, Timer IP realizes regularly interrupting.Whole architecture design is simple, and it is less to take resource, is easy to realize.
See also shown in Figure 9ly again, it is terminal strip fpga logic functional block diagram, and wherein, framework is identical with the motion control card architecture, Duos a Uart IP than motion control card.Uart IP 0 is responsible for receiving the data transmission of motion control card, and Uart IP 1 is responsible for the data communication of descending extended terminal plate.Different with motion control card is, motion control card adopts regularly and interrupts, and the reception of terminal strip sampling Uart IP is interrupted, and all data transmission all have control card to initiate, and terminal strip is responsible for receiving and making corresponding response.
The Frame communication protocol that adopts in the method for the present invention is asked for an interview shown in Figure 10, and wherein, Frame adopts the isometric data frame transfer of 16 bytes, carries check informations such as CRC, has retransmission mechanism, guarantees effective, the reliable transmission of data.
Control card and terminal strip all adopt 4 laminate placement-and-routings, have stronger antijamming capability.
All use soft-core processor microblaze to be responsible for communicating by letter in motion control card and the terminal strip and corresponding data is handled, code uses the C language compilation, and its communication process sees also shown in Figure 11.
Wherein, the own I/O of active management oneself in every terminal strip application program, interrupt service routine is responsible for uplink and downlink communication.Interrupt service routine receives the data from up serial port earlier, and it is write the shared drive zone, reads corresponding data frame answer uplink port in response according to frame format from internal memory then; Then receive the data of descending serial port again, write the shared drive zone, read corresponding data in the shared region then and send to descending serial port, interrupt service routine finishes.
Data transmission adopts 10MHz serial ports transfer rate, and the form transmission with 16 byte data frames had both guaranteed processing request, can guarantee the higher data communication cycle again, and its data frame format is as shown in the table:
Figure BDA00002963943500121
As above shown in the table, the valid data of 12 bytes can be carried at most at every turn, processing request can be satisfied.
See also shown in Figure 12ly again, the control card processor is responsible for receiving the data from the PC control system, through sending data to terminal strip after the respective handling.
" packing " task of all Frames is finished by the soft-core processor in the integrated circuit board in this control card agreement, read the data of PC software transmission in the appropriate address of integrated circuit board soft-core processor from FPGA, and data are formed the form of Frame by corresponding computing according to the integrated circuit board type configuration information in the SPI Flash configuring chip.
See also shown in Figure 13ly again, wherein, the Frame that soft-core processor sends in the control card interrupt service routine has 4 kinds, and it is respectively: start frame, pulse data frame, OUT frame, expansion frame.The soft-core processor of terminal strip is replied corresponding responsive data frame according to the data frame type that integrated circuit board sends.All data transmit by the integrated circuit board processor and initiate, and the soft-core processor of terminal strip is just made respective response according to data frame type, do not allow to send Frame from the trend integrated circuit board.The responsive data frame that terminal strip is replied has 8 kinds, and it is respectively a feedback data frame (5 totally 5 frames), IN Frame (comprising handwheel AB phase data), expansion frame (reserving 2 frames).
See also shown in Figure 14ly again, described terminal strip is responsible for receiving data transmission that control card initiates and is responded to control card, and next stage is initiated data transmission from terminal strip.
Please participate in shown in Figure 15ly again, wherein, the terminal strip communication protocol stack can be supported the dynamic hot plug of terminal strip, and extended terminal plate number can dynamic change, identifies the quantity of current link daughter board with notice PC software systems.
Used technique scheme of the present invention, had the following advantages:
(1) function-stable: control card and ncStudio software are used, operation G code file " The Orchid Pavilion collection order .nc ", cyclic process 10 hours, processing effect is good, not pulse-losing.
(2) good reliability: EMC test result:
EFT(electrical fast transient (eft) noise immunity), ± 2KV.
ESD(static discharge noise immunity), ± 8KV.
The SOUGE(lightning surge), ± 2KV.
The circuit structure and the method thereof that realize data communication between motion control card and the terminal strip in the above-mentioned digital control system based on asynchronous serial bus have been adopted, owing to wherein adopt and carry out data transmission between serial differential communication mode and the terminal strip, adopt the mode of cascade to carry out the terminal strip expansion between terminal strip and the terminal strip, and adopt the DB9 heart yearn to connect, line is less, cost is lower, and the fpga chip of employing xilinx spantar6 series, the data of total system are handled and communication protocol realizes finishing by FPGA, and integrated level is higher, and Frame adopts the isometric data frame transfer of 16 bytes, carry check informations such as CRC, have retransmission mechanism, guaranteed the effective of data, reliable transmission, performance is good, simplicity of design, the reliability height is easy to expansion, stable and reliable working performance, the scope of application is comparatively extensive.
In this instructions, the present invention is described with reference to its certain embodiments.But, still can make various modifications and conversion obviously and not deviate from the spirit and scope of the present invention.Therefore, instructions and accompanying drawing are regarded in an illustrative, rather than a restrictive.

Claims (13)

1. realize the circuit structure of data communication between motion control card and the terminal strip in the digital control system based on asynchronous serial bus, comprise motion control card, terminal strip and several extended terminal plates, described motion control card is connected with outer computer, and described motion control card, terminal strip and several extended terminal plates are connected in series successively, it is characterized in that, carry host interface and UART interface on the described motion control card, carry terminal strip the one UART interface and terminal strip the 2nd UART interface on the described terminal strip, all carry separately extended terminal plate the one UART interface and extended terminal plate the 2nd UART interface on described each extended terminal plate, the host interface of described motion control card is connected with outer computer, and the UART interface of this motion control card is connected with described terminal strip the one UART interface, described terminal strip the 2nd UART interface is connected with extended terminal plate the one UART interface on the extended terminal plate, and extended terminal plate the 2nd UART interface on this extended terminal plate is connected in series successively with remaining extended terminal plate.
2. realize the circuit structure of data communication between motion control card and the terminal strip in the digital control system according to claim 1 based on asynchronous serial bus, it is characterized in that the host interface of described motion control card is transplanted a cutting for the PCI golden finger.
3. realize the circuit structure of data communication between motion control card and the terminal strip in the digital control system according to claim 1 and 2 based on asynchronous serial bus, it is characterized in that described UART interface and terminal strip the one UART interface are the High Speed UART interface.
4. one kind is utilized the described circuit structure of claim 1 to realize the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the digital control system, it is characterized in that, described method comprise motion control card carry out that data receive and send handle operation, terminal strip carries out data and receives response and transmit data processing operation, described motion control card carries out data and receives and send the processing operation, may further comprise the steps:
(11) described motion control card carries out initial configuration and sets timer interrupting;
(12) when timer expiry, start the timer break in service;
(13) judge whether the Frame of receiving that outer computer sends;
(14) if do not receive, then send retransmit frames, and finish; If receive, judge then whether CRC check is correct;
(15) if CRC check is incorrect, then sends retransmit frames, and finish; If CRC check is correct, judge then whether last communication is normal;
(16) if undesired, then finish; If normal, then read the buffering control register, operation is handled in the row buffering of going forward side by side control;
(17) look-up command frame address mapping table;
(18) command frame is packed;
(19) retransmit frames being set is command frame, and is sent to described terminal strip;
Described terminal strip carries out data and receives response and transmit data processing operation, may further comprise the steps:
(21) described terminal strip carries out initial configuration and timer is set interrupting initialization;
(22) when timer expiry, start the timer break in service, will be stored in the corresponding buffer zone from the received data of described terminal strip the one UART interface;
(23) judge whether configuration data start frame;
(24) if arrange then that more new model is effective;
(25) judge whether the data that receive are the OUT Frame;
(26) if it is effective that normal mode then is set;
(27) judge whether to be configuration mode;
(28) if then carry out the terminal strip configuration operation and handle; If not, then carry out data buffer memory and forwarding operational processes;
(29) with the zero clearing of timer variable.
5. the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system according to claim 4, it is characterized in that described Frame is data start frame, pulse data frame, OUT frame or growth data frame.
6. the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system according to claim 5 is characterized in that, describedly carries out initial configuration and set timer interrupting, and may further comprise the steps:
(111) described motion control card reads configuration data;
(112) described motion control card is set up mapping table;
(113) retransmit frames being set is initial frame;
(114) time-out time of initialization timing device;
(115) the opening timing device interrupts;
(116) described motion control card carries out data mapping tables calculating.
7. the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system according to claim 6 is characterized in that, the described buffering controlled the processing operation, may further comprise the steps:
(161) described motion control card has judged whether buffering control;
(162) if buffering control is arranged, then continue step (163); If not buffering control then continues step (165);
(163) whether the fifo queue of judging terminal strip pulse data frame expires;
(164) if full, then send the OUT frame, and return above-mentioned steps (17); If discontented, then send the pulse data frame, and return above-mentioned steps (17);
(165) judge that the fifo queue of terminal strip pulse data frame is whether empty;
(166) if empty, then send the pulse data frame, and return above-mentioned steps (17); If not empty, then send the OUT frame, and return above-mentioned steps (17).
8. the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system according to claim 5, it is characterized in that, described terminal strip carries out initial configuration and timer is set interrupting initialization, may further comprise the steps:
(211) open serial ports and interrupt initialization;
(212) judge whether to be in more new model;
(213) if then be configured to upgrade and handle operation;
(214) if not, then carry out the data buffer memory and transmit the processing operation.
9. the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system according to claim 8 is characterized in that, described being configured upgraded the processing operation, may further comprise the steps:
(2131) judge that flash memory wipes whether not finish and identify ID be native system;
(2132) if, erasing flash memory then;
(2133) judging whether that flash memory is wiped finishes and disposes buffer zone data are arranged;
(2134) if then continue step (2135); If not, then continue step (2137);
(2135) data that will dispose in the buffer zone are written in the flash memory, read back again and more whether with buffer zone in data whether identical;
(2136) if not, it is effective the configuration error sign then to be set;
(2137) whether the address of judging the configuration data buffer zone is that first address and the configuration of wiping do not have mistake;
(2138) if the configuration complement mark then is set effectively and returns step (22); Otherwise directly return step (22).
10. the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system according to claim 8 is characterized in that, the described data buffer memory that carries out is transmitted the processing operation, may further comprise the steps:
(2141) judge whether interrupt time-out;
(2142) if not, the data of then getting output OUT buffer zone write output OUT port, read input IN port data simultaneously and write input IN buffer zone, and continue step (2144);
(2143) if, then carry out timeout treatment, with corresponding port shutdown, and continue step (2144);
(2144) write data into the transmission buffer zone of terminal strip the one UART interface;
(2145) write data into the transmission buffer zone of terminal strip the 2nd UART interface, and return step (22).
11. the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system according to claim 5 is characterized in that, the described terminal strip configuration operation that carries out is handled, and may further comprise the steps:
(281) judge whether to be the configuration data start frame;
(282) if then continue step (283); If not, then continue step (288);
(283) initializing variable;
(284) configuration information is carried out caching process;
(285) reply answer to described terminal strip the one UART interface;
(286) empty the data of described terminal strip the 2nd UART interface;
(287) send the configuration data start frame to described terminal strip the 2nd UART interface, and return step (29);
(288) configuration information is carried out caching process;
(289) reply answer to described terminal strip the one UART interface;
(2810) judge whether configuration data;
(2811) if then the configuration data buffer mark is effective;
(2812) data of described terminal strip the 2nd UART interface of reception;
(2813) judge whether that data receive successfully and with the CRC check zone bit of downlink communication effectively and the configuration data buffer data effective;
(2814) if not, then continue step (2817); If judge that then the previous frame data are configuration data start frames or wipe sign and finish, and previous frame data downstream system receives;
(2815) if then continue step (2816); If not, then continue step (2817);
(2816) send the configuration data frame to described terminal strip the 2nd UART interface, and return step (29);
(2817) send retransmit frames to described terminal strip the 2nd UART interface, and return step (29).
12. the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system according to claim 5 is characterized in that, described data buffer memory and the forwarding operational processes of carrying out may further comprise the steps:
(291) judge whether to be the data start frame;
(292) if then continue step (293); If not, then continue step (295);
(293) information data of terminal strip is carried out caching process;
(294) reply answer to described terminal strip the one UART interface, and continue step (2911);
(295) judge whether the transmission buffer zone is effective;
(296) if then continue step (297); If not, then continue step (299);
(297) reply the transmission buffer data to described terminal strip the one UART interface;
(298) clear to send buffer zone effective marker, and continue step (2911);
(299) terminal strip is imported the IN data and carried out caching process;
(2910) reply answer to described terminal strip the one UART interface, and continue step (2911);
(2911) it is effective to judge whether successfully to receive data and the CRC check zone bit of described terminal strip the one UART interface;
(2912) if then continue step (2913); If not, then continue step (2917);
(2913) remove error count ErrCnt;
(2914) judge whether effective withdraw from warning EXT_ALARM indicates;
(2915) if then continue step (2921); If not, then reply the transmission buffer data to described terminal strip the one UART interface;
(2916) clear to send buffer zone effective marker, and return above-mentioned steps (29);
(2917) whether misjudgment counting ErrCnt is less than the maximum wrong number of systemic presupposition;
(2918) if not, then continue step (2921); If then continue step (2919);
(2919) error count ErrCnt is increased by 1;
(2920) retransmit frames is returned back to described terminal strip the one UART interface, and return above-mentioned steps (29);
(2921) the data start frame is returned back to described terminal strip the one UART interface, and return above-mentioned steps (29).
13. the method for carrying out data communication between motion control card and the terminal strip based on asynchronous serial bus in the realization digital control system according to claim 12 is characterized in that, the wrong number of described maximum is 100.
CN201310098675.XA 2013-03-26 2013-03-26 Circuit structure and method for achieving data communication between motion control card and terminal block Active CN103235533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310098675.XA CN103235533B (en) 2013-03-26 2013-03-26 Circuit structure and method for achieving data communication between motion control card and terminal block

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310098675.XA CN103235533B (en) 2013-03-26 2013-03-26 Circuit structure and method for achieving data communication between motion control card and terminal block

Publications (2)

Publication Number Publication Date
CN103235533A true CN103235533A (en) 2013-08-07
CN103235533B CN103235533B (en) 2015-07-22

Family

ID=48883580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310098675.XA Active CN103235533B (en) 2013-03-26 2013-03-26 Circuit structure and method for achieving data communication between motion control card and terminal block

Country Status (1)

Country Link
CN (1) CN103235533B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209539A (en) * 2015-05-07 2016-12-07 北京热刺激光技术有限责任公司 A kind of N-BUS bus network for digital control system
CN109240947A (en) * 2018-08-13 2019-01-18 武汉普利商用机器有限公司 Intelligent card data method of reseptance and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470436A (en) * 2007-12-28 2009-07-01 中国科学院沈阳计算技术研究所有限公司 Shaft movement control card with absolute coding value receiving function and its data conversion method
US7944708B2 (en) * 2008-03-28 2011-05-17 Chi-Hsin Lin Structured light-emitting module for lighting apparatus
CN102243485A (en) * 2011-07-18 2011-11-16 唐山奥力科技有限公司 PLC (Programmable Logic Controller) extended output circuit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470436A (en) * 2007-12-28 2009-07-01 中国科学院沈阳计算技术研究所有限公司 Shaft movement control card with absolute coding value receiving function and its data conversion method
US7944708B2 (en) * 2008-03-28 2011-05-17 Chi-Hsin Lin Structured light-emitting module for lighting apparatus
CN102243485A (en) * 2011-07-18 2011-11-16 唐山奥力科技有限公司 PLC (Programmable Logic Controller) extended output circuit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209539A (en) * 2015-05-07 2016-12-07 北京热刺激光技术有限责任公司 A kind of N-BUS bus network for digital control system
CN109240947A (en) * 2018-08-13 2019-01-18 武汉普利商用机器有限公司 Intelligent card data method of reseptance and device

Also Published As

Publication number Publication date
CN103235533B (en) 2015-07-22

Similar Documents

Publication Publication Date Title
JP7155353B2 (en) Memory card
CN103888293A (en) Data channel scheduling method of multichannel FC network data simulation system
CN103914424A (en) Method and device for expanding LPC (linear predictive coding) peripheral on basis of GPIO (general purpose input/output) interface
CN202838316U (en) System and device capable of reducing total quantity of input terminals and output terminals of mobile device processor
CN103744811A (en) Serial data transmission system and method
CN104156333A (en) FPGA-based UART multi-interface extension system and method
US7028111B2 (en) Bus system and bus interface for connection to a bus
CN101221550A (en) Method and chip for serial communication
CN104714907A (en) Design method for converting PCI bus into ISA bus or APB bus
CN103235533A (en) Circuit structure and method for achieving data communication between motion control card and terminal block
EP2699030A1 (en) Route switching device, network switching system and route switching method
CN115396527A (en) PCIE and SRIO protocol conversion system and method based on FPGA
CN103914427A (en) On-chip communication method and on-chip communication device on basis of three physical interconnection lines for integrated circuits
CN104598420A (en) SoC chip architecture of 1394 bus
CN107070937B (en) FPGA-based protocol conversion device and method
CN111274194A (en) Data processing apparatus and control method thereof
CN101557275B (en) Method and device for fluid controller information transfer in interconnection application
CN101902436A (en) Interplate communication method, device and system
CN111030904B (en) Multi-path CAN bus message real-time processing method under multi-level communication
US20090327539A1 (en) Multiple Die System Status Communication System
CN112153066A (en) Wireless broadband ad hoc network communication information processing system
CN113110950A (en) Processor, communication method, storage medium, and computing device
CN208190652U (en) A kind of mainboard of full duplex Universal Synchronous Asynchronous serial transceiver
CN218768127U (en) PCIe interface based on XDMA core
CN217821596U (en) SDR heterogeneous prototype system based on FPGA

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant