CN114003455B - Serial port automatic test system, interface automatic test method and test platelet - Google Patents

Serial port automatic test system, interface automatic test method and test platelet Download PDF

Info

Publication number
CN114003455B
CN114003455B CN202111663753.7A CN202111663753A CN114003455B CN 114003455 B CN114003455 B CN 114003455B CN 202111663753 A CN202111663753 A CN 202111663753A CN 114003455 B CN114003455 B CN 114003455B
Authority
CN
China
Prior art keywords
serial port
interface
level signal
test
port
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.)
Active
Application number
CN202111663753.7A
Other languages
Chinese (zh)
Other versions
CN114003455A (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.)
Guangzhou Lubangtong IoT Co Ltd
Original Assignee
Guangzhou Lubangtong IoT Co 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 Guangzhou Lubangtong IoT Co Ltd filed Critical Guangzhou Lubangtong IoT Co Ltd
Priority to CN202111663753.7A priority Critical patent/CN114003455B/en
Publication of CN114003455A publication Critical patent/CN114003455A/en
Application granted granted Critical
Publication of CN114003455B publication Critical patent/CN114003455B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/28Testing of electronic circuits, e.g. by signal tracer
    • G01R31/2801Testing of printed circuits, backplanes, motherboards, hybrid circuits or carriers for multichip packages [MCP]
    • G01R31/281Specific types of tests or tests for a specific type of fault, e.g. thermal mapping, shorts testing

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

The invention belongs to the technical field of Internet of things and discloses an automatic serial port testing system which comprises an upper computer, tested equipment, a testing platelet and auxiliary equipment, wherein the upper computer is connected with the tested equipment; the tested device is provided with a first wan port, a first DI interface, a first DO interface, a first serial port and a first main control module; the test platelet is provided with a second serial port, a third serial port, a second DI interface, a second DO interface, a third DO interface, a switching circuit and a second main control module; the auxiliary equipment is provided with a fourth serial port, a third DI interface and a third main control module. The system tests whether the functions of the DI and DO interfaces of the tested equipment are normal or not through one step and tests whether the serial port of the tested equipment is normal or not based on the step, and has the advantages of simplicity, reliability and high automation degree. Meanwhile, the invention also discloses an interface automation method and a test platelet based on the system.

Description

Serial port automatic test system, interface automatic test method and test platelet
Technical Field
The invention relates to the technical field of Internet of things, in particular to an automatic serial port testing system, an automatic interface testing method and a testing platelet.
Background
At present when possessing interface function test verification such as DI, DO, RS232 and RS485 sharing 2pin interface, WiFi, LAN, WAN, 4G, an equipment configuration auxiliary assembly usually, then connect corresponding interface through interface wiring, whether the response agreement of configuration can confirm corresponding function normally, but meet a difficult problem at present and be RS232 and RS485 sharing 2pin interface (possess the software and switch over the function), two kinds of interface level and agreement are completely inconsistent, if can confirm two functions through artifical manual switch over interface, but can bring the operation inconvenient and more man-hour consuming, be unfavorable for batch production test verification function.
The applicant's prior application ZL 201711317780.2 discloses a method for automatically testing a device with an RS232/RS485 universal interface, which relates to a device to be tested and an auxiliary device with an RS232/RS485 universal interface, and further comprises a test fixture for communicating data interaction when the test fixture and the auxiliary device are tested; by testing the data interaction of the device to be tested and the auxiliary device in the RS485 mode and the RS232 mode, whether the data receiving and sending functions in the RS485 mode, the data receiving and sending functions in the RS232 mode and the RTS and CTS functions in the RS232 mode of the device to be tested are effective or not is tested, and whether the RS232/RS485 universal interface function of the device to be tested is abnormal or not is judged. Maintenance is only required on the controller side.
The scheme does not realize switching between the RS485 mode and the RS232 mode.
The technical problem solved by the invention is as follows: how to realize the automatic switching of the RS485 mode and the RS232 mode so as to realize the automatic serial port test.
From another perspective, the technical problem solved by the present invention is a precondition for realizing fully automated testing in the prior patent application.
Disclosure of Invention
The invention aims to provide an automatic serial port testing system which tests whether the functions of DI and DO interfaces of tested equipment are normal or not through one step and tests whether the serial port of the tested equipment is normal or not based on the step, and has the advantages of simplicity, reliability and high automation degree.
Meanwhile, the invention also discloses an interface automation method and a test platelet based on the system.
In order to achieve the purpose, the invention provides the following technical scheme: an automatic serial port testing system comprises an upper computer, a tested device, a testing platelet and auxiliary equipment;
the tested device is provided with a first wan port, a first DI interface, a first DO interface, a first serial port and a first main control module; the test platelet is provided with a second serial port, a third serial port, a second DI interface, a second DO interface, a third DO interface, a switching circuit and a second main control module; the auxiliary equipment is provided with a fourth serial port, a third DI interface and a third main control module;
the first main control module is electrically connected with the first wan port, the first DI interface, the first DO interface and the first serial port; the second main control module is electrically connected with the second DI interface, the second DO interface, the third DO interface and the switching circuit; the third main control module is electrically connected with the fourth serial port and the third DI interface;
the first main control module is used for controlling the first DO interface to send a first level signal to the second DI interface according to an instruction of the upper computer and controlling the first serial port to be configured according to RS232 or RS485 according to the second level signal;
the second main control module is used for controlling the second DO interface to send a second level signal to the first DI interface and the third DI interface according to the first level signal, and controlling the switching circuit to act according to the first level signal so as to realize communication among the first serial port, the second serial port, the third serial port and the fourth serial port through a first link or second link;
the third main control module is used for controlling the fourth serial port to be configured according to the RS232 or RS485 according to the second level signal;
the upper computer is used for communicating with the first main control module and judging whether the first serial port of the tested device is normal in an RS232 mode and an RS485 mode according to whether the first link and the second link of the tested device, the test small plate and the auxiliary device are communicated successfully or not.
In the serial port automatic test system, when the first level signal is a low level signal, the second level signal is a high level signal and the first link adopts an RS232 mode for communication;
when the first level signal is a high level signal, the second level signal is a low level signal and the second link adopts an RS485 mode for communication;
and if the first DI interface does not receive the second level signal, marking the first DI interface as a fault.
In the serial port automatic test system, the tested device is provided with a first lan port, and the auxiliary device is provided with a second lan port; the first lan port and the second lan port are in communication connection;
and the upper computer is used for establishing communication connection with the auxiliary equipment through the first wan port, the first lan port and the second lan port according to the IP address of the auxiliary equipment so as to test whether the first lan port can normally communicate.
In the serial port automatic test system, the upper computer is used for establishing communication connection with the tested device according to the IP address of the tested device so as to test whether the first wan port can normally communicate.
The automatic serial port testing system further comprises a wifi testing module, the tested device is further provided with a wifi module and a cellular network module, and the wifi module is connected with the wifi testing module to test the working condition of the wifi module; the cellular network module is connected with a cellular network which already exists in the environment to test the working condition of the cellular network module.
In the serial port automatic test system, the first serial port, the second serial port, the third serial port and the fourth serial port are respectively provided with a TX pin and an RX pin;
the switching circuit is arranged between the second serial port and the third serial port;
when the switching circuit is switched to a first link, a TX pin of the first serial port is electrically connected with an RX pin of a fourth serial port; an RX pin of the first serial port is electrically connected with a TX pin of a fourth serial port;
when the switching circuit is switched to a second link, a TX pin of the first serial port is electrically connected with a TX pin of a fourth serial port; and the RX pin of the first serial port is electrically connected with the RX pin of the fourth serial port.
Meanwhile, the invention also discloses a serial port automatic testing method, which is implemented based on any one of the systems;
the method specifically comprises the following steps:
step 1: the upper computer sends a first instruction or a second instruction to the tested equipment;
step 2: the tested device generates a first level signal according to the first instruction or the second instruction and sends the first level signal to the second DI interface through the first DO interface;
and step 3: the test small plate generates a second level signal according to the first level signal and sends the first DI interface and the third DI interface through the second DO interface and the third DO interface; meanwhile, the action of the switching circuit is controlled according to the first level signal, so that the first serial port, the second serial port, the third serial port and the fourth serial port are communicated according to a first link or communicated according to a second link;
and 4, step 4: the tested device and the auxiliary device are synchronously configured into an RS232 mode or an RS485 mode according to the second level signal;
and 5: the tested device, the test small plate and the auxiliary device are communicated according to an RS232 mode through a first link or according to an RS485 mode through a second link, and a communication result is fed back to the upper computer; and the upper computer obtains a conclusion whether the first serial port is normal in an RS232 mode or an RS485 mode according to the communication result.
In the serial port automatic test method, when the first level signal is a low level signal, the second level signal is a high level signal and the first link adopts an RS232 mode for communication;
and when the first level signal is a high level signal, the second level signal is a low level signal and the second link adopts an RS485 mode for communication.
In the serial port automatic testing method, the tested device is also provided with a storage module;
the single board testing step is included before the step 1;
the single board testing step is as follows: adopting external equipment to carry out performance test on a circuit board of the tested equipment and obtain a test result, wherein the test result is stored in a storage module;
when the step 1 is carried out, the upper computer firstly calls the test result in the storage module;
if the test result is passed, performing the step 1;
and if the test result is failed or no test result is obtained, the tested device is sent to a repair process.
Finally, the invention also discloses a test platelet, which comprises a second serial port, a third serial port, a second DI interface, a second DO interface, a third DO interface, a switching circuit and a second main control module;
the second main control module is electrically connected with the second DI interface, the second DO interface, the third DO interface and the switching circuit;
the second serial port is connected with a first serial port of peripheral equipment to be tested, and the third serial port is connected with a fourth serial port of peripheral auxiliary equipment;
the second DI interface is used for receiving a first level signal sent by a peripheral tested device;
the second main control module is used for controlling the second DO interface to send out a second level signal to the first DI interface and the third DI interface according to the first level signal, and controlling the switching circuit to act according to the first level signal, so that the first serial port, the second serial port, the third serial port and the fourth serial port are communicated through a first link or a second link.
Compared with the prior art, the invention has the beneficial effects that:
the invention tests whether the functions of the DI and DO interfaces of the tested equipment are normal or not through a step and tests whether the serial port of the tested equipment is normal or not based on the step, and has the advantages of simplicity, reliability and high automation degree.
Specifically, a first level signal is sent to the test platelet through the DO interface of the tested device, the test platelet generates a second level model, the second level model controls the switching of a switching circuit on the test platelet besides controlling the switching of the communication modes of the tested device and the auxiliary device, and the switching of the communication method of the whole data link is realized, so that the automatic testing in the RS232 mode and the RS485 mode of the serial port is realized.
The testing process is full-automatic, whether the DI, the DO interface and the serial port of the tested equipment are normal or not is tested, the system acts based on the instruction of the upper computer, and the testing result is fed back to the upper computer without manual intervention.
Meanwhile, the invention also discloses an interface automation method and a test platelet based on the system.
Drawings
FIG. 1 is a block diagram showing the structure of embodiment 1 of the present invention;
FIG. 2 is a flowchart of example 2 of the present invention;
fig. 3-6 are circuit diagrams of currents one through four for the test platelet.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
Referring to fig. 1, an automated serial port testing system includes an upper computer 1, a device under test 2, a test platelet 3, and an auxiliary device 4;
the tested device 2 is provided with a first wan port 21, a first DI interface 22, a first DO interface 23, a first serial port 24 and a first main control module 25; the test platelet 3 is provided with a second serial port 31, a third serial port 32, a second DI interface 33, a second DO interface 34, a third DO interface 35, a switching circuit 36 and a second main control module 37; the auxiliary device 4 is provided with a fourth serial port 41, a third DI interface 42 and a third main control module 43; the switching circuit 36 is a dual relay;
the first main control module 25 is electrically connected with the first wan port 21, the first DI interface 22, the first DO interface 23 and the first serial port 24; the second main control module 37 is electrically connected with the second DI interface 33, the second DO interface 34, the third DO interface 35 and the switching circuit 36; the third main control module 43 is electrically connected with the fourth serial port 41 and the third DI interface;
the first main control module 25 is configured to control the first DO interface 23 to send a first level signal to the second DI interface 33 according to an instruction of the upper computer 1, and control the first serial port 24 to be configured according to RS232 or RS485 according to a second level signal;
the second main control module 37 is configured to control the second DO interface 34 to send a second level signal to the first DI interface 22 and the third DI interface according to the first level signal, and control the switching circuit 36 to operate according to the first level signal, so as to implement communication among the first serial port 24, the second serial port 31, the third serial port 32, and the fourth serial port 41 through a first link or second link;
the third main control module 43 is configured to control the fourth serial port 41 to configure according to RS232 or RS485 according to the second level signal;
the upper computer 1 is used for communicating with the first main control module 25, and judging whether the first serial port 24 of the tested device 2 is normal in an RS232 mode and an RS485 mode according to whether the first link and the second link of the tested device 2, the test small plate 3 and the auxiliary device 4 are successful in communication.
In the test process, the first serial port 24 is connected with the second serial port 31 through a serial port cable, and the third serial port 32 is not moved any more after being connected with the fourth serial port 41 under the normal condition;
after the serial port cable is connected, the upper computer 1 sends a first instruction;
after receiving the first instruction through the first wan port 21, the first main control module 25 generates a first level signal, where the first level signal at this time is a low level, the first level signal is sent to the second DI interface 33 of the test platelet 3 through the first DO interface 23, the second main control module 37 generates a second level signal according to the first level signal, the second level signal is a high level, the second level signal is sent to the first DI interface 22 of the device under test 2 and the third DI interface of the auxiliary device 4 through the second DO interface 34, the first DI interface 22 and the third DI interface are changed from the low level to the high level, the first main control module 25 and the third main control module 43 know the change and then control the first serial port 24 and the fourth serial port 41 to adjust to the RS232 mode, and if the first DI interface 22 does not receive the second level signal, the first DI interface 22 is marked as a fault; meanwhile, the second main control module 37 controls the switching circuit 36 to switch to the first link according to the first level signal, and the electrical connection mode of each pin of the first link is as follows: TX pin of the first serial port 24 → RX pin of the second serial port 31 → switching circuit 36 → TX pin of the third serial port 32 → RX pin of the fourth serial port 41; and, the RX pin of the first serial port 24 → the TX pin of the second serial port 31 → the switching circuit 36 → the RX pin of the third serial port 32 → the TX pin of the fourth serial port 41; that is, the RX pin of the first serial port 24 is conducted with the TX pins of the four serial ports, and the TX pin of the first serial port 24 is conducted with the RX pins of the four serial ports;
at this time, the physical connections of the first link are already connected, the serial ports of the device under test 2 and the auxiliary device 4 are both in the RS232 mode, the first link has the condition of communicating according to the RS232 communication mode, the first main control module 25 starts to send a test signal, and if the feedback signal of the auxiliary device 4 can be received, the first serial port 24 is considered to be normally communicated in the RS232 mode;
after receiving the second instruction through the first wan port 21, the first main control module 25 generates a first level signal, where the first level signal at this time is a high level, the first level signal is sent to the second DI interface 33 of the test platelet 3 through the first DO interface 23, the second main control module 37 generates a second level signal according to the first level signal, the second level signal is a low level, and the second level signal is sent to the first DI interface 22 of the device under test 2 and the third DI interface of the auxiliary device 4 through the second DO interface 34, where the first DI interface 22 and the third DI interface are changed from the high level to the low level, and the first main control module 25 and the third main control module 43 know the change and then control the first serial port 24 and the fourth serial port 41 to adjust to the RS485 mode; meanwhile, the second main control module 37 controls the switching circuit 36 to switch to the second link according to the first level signal, and the electrical connection mode of each pin of the second link is as follows: TX pin of the first serial port 24 → RX pin of the second serial port 31 → switching circuit 36 → RX pin of the third serial port 32 → TX pin of the fourth serial port 41; and, the RX pin of the first serial port 24 → the TX pin of the second serial port 31 → the switching circuit 36 → the TX pin of the third serial port 32 → the RX pin of the fourth serial port 41; that is, the RX pin of the first serial port 24 is conducted with the RX pins of the four serial ports, and the TX pin of the first serial port 24 is conducted with the TX pins of the four serial ports;
at this time, the physical connection of the second link is already connected, the serial ports of the device under test 2 and the auxiliary device 4 are both in the RS485 mode, the second link has the condition of communicating according to the RS485 communication mode, the first main control module 25 starts to send the test signal, and if the feedback signal of the auxiliary device 4 can be received, the first serial port 24 is considered to be normally communicated in the RS485 mode.
Implicitly, the first serial port 24, the second serial port 31, the third serial port 32 and the fourth serial port 41 all have ground pins GND;
as can be known from the above description, the DI interface and the serial port of the device under test 2 can be normal in the RS232 and RS485 modes through the above design;
it should be noted that: the RS232 mode and the RS485 mode are not in sequence, and the sequence is set according to the requirement.
Preferably, said device under test 2 has a first lan port 26, said auxiliary device 4 has a second lan port 44; the first lan port and the second lan port are in communication connection;
the upper computer 1 is used for establishing communication connection with the auxiliary equipment 4 through the first wan port 21, the first lan port and the second lan port according to the IP address of the auxiliary equipment 4 so as to test whether the first lan port can normally communicate.
After the test, subsequent auxiliary tests may be performed, such as further testing which interface the first DO interface 23 and the first DI interface 22 of the device under test 2 are not normal, specifically, once it is determined that the first lan interface can communicate normally, when the first DO interface 23 sends the first level signal to the second DI interface 33, the second DO interface 34 and the third DO interface 35 respectively feed back the second level signal to the device under test 2 and the auxiliary device 4, the auxiliary device 4 may feed back a result of whether the second level signal is received to the host computer 1 through the second lan interface, the first lan interface and the first wan interface 21, if the host computer 1 receives the notification that the auxiliary device 4 has received the second level signal, but does not receive the notification that the first DI interface 22 sent by the first master control module 25 has received the second level signal, it is determined that the first DI interface 22 is in a fault state, the first DO interface 23 is in a normal state; if the upper computer 1 does not receive the notification that the second level signal has been received, which is fed back by the auxiliary device 4, and does not receive the notification that the second level signal has been received by the first DI interface 22 sent by the first main control module 25, it indicates that the first DO interface 23 is in a fault state.
In this embodiment, the upper computer 1 is configured to establish a communication connection with the device under test 2 according to the IP address of the device under test 2, so as to test whether the first wan port 21 can normally communicate.
More preferably, the sequence of the interface test should be:
whether the first port wan can communicate normally → the first lan port can communicate normally → the first DI interface 22, the first DO interface 23, and the first serial port 24 can communicate normally is tested.
In this embodiment, the device further comprises a wifi testing module 5, the device to be tested 2 further comprises a wifi module 6 and a cellular network module 7, and the wifi module 6 is connected with the wifi testing module 5 to test the working condition of the wifi module 6; the cellular network module 7 tests the operation of the cellular network module 7 by establishing a connection with a cellular network already present in the environment.
The device to be tested 2 is also provided with a storage module 8, and the storage module 8 is used for storing the performance test of the circuit board of the device to be tested 2 by adopting external equipment and obtaining a test result;
more specifically, the related circuit according to the present invention is as follows:
circuit one (see fig. 3):
the 12V power of the test small plate is input through J1, the positive pole of the power is input to the power interface input end of U1 through D1, the negative pole is grounded, C2 and C3 have filtering effect on the power, R1 and C4 form an RC delay opening output enabling function, and C10 has a slow starting function. The power supply is reduced to 3V3 through U1, and the output voltage calculation formula Vout = Vfb/R3 (R2+ R3) =0.765/22.1 (22.1+75) = 3.36V; l1 selects more than 2.2uH according to the specification, and the design selects 4.7 uH; c5, C6, C7, C8, C9 and C12 play a role in filtering. C1 is used as a bootstrap capacitor and is mainly used for inhibiting the potential mutation characteristics of BOOT and SW. In order to ensure that the power supply is reversely connected to damage the test small plate, after the anode of the power supply is added with the diode D1, namely the polarity of the power supply is reversed, the cathode is changed into the anode and cannot return to the power supply input end through the diode D1, so that the protection effect is achieved.
Circuit two (see fig. 4):
when IN _ DI + is high, the divided voltage is defined as V1 by R71 and R72, and Q1 is turned on through R16 to Q1, so that IN _ DO + becomes low. After V1 passes through R19, the potential of 1RS232_485_ EN is high level; v1 causes Q3 to turn on through R23, thereby making the potential of OUT _ DO + low.
When IN _ DI + is low, the voltage divided by R71 and R72 is defined as V2, and Q1 is turned off through R16 to Q1, so that IN _ DO + becomes high. After V1 passes through R19, the potential of 1RS232_485_ EN is low; v1 causes Q3 to turn off through R23, thereby making the potential of OUT _ DO + become high level.
Circuit three (see fig. 5):
when the potential of 1RS232_485_ EN is high level, Q4 is enabled to be conducted through R28, the potential of 1_232_485_ EN is low level, Q5 is enabled to be turned off after R27, a relay of K1 cannot be powered, a switching channel of K1 is in a default state, namely A/RX1 is connected with A/RX, and B/TX1 is connected with B/TX.
When the potential of 1RS232_485_ EN is at low level, Q4 is turned off through R28, the potential of 1_232_485_ EN is at high level, Q5 is turned on through R27, the relay of K1 is electrified, the switching channel of K1 is in a switching state, namely, A/RX is connected with B/TX1, and B/TX is connected with A/RX 1. D3 and C16 are mainly used to quickly eliminate the electromotive force generated by the coil when the relay is powered to an unpowered state, and to avoid the driving transistor Q5 from being damaged by the back electromotive force.
Circuit four (see fig. 6):
IN _ DI-is the negative pole of the second DI interface, is internally connected to the ground and is connected with the negative pole of the first DO interface; IN _ DI + is the positive pole of the second DI interface, externally connected to the positive pole of the first DO interface.
IN _ DO-is the negative pole of the second DO interface, is internally connected to the ground and is connected with the negative pole of the first DI interface; IN _ DO + is the positive pole of the second DO interface, externally connected to the positive pole of the first DI interface.
OUT _ DO-is the negative pole of the third DO interface, is internally connected to ground and is connected with the negative pole of the third DI interface; and OUT _ DO + is the anode of the third DO interface, and is externally connected with the anode of the third DI interface.
The A/RX is butted with a TX or RS 485A line of the first main control board; B/TX is butted with an RX or RS 485B line of the first main control board; the A/RX _ C is butted with a TX or RS 485A line of a second main control board; B/TX _ C is connected with an RX line or an RS 485B line of the second main control board in an abutting mode.
A/RX _ C is connected with A/RX1 through a resistor R58, and B/TX _ C is connected with B/TX1 through a resistor R59.
Example 2
Referring to fig. 2, an interface automation test method is implemented based on the system as described in embodiment 1;
the method specifically comprises the following steps:
step 1: the upper computer 1 sends a first instruction or a second instruction to the tested equipment 2;
the first instruction is to instruct the first DO interface 23 to send a low level signal; the second instruction is to instruct the first DO interface 23 to send a high level signal;
step 2: the tested device 2 generates a first level signal according to the first instruction or the second instruction and sends the first level signal to the second DI interface 33 through the first DO interface 23;
and step 3: the test small plate 3 generates a second level signal according to the first level signal and sends the first DI interface 22 and the third DI interface through the second DO interface 34 and the third DO interface 35; meanwhile, the switching circuit 36 is controlled to act according to the first level signal, so that the first serial port 24, the second serial port 31, the third serial port 32 and the fourth serial port 41 are communicated according to a first link or a second link;
and 4, step 4: the tested device 2 and the auxiliary device 4 are synchronously configured into an RS232 mode or an RS485 mode according to the second level signal;
and 5: the tested device 2, the test small plate 3 and the auxiliary device 4 are communicated according to an RS232 mode through a first link or according to an RS485 mode through a second link, and a communication result is fed back to the upper computer 1; and the upper computer 1 obtains a conclusion whether the first serial port 24 is normal in an RS232 mode or an RS485 mode according to the communication result.
In the test process, the first serial port 24 is connected with the second serial port 31 through a serial port cable, and the third serial port 32 is not moved any more after being connected with the fourth serial port 41 under the normal condition;
after the serial port cable is connected, the upper computer 1 sends a first instruction;
after receiving the first instruction through the first wan port 21, the first main control module 25 generates a first level signal, where the first level signal at this time is a low level, the first level signal is sent to the second DI interface 33 of the test platelet 3 through the first DO interface 23, the second main control module 37 generates a second level signal according to the first level signal, the second level signal is a high level, the second level signal is sent to the first DI interface 22 of the device under test 2 and the third DI interface of the auxiliary device 4 through the second DO interface 34, the first DI interface 22 and the third DI interface are changed from the low level to the high level, the first main control module 25 and the third main control module 43 know the change and then control the first serial port 24 and the fourth serial port 41 to adjust to the RS232 mode, and if the first DI interface 22 does not receive the second level signal, the first DI interface 22 is marked as a fault; meanwhile, the second main control module 37 controls the switching circuit 36 to switch to the first link according to the first level signal, and the electrical connection mode of each pin of the first link is as follows: TX pin of the first serial port 24 → RX pin of the second serial port 31 → switching circuit 36 → TX pin of the third serial port 32 → RX pin of the fourth serial port 41; and, the RX pin of the first serial port 24 → the TX pin of the second serial port 31 → the switching circuit 36 → the RX pin of the third serial port 32 → the TX pin of the fourth serial port 41; that is, the RX pin of the first serial port 24 is conducted with the TX pins of the four serial ports, and the TX pin of the first serial port 24 is conducted with the RX pins of the four serial ports;
at this time, the physical connections of the first link are already connected, the serial ports of the device under test 2 and the auxiliary device 4 are both in the RS232 mode, the first link has the condition of communicating according to the RS232 communication mode, the first main control module 25 starts to send a test signal, and if the feedback signal of the auxiliary device 4 can be received, the first serial port 24 is considered to be normally communicated in the RS232 mode;
after receiving the second instruction through the first wan port 21, the first main control module 25 generates a first level signal, where the first level signal at this time is a high level, the first level signal is sent to the second DI interface 33 of the test platelet 3 through the first DO interface 23, the second main control module 37 generates a second level signal according to the first level signal, the second level signal is a low level, and the second level signal is sent to the first DI interface 22 of the device under test 2 and the third DI interface of the auxiliary device 4 through the second DO interface 34, where the first DI interface 22 and the third DI interface are changed from the high level to the low level, and the first main control module 25 and the third main control module 43 know the change and then control the first serial port 24 and the fourth serial port 41 to adjust to the RS485 mode; meanwhile, the second main control module 37 controls the switching circuit 36 to switch to the second link according to the first level signal, and the electrical connection mode of each pin of the second link is as follows: TX pin of the first serial port 24 → RX pin of the second serial port 31 → switching circuit 36 → RX pin of the third serial port 32 → TX pin of the fourth serial port 41; and, the RX pin of the first serial port 24 → the TX pin of the second serial port 31 → the switching circuit 36 → the TX pin of the third serial port 32 → the RX pin of the fourth serial port 41; that is, the RX pin of the first serial port 24 is conducted with the RX pins of the four serial ports, and the TX pin of the first serial port 24 is conducted with the TX pins of the four serial ports;
at this time, the physical connection of the second link is already connected, the serial ports of the device under test 2 and the auxiliary device 4 are both in the RS485 mode, the second link has the condition of communicating according to the RS485 communication mode, the first main control module 25 starts to send the test signal, and if the feedback signal of the auxiliary device 4 can be received, the first serial port 24 is considered to be normally communicated in the RS485 mode.
Example 3
An interface automatic testing method, which is implemented based on the system as described in embodiment 1;
the upper computer 1 is connected with a first wan port 21 of the tested device 2, a first serial port 24 is connected with a second serial port 31, a first DI interface 22 is connected with a second DO interface 34, and a first DO interface 23 is connected with a second DI interface 33; the first lan port is connected with the second lan port;
the method comprises the following steps:
step 11: the upper computer 1 pings and leads to the tested equipment 2, the upper computer 1 clicks a one-key test to issue an instruction, the computer end executes the IP address of the ping tested equipment 2, if the ping is normal, the first wan port 21 is judged to be qualified, and the first wan port 21PASS is displayed on the upper computer 1; otherwise, the failure is judged, the first wan port 21FAIL is displayed on the upper computer 1 and sent to the maintenance process.
Step 12: the upper computer 1 reads the test result of the storage module 8, if the test result shows that the single board test of the tested device 2 passes, the step 13 is carried out, and if the test result shows that the single board test of the tested device 2 does not pass or has no related test result, the tested device 2 is sent to a maintenance procedure;
step 13: the upper computer 1 executes the IP address of the ping auxiliary equipment 4, if the ping is normally conducted, the first lan port is judged to be qualified, and the first lan port PASS is displayed on the upper computer 1; otherwise, the judgment is failed, the first lan port FAIL is displayed on the upper computer 1, and the operation is sent to a maintenance procedure.
Step 14: the upper computer 1 sends a first instruction to the tested equipment 2;
step 15: the tested device 2 generates a low level signal according to the first instruction and sends the low level signal to the second DI interface 33;
step 16: the test small plate 3 generates a high level signal according to the low level signal and sends the first DI interface 22 and the third DI interface through the second DO interface 34 and the third DO interface 35; meanwhile, the switching circuit 36 is controlled to act according to the first level signal, so that the first serial port 24, the second serial port 31, the third serial port 32 and the fourth serial port 41 are communicated according to a first link;
and step 17: the tested device 2 and the auxiliary device 4 are synchronously configured into an RS232 mode according to the second level signal;
if the auxiliary device 4 receives the second level signal and sends the second level signal to the upper computer 1 through the second lan port for feedback in the process, but the upper computer 1 does not receive the feedback that the first DI interface 22 receives the second level signal from the first wan port 21, the first DO interface 23 is considered to be normal, and the first DI interface 22 fails;
if the auxiliary device 4 does not receive the second level signal and sends the second level signal to the upper computer 1 through the second lan interface for feedback, the first DO interface 23 is considered to be in fault;
both of the above cases are sent to a maintenance process;
step 18: the tested device 2, the test small plate 3 and the auxiliary device 4 communicate according to the RS232 mode through the first link, and the communication result is fed back to the upper computer 1; the upper computer 1 obtains a conclusion whether the first serial port 24 is normal in the RS232 mode according to the communication result; if the conclusion is abnormal, sending the operation to a maintenance procedure; if the conclusion is normal, go to step 19;
step 19: the upper computer 1 sends a second instruction to the tested device 2;
step 20: the tested device 2 generates a high level signal according to the second instruction and sends the high level signal to the second DI interface 33;
step 21: the test small plate 3 generates a low level signal according to the high level signal and sends the first DI interface 22 and the third DI interface through the second DO interface 34 and the third DO interface 35; meanwhile, the switching circuit 36 is controlled to act according to the first level signal, so that the first serial port 24, the second serial port 31, the third serial port 32 and the fourth serial port 41 are communicated according to a second link;
step 22: the tested device 2 and the auxiliary device 4 are synchronously configured into an RS485 mode according to the second level signal;
step 23: the tested device 2, the test small plate 3 and the auxiliary device 4 are communicated according to an RS485 mode through a second link, and a communication result is fed back to the upper computer 1; the upper computer 1 obtains a conclusion whether the first serial port 24 is normal in the RS485 mode according to the communication result; if the conclusion is abnormal, sending the operation to a maintenance procedure; if the conclusion is normal, entering step 24;
step 24: a wifi test is carried out, a wifi test module 5 is arranged outside, the wifi test module 5 is set to be in an AP mode, a wifi module 6 is set to be in a Client mode, the wifi function is confirmed through a wifi connection mode, the fact that whether the wifi sensitivity is normal is confirmed through obtaining the RSSI value of the tested device 2 reading a wifi signal from an AP end, meanwhile, the fact that whether the sending power of the tested device 2 is normal is confirmed through obtaining the RSSI value of the wifi of the tested device 2 corresponding to the position below an AP hot spot of the auxiliary device 4 through a network port (note that the AP and the Client device need to be placed at a certain position, and whether the wifi module 6 is qualified can be roughly judged through space attenuation and received signal strength; if the fault exists, sending the fault to a maintenance procedure;
step 25: testing the cellular network: the cellular network module 7 establishes connection with the cellular network already existing in the environment to test the working condition of the cellular network module 7; the 4G function test and verification is to insert the SIM card into the equipment, and then actively acquire the CSQ value after the equipment is accessed to the network to judge whether the function is normal; if the fault exists, sending the fault to a maintenance procedure;
whether the wifi module 6, the cellular network module 7, the first DI interface 22, the first DO interface 23, the first wan port 21, the first lan port, and the first serial port 24 are normal can be completed through the above steps 11 to 25.
The automation degree is high, and manual intervention is basically not needed.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

Claims (8)

1. An automatic serial port testing system is characterized by comprising an upper computer, tested equipment, a testing small plate and auxiliary equipment;
the tested device is provided with a first wan port, a first DI interface, a first DO interface, a first serial port and a first main control module; the test platelet is provided with a second serial port, a third serial port, a second DI interface, a second DO interface, a third DO interface, a switching circuit and a second main control module; the auxiliary equipment is provided with a fourth serial port, a third DI interface and a third main control module;
the first main control module is electrically connected with the first wan port, the first DI interface, the first DO interface and the first serial port; the second main control module is electrically connected with the second DI interface, the second DO interface, the third DO interface and the switching circuit; the third main control module is electrically connected with the fourth serial port and the third DI interface;
the first main control module is used for controlling the first DO interface to send a first level signal to the second DI interface according to an instruction of the upper computer and controlling the first serial port to be configured according to RS232 or RS485 according to the second level signal;
the second main control module is used for controlling the second DO interface to send a second level signal to the first DI interface and the third DI interface according to the first level signal, and controlling the switching circuit to act according to the first level signal so as to realize communication among the first serial port, the second serial port, the third serial port and the fourth serial port through a first link or second link;
the third main control module is used for controlling the fourth serial port to be configured according to the RS232 or RS485 according to the second level signal;
the upper computer is used for communicating with the first main control module and judging whether the first serial port of the tested device is normal in an RS232 mode and an RS485 mode according to whether the first link and the second link of the tested device, the test small plate and the auxiliary device are successfully communicated or not;
the test process of the serial port automatic test system is as follows:
step 1: the upper computer sends a first instruction or a second instruction to the tested equipment;
step 2: the tested device generates a first level signal according to the first instruction or the second instruction and sends the first level signal to the second DI interface through the first DO interface;
and step 3: the test small plate generates a second level signal according to the first level signal and sends the first DI interface and the third DI interface through the second DO interface and the third DO interface; meanwhile, the action of the switching circuit is controlled according to the first level signal, so that the first serial port, the second serial port, the third serial port and the fourth serial port are communicated according to a first link or are communicated according to a second link;
and 4, step 4: the tested device and the auxiliary device are synchronously configured into an RS232 mode or an RS485 mode according to the second level signal;
and 5: the tested device, the test small plate and the auxiliary device are communicated according to an RS232 mode through a first link or according to an RS485 mode through a second link, and a communication result is fed back to the upper computer; the upper computer obtains a conclusion whether the first serial port is normal in an RS232 mode or an RS485 mode according to the communication result;
when the first level signal is a low level signal, the second level signal is a high level signal and the first link adopts an RS232 mode for communication;
and when the first level signal is a high level signal, the second level signal is a low level signal and the second link adopts an RS485 mode for communication.
2. The serial port automatic test system according to claim 1, wherein when the first level signal is a low level signal, the second level signal is a high level signal and the first link performs communication in an RS232 mode;
when the first level signal is a high level signal, the second level signal is a low level signal and the second link adopts an RS485 mode for communication;
and if the first DI interface does not receive the second level signal, marking the first DI interface as a fault.
3. The serial port automated test system of claim 1, wherein the device under test has a first lan port, and the auxiliary device has a second lan port; the first lan port and the second lan port are in communication connection;
and the upper computer is used for establishing communication connection with the auxiliary equipment through the first wan port, the first lan port and the second lan port according to the IP address of the auxiliary equipment so as to test whether the first lan port can normally communicate.
4. The serial port automatic test system according to claim 1, wherein the upper computer is configured to establish a communication connection with the device under test according to the IP address of the device under test, so as to test whether the first wan port can perform normal communication.
5. The serial port automatic test system according to claim 1, further comprising a wifi test module, wherein the device to be tested further comprises a wifi module and a cellular network module, and the wifi module and the wifi test module are connected to test the working condition of the wifi module; the cellular network module is connected with a cellular network which already exists in the environment to test the working condition of the cellular network module.
6. The serial port automatic test system according to claim 1, wherein the first serial port, the second serial port, the third serial port and the fourth serial port are respectively provided with a TX pin and an RX pin;
the switching circuit is arranged between the second serial port and the third serial port;
when the switching circuit is switched to a first link, a TX pin of the first serial port is electrically connected with an RX pin of a fourth serial port; the RX pin of the first serial port is electrically connected with the TX pin of the fourth serial port;
when the switching circuit is switched to a second link, a TX pin of the first serial port is electrically connected with a TX pin of a fourth serial port; and the RX pin of the first serial port is electrically connected with the RX pin of the fourth serial port.
7. A method for automated testing of an equipment interface, characterized in that the method is implemented on the basis of a system according to any one of claims 1-6.
8. The automated testing method for the device interface according to claim 7, wherein a storage module is further provided in the device under test;
the single board testing step is included before the step 1;
the single board testing step is as follows: adopting external equipment to carry out performance test on a circuit board of the tested equipment and obtain a test result, wherein the test result is stored in a storage module;
when the step 1 is carried out, the upper computer firstly calls the test result in the storage module;
if the test result is passed, performing the step 1;
and if the test result is failed or no test result is obtained, the tested device is sent to a repair process.
CN202111663753.7A 2021-12-31 2021-12-31 Serial port automatic test system, interface automatic test method and test platelet Active CN114003455B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111663753.7A CN114003455B (en) 2021-12-31 2021-12-31 Serial port automatic test system, interface automatic test method and test platelet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111663753.7A CN114003455B (en) 2021-12-31 2021-12-31 Serial port automatic test system, interface automatic test method and test platelet

Publications (2)

Publication Number Publication Date
CN114003455A CN114003455A (en) 2022-02-01
CN114003455B true CN114003455B (en) 2022-04-08

Family

ID=79932480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111663753.7A Active CN114003455B (en) 2021-12-31 2021-12-31 Serial port automatic test system, interface automatic test method and test platelet

Country Status (1)

Country Link
CN (1) CN114003455B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1842091A (en) * 2005-03-28 2006-10-04 无锡蓝天电子有限公司 Automatic switching device of serial port RS232 and RS485
CN202025310U (en) * 2010-12-28 2011-11-02 深圳市融创天下科技股份有限公司 Serial port debugging system
CN103888308A (en) * 2012-12-20 2014-06-25 研祥智能科技股份有限公司 Method, system and device for serial port tests
CN105045740A (en) * 2015-05-27 2015-11-11 北京立华莱康平台科技有限公司 Conversion method and circuit for communication interfaces
CN108062268A (en) * 2017-12-08 2018-05-22 广州鲁邦通物联网科技有限公司 A kind of automatic test has method, test fixture and the device of RS232RS485 general purpose interfaces
CN108267674A (en) * 2018-01-04 2018-07-10 广州金升阳科技有限公司 System is tested in a kind of comprehensive automation
CN111045967A (en) * 2019-10-12 2020-04-21 深圳市康必达控制技术有限公司 Automatic test switching circuit for serial port of communication manager
CN111224835A (en) * 2019-11-20 2020-06-02 深圳市康必达中创科技有限公司 Automatic switching method, device and system for serial port communication modes

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204241910U (en) * 2014-12-04 2015-04-01 沈阳中科奥维科技股份有限公司 Based on the remote terminal unit unit test system of LPC1764 single-chip microcomputer
CN104993976B (en) * 2015-07-07 2018-07-13 北京科技大学 A kind of PLC safety protection equipments assessment method and system
CN109189620B (en) * 2018-08-17 2022-02-11 福建实达电脑设备有限公司 Serial port inspection device
CN113534732B (en) * 2021-07-16 2022-12-16 上海海得控制***股份有限公司 DI module and DO module detection method, medium, PLC and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1842091A (en) * 2005-03-28 2006-10-04 无锡蓝天电子有限公司 Automatic switching device of serial port RS232 and RS485
CN202025310U (en) * 2010-12-28 2011-11-02 深圳市融创天下科技股份有限公司 Serial port debugging system
CN103888308A (en) * 2012-12-20 2014-06-25 研祥智能科技股份有限公司 Method, system and device for serial port tests
CN105045740A (en) * 2015-05-27 2015-11-11 北京立华莱康平台科技有限公司 Conversion method and circuit for communication interfaces
CN108062268A (en) * 2017-12-08 2018-05-22 广州鲁邦通物联网科技有限公司 A kind of automatic test has method, test fixture and the device of RS232RS485 general purpose interfaces
CN108267674A (en) * 2018-01-04 2018-07-10 广州金升阳科技有限公司 System is tested in a kind of comprehensive automation
CN111045967A (en) * 2019-10-12 2020-04-21 深圳市康必达控制技术有限公司 Automatic test switching circuit for serial port of communication manager
CN111224835A (en) * 2019-11-20 2020-06-02 深圳市康必达中创科技有限公司 Automatic switching method, device and system for serial port communication modes

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
单片机中TCP/IP协议子集的设计与实现;刘恩涛 等;《计算机工程与设计》;20041228(第12期);2282-2284 *
智能用采产品自动化测试***;李志鹏 等;《计算机应用》;20161215;第36卷(第s期);316-318 *

Also Published As

Publication number Publication date
CN114003455A (en) 2022-02-01

Similar Documents

Publication Publication Date Title
CN110611340A (en) Power supply control method, device, system, electronic equipment and storage medium
CN108595299B (en) Test system of terminal equipment
CN110855515A (en) Vehicle-mounted CAN network test auxiliary device
KR20200010053A (en) Electrical control system, and method for determining communication fault
CN114003455B (en) Serial port automatic test system, interface automatic test method and test platelet
CN106294250A (en) A kind of method keeping USB (universal serial bus) communication robust and relevant device
CN111929562B (en) Chip test system, test method, test response method of chip and chip
CN113282036A (en) Communication control device and method of HBS (hybrid bus system) and multi-split system
CN111337783A (en) Test circuit and test method thereof
CN114814365A (en) Multi-channel test control equipment, automatic multi-channel test system and method
CN211669545U (en) Test device and system for TBOX
CN108152593B (en) Portable full-automatic electric interface direct current resistance test system and test method
CN108693861B (en) Hot standby repeater, dual-computer hot standby system and control switching method
CN109406900B (en) Fault simulation device based on battery simulator
CN112748354A (en) Connection testing method and system for server power supply
CN105403792A (en) Solid state power distribution device reset function testing system and testing method
CN105182965A (en) Control unit fault test system and method
CN110749798A (en) High-power group charging direct current charging unit test system and test method
CN210927654U (en) On-vehicle ethernet interconnection intercommunity testing arrangement
CN216848541U (en) Pin signal processing circuit and vehicle fault detection device
CN115361315B (en) Openflow switch reliability test method and storage medium
CN111190845B (en) Communication circuit and method compatible with multiple devices
CN115776310A (en) Communication circuit, V2X device, vehicle and communication method
CN220653382U (en) TYPE-C port protocol testing device
CN219915827U (en) Cable insulation testing device

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