Method for preventing 1553B RT end communication first frame from being lost
By sending all zero data frames and delay mechanisms in 1553B bus communication, the data first frame loss problem caused by competition access or initial timing mismatch in communication between the RT and BC is solved, and the reliability and stability of the communication are improved.
Patent Information
- Application Number
- CN202510203270.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-05-13
AI Technical Summary
In the prior art, when the 1553B RT end communicates with the BC end, the data first frame is easily lost due to competition access or the initial timing mismatch.
Before the RT end sends the first frame of official data to the BC end, make sure to send a communication data frame with all 0 data, and determine whether delay is required based on the time interval of the received periodic polling instruction to adjust the timing between the RT end and the BC end.
It effectively improves the reliability and stability of 1553B bus communication, eliminates data first frame loss caused by competition access or initial timing mismatch, and does not require hardware or structure modification.
Smart Images

Figure CN119996109A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of bus transmission, and in particular to a method for preventing the first frame loss of 1553B RT end communication. Background Art
[0002] 1553B bus is the abbreviation of the US military standard MIL-STD-1553B bus. It was proposed to meet the needs of industry and military. It has the longest application time and has high reliability and flexibility. In addition, the technology is relatively mature, so 1553B bus has been widely used in military, industrial and scientific fields. With the increasing degree of system integration, the data transmission capacity has been greatly improved. It uses a shielded twisted pair serial data bus, a time-division command / response transmission protocol, a transmission rate of 1M / S, and a half-duplex transmission mode. Its form is similar to a local area network.
[0003] At present, the most widely used bus controllers in the aerospace industry and military fields are 61580, 65170, 61585, 64843, etc. In the application process of 1553B bus controller, the internal registers or memory are configured and data is written and read through the main controller (such as MCU, DSP, FPGA, etc.). When the 1553B bus controller reads and writes the internal registers and shared RAM through the fixed read and write cycle of the software program, the following problems will occur. On the one hand, when competitive access occurs, loss may occasionally occur, which mainly occurs when the BC end (bus control end) reads the first frame of data sent by a RT end (remote terminal). On the other hand, before the first frame communication is established, the RT end timing and the BC end timing have not yet matched, which may also be a possible reason for the loss of the first frame. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is: how to provide a method for preventing the loss of the first frame of 1553B RT communication by eliminating the accidental loss of data frames transmitted from the RT end, especially the first frame of data, caused by contention for access or mismatch in the initial timing between the RT end and the BC end.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions: A method for preventing the first frame loss of 1553B RT communication, the method comprising the following steps: Step 1) Turn on the RT, complete initialization, and start the communication thread; Step 2) Whether the RT end receives the periodic polling instruction sent by the BC end; Step 3) When the RT receives the periodic polling instruction from the BC, the RT judges the periodic polling instruction according to the set conditions. When the periodic polling instruction meets the set conditions, step 4 is executed. When the periodic polling instruction does not meet the set conditions, step 8 is executed); Step 4) The RT sends the agreed command or mode code indicating the first case to the BC; Step 5) RT forms a frame of data message and sends it to BC, and records the current time t1; Step 6) When the RT receives the periodic polling instruction from the BC again, it records the current time t2 and determines whether a delay is needed based on the relationship between t2 and t1; Step 7) The RT sends the agreed command or mode code in the second case to the BC, and then returns to execute step 2); Step 8) Transmit data in the normal way and return to step 2) after the transmission is completed.
[0006] Preferably, in step 3), the condition is set as whether the RT end receives the periodic polling instruction from the BC end for the first time. If the periodic polling instruction is received by the RT end for the first time, step 4) is executed; if the periodic polling instruction is not received by the RT end for the first time, step 8) is executed.
[0007] Preferably, in step 4), the first case is that the RT end has data to send to the BC end in this communication cycle, so as to indicate to the BC end that it needs to receive the data sent by the RT end.
[0008] Preferably, in step 5), each word in the data message sent by the RT end to the BC end is 0x0.
[0009] Preferably, in step 6), when t2-t1 is less than the period t, step 7 is executed after a delay of t-(t2-t1); when t2-t1 is greater than or equal to the period t, step 7 is executed directly without delay.
[0010] Preferably, in step 7), the second situation is that the sending of the current data from the RT end to the BC end is completed.
[0011] Preferably, step 8) includes the following steps: Step 8.1) Is there any message to be sent in the current sending queue? If not, execute step 8.2. If yes, execute step 8.3); Step 8.2) The RT sends a command or mode code without a data frame to the BC, and then returns to execute step 2); Step 8.3) The RT sends a command or mode code with a data frame to the BC; Step 8.4) Select a message to be sent from the queue popup and send it to the BC end, then return to step 2).
[0012] Compared with the prior art, the present invention has the following advantages: 1. The present invention ensures that a communication data frame with all data of 0 is sent before the RT end sends the first frame of formal data to the BC end, and basically ensures that it is received by the BC end, so as to adjust the timing between the RT end and the BC end. A large number of experiments have proved that before the actual communication of the first data frame, the time interval for the RT end to read the periodic polling instruction is very different from the actual cycle. Only after the first frame is basically ensured to be sent can the time interval for the RT end to read the periodic polling instruction be guaranteed to be consistent with the actual cycle.
[0013] 2. The method of the present invention can effectively improve the reliability and stability of 1553B bus communication, especially eliminate the phenomenon of accidental loss of data frames transmitted by RT, especially the first frame of data, caused by competitive access or initial timing mismatch between RT and BC.
[0014] 3. The implementation of the method of the present invention does not require modification of hardware or structure, thereby improving product reliability while ensuring product cost.
[0015] 4. The method of the present invention has been verified in engineering. A large number of land trials and sea trials have proved that the present invention can avoid the problem of loss of BC-side reading of RT-side data frames, especially the first communication frame. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flow chart of a method for preventing the first frame loss of 1553B RT communication in the present invention; Figure 2 This is a schematic diagram of the communication interface between the 1553B RT and BC ends. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0018] It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. In the description of the present invention, it should be noted that the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, or the orientation or position relationship in which the invention product is usually placed when used, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance. In addition, the terms "horizontal", "vertical", etc. do not mean that the components are required to be absolutely horizontal or suspended, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", and does not mean that the structure must be completely horizontal, but can be slightly tilted. In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0019] As attached Figure 1 As shown, the present invention provides a method for preventing the first frame loss of 1553B RT end communication, the method comprising the following steps: Step 1) Turn on the RT (remote terminal), complete initialization, and start the communication thread.
[0020] Step 2) Check whether the RT receives the periodic polling instruction sent by the BC (bus controller).
[0021] Step 3) The RT end continuously receives the periodic polling instruction sent by the BC end. When the RT end receives the periodic polling instruction from the BC end, the RT end judges the periodic polling instruction according to the set conditions. When the periodic polling instruction meets the set conditions, step 4 is executed. When the periodic polling instruction does not meet the set conditions, step 8 is executed. In this specific embodiment, the set condition is whether the RT end receives the periodic polling instruction from the BC end for the first time. If the periodic polling instruction is received by the RT end for the first time, step 4 is executed. If the periodic polling instruction is not received by the RT end for the first time, step 8 is executed.
[0022] Step 4) The RT end sends an agreed command or mode code indicating the first case to the BC end; in this specific embodiment, the first case is that the RT end has data to send to the BC end during this communication cycle to indicate to the BC end that it needs to receive the data sent by the RT end.
[0023] Step 5) The RT end composes a frame of data message and sends it to the BC end, and records the current time t1; in this specific embodiment, each word in the data message sent by the RT end to the BC end is 0x0. This is a key step. Before the formal command, a frame of data with all 0s is sent to the BC end, and the frame length is determined according to the normal frame length.
[0024] Step 6) When the RT end receives the periodic polling instruction from the BC end again, it records the current time t2, and determines whether a delay is needed based on the relationship between t2 and t1; in this specific embodiment, when t2-t1 is less than the period t, step 7 is executed after a delay of t-(t2-t1) time); when t2-t1 is greater than or equal to the period t, step 7 is executed directly without delay). This step is used to ensure that data frames with all data being 0 can basically be received by the BC end, so as to adjust the timing between the RT end and the BC end. The period t is the time for the BC end to periodically send the polling instruction, which can be set according to the specific situation, such as 50ms.
[0025] Step 7) The RT end sends the agreed command or mode code in the second case to the BC end, and then returns to execute step 2); in this specific embodiment, the second case is that the RT end has completed sending the data to the BC end.
[0026] Step 8) Transmit data in the normal way and return to step 2) after the transmission is completed.
[0027] In this specific embodiment, step 8) includes the following steps: Step 8.1) Is there any message to be sent in the current sending queue? If not, execute step 8.2. If yes, execute step 8.3); Step 8.2) The RT sends a command or mode code without a data frame to the BC, and then returns to execute step 2); Step 8.3) The RT sends a command or mode code with a data frame to the BC; Step 8.4) Select a message to be sent from the queue popup and send it to the BC end, then return to step 2).
[0028] Compared with the prior art, the present invention adopts a method of ensuring that a communication data frame with all 0 data is sent before the RT end sends the first frame of formal data to the BC end, and basically ensuring that it is received by the BC end, so as to adjust the timing between the RT end and the BC end. A large number of experiments have proved that before the actual communication of the first data frame, the time interval for the RT end to read the periodic polling instruction is greatly different from the actual cycle. Only after the first frame is basically ensured to be sent can the time interval for the RT end to read the periodic polling instruction be guaranteed to be consistent with the actual cycle. The method of the present invention can effectively improve the reliability and stability of 1553B bus communication, especially eliminate the phenomenon of accidental loss of data frames transmitted by RT, especially the first frame of data, caused by competitive access or mismatch between the initial timing of the RT end and the BC end. The implementation of the method of the present invention does not require modification of hardware and structure, and improves product reliability on the basis of ensuring product cost. The method of the present invention has been verified in engineering, and a large number of land trials and sea trials have proved that the present invention can avoid the problem of BC end reading RT end data frames, especially the loss of the first communication frame.
[0029] The method for preventing data frame loss at the RT end of the 1553B bus of the present invention is described below with a specific project. The project adopts VxWorks 5.5 and includes the following steps: Step 1) Turn on the RT, execute the parameters, variables, and communication initialization configuration, set isFistFFFF=True when the periodic polling command is received for the first time, set the priority of each task, and start each task, including the communication task; Step 2) In the while loop of the communication Task, check every 1ms whether the periodic polling instruction sent by the BC is received, that is, determine whether the address in the address code of the received control word matches, the type is the mode code, and the data is 0xFFFF, such as the following statement if((((pRtMsg->CmdWord1>>5)&0x1f) == 0x0000)&&(((pRtMsg->CmdWord1>>11)&0x1f) == 0x1f)&&( pRtMsg->Data[0]== 0xffff )); Step 3) If the BC-side periodic polling instruction is received, determine whether it is received for the first time. If so, go to step 4). Otherwise, go to step 8). In the specific execution, it is to determine whether isFistFFFF is True. If it is True, set isFistFFFF to False and go to step 4); Step 4) Send the agreed command or mode code to the BC end to indicate that there is data to be sent during this communication cycle. The specific method is to send the mode code 0x45, that is, WriteVectorWord (0x45); Step 5) form a frame of data message, each word in the data is 0x0, send it to the BC end, and record the current time t1; The specific method is: send 6 data frames with word lengths all equal to 0 to the BC end. The code is as follows: for(i=0;i<6;i++) { TxData[i]=0x0; } ret = WriteRtMesg(TxData, 16, 1); Step 6) Receive the periodic polling instruction from the BC again, record the current time t2, if t2-t1 is less than the period t, delay t-(t2-t1); otherwise, do not delay; Step 7) After sending the agreed command or mode code to the BC end indicating that the data transmission is completed, the mode code 0x0 is sent, that is, WriteVectorWord (0x0) and go to step 2); Step 8) Perform data transmission in the normal manner, and go to step 2) after the transmission is completed.
[0030] Next, taking a project actually carried out by the inventor as an example, the actual cycle polling instruction time of the BC end is approximately 50ms. Figure 2 As shown, in the first actual communication, the RT end perceives that the BC end polling cycle is 42ms, which is an erroneous perception. In fact, the tool is used to query in MT and confirm that the actual first frame BC end polling cycle is 50ms. The first frame is not received by the BC end, and the frame is lost. The subsequent perceived BC end polling cycle is consistent with the BC end polling cycle queried by MT. A large number of subsequent experiments also proved this point. Therefore, arrange an all-0 data frame before the real data first frame, and try to make its cycle meet the actual cycle. Even if this all-0 data frame is not received by the BC end, the real data frames will not be lost afterwards. Only the first frame of all-0 data frame has a small possibility of not being read by the BC end. The principle needs to be further clarified whether it is due to competitive access or initial timing problems.
[0031] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit the technical solution. Those skilled in the art should understand that those modifications or equivalent substitutions of the technical solution of the present invention that do not depart from the purpose and scope of the technical solution should be included in the scope of the claims of the present invention.
Claims
1. A method for preventing the first frame loss of 1553B RT communication, characterized in that: The method comprises the following steps: Step 1) Turn on the RT, complete initialization, and start the communication thread; Step 2) Whether the RT end receives the periodic polling instruction sent by the BC end; Step 3) When the RT receives the periodic polling instruction from the BC, the RT judges the periodic polling instruction according to the set conditions. When the periodic polling instruction meets the set conditions, step 4 is executed. When the periodic polling instruction does not meet the set conditions, step 8 is executed); Step 4) The RT sends the agreed command or mode code indicating the first case to the BC; Step 5) RT forms a frame of data message and sends it to BC, and records the current time t1; Step 6) When the RT receives the periodic polling instruction from the BC again, it records the current time t2 and determines whether a delay is required based on the relationship between t2 and t1; Step 7) The RT sends the agreed command or mode code in the second case to the BC, and then returns to execute step 2); Step 8) Transmit data in the normal way and return to step 2) after the transmission is completed.
2. The method for preventing the first frame loss of 1553B RT communication according to claim 1, characterized in that: In step 3), the condition is set as whether the RT end receives the periodic polling instruction from the BC end for the first time. If the periodic polling instruction is received by the RT end for the first time, execute step 4). If the periodic polling instruction is not received by the RT end for the first time, execute step 8).
3. The method for preventing the first frame loss of 1553B RT communication according to claim 1, characterized in that: In step 4), the first case is that the RT end has data to send to the BC end during this communication cycle, so as to indicate to the BC end that it needs to receive the data sent by the RT end.
4. The method for preventing the first frame loss of 1553B RT communication according to claim 1, characterized in that: In step 5), each word in the data message sent by the RT to the BC is 0x0.
5. The method for preventing the first frame loss of 1553B RT communication according to claim 1, characterized in that: In step 6), when t2-t1 is less than the period t, step 7 is executed after a delay of t-(t2-t1); when t2-t1 is greater than or equal to the period t, step 7 is executed directly without delay.
6. The method for preventing the first frame loss of 1553B RT communication according to claim 1, characterized in that: In step 7), the second case is that the data transmission from the RT end to the BC end is completed.
7. The method for preventing the first frame loss of 1553B RT communication according to claim 1, characterized in that: Step 8) includes the following steps: Step 8.1) Is there any message to be sent in the current sending queue? If not, execute step 8.
2. If yes, execute step 8.3); Step 8.2) The RT sends a command or mode code without a data frame to the BC, and then returns to execute step 2); Step 8.3) The RT sends a command or mode code with a data frame to the BC; Step 8.4) Select a message to be sent from the queue popup and send it to the BC end, then return to step 2).