Fire-fighting two-bus communication simulation method
The invention relates to the field of fire-fighting fire alarm systems, in particular to a simulation method of a fire-fighting fire alarm system based on a two-bus communication principle.
A fire alarm control system with two buses is characterized in that two buses are connected from a loop connecting terminal of a host part, all fire sensors such as temperature sensors and smoke sensors and part fire controllers such as manual button switches, fire hydrants, water flow indicators, fire doors, smoke exhaust valves, air supply valves and other addressable devices are hung on the buses in parallel. They are not powered by themselves and are powered by a bus. One of the two wires is a ground wire, and the remaining wire serves as a power line to supply power to each sensor and equipment in idle time, and also serves as a host to inspect each sensor and equipment and control signal transmission lines of each node so as to realize monitoring and control of each sensor and equipment by the host.
The two buses are an industrial field bus developed in recent years, which is a high-reliability automatic synchronous coding and decoding communication network and can convert a plurality of analog quantities of field nodes into digital quantities and carry out long-distance serial transmission. The two buses have the following characteristics: 1) intelligent tracking automatic coding and decoding; 2) remote monitoring, wherein the monitoring distance can reach 2000 m; 3) signals and power are transmitted simultaneously, and the nodes do not need to be supplied with power independently; 4) the number of loop nodes can be increased or decreased according to the scale, and the upper limit is determined by the number of address coding bits, the power consumption of the field nodes and the coding mode; 5) a bus short-circuit isolator can be additionally arranged, and the local short circuit cannot influence the whole system work. Due to the characteristics, the system is widely applied to the fields of remote monitoring, data acquisition, fire alarm and the like.
At present, most products of the automatic fire alarm system cannot be replaced mutually because all fire-fighting manufacturers adopt a self-defined two-bus communication protocol, a unified communication protocol standard does not exist, the adjustable information rate range is wide, the unified information rate needs to be adopted in the same system, and a hardware circuit for two-bus communication lacks direct operation and visual display of the working process of a hardware module.
Disclosure of Invention
In order to solve the technical problem, the invention provides a fire-fighting two-bus communication simulation method, which comprises the following steps:
the method comprises the following steps:
(1) the upper computer establishes a parameter configuration table and a control instruction set, and issues control instructions and sets parameters to the simulation main control module and the simulation sensor module through serial communication; parameter information fed back by the simulation main control module and the simulation sensor module is displayed through the state parameter table;
(2): the simulation master control module receives the upper computer control instruction, analyzes the downlink protocol, and controls the bus level amplitude and the level duration time interval through a hardware circuit to realize the master control instruction sending function;
(3) the analog sensor acquisition module acquires a level signal and duration time on the bus, analyzes the level signal and the duration time into a digital signal and uploads the digital signal to an upper computer;
(4) the analog sensor acquisition module analyzes the downlink protocol of the upper computer, controls the current amplitude of the bus and the current duration time interval through a hardware circuit, realizes the function of sending sensor data information, and realizes the communication simulation of the fire-fighting two buses.
Furthermore, the two-bus communication simulation method is mainly used for a fire-fighting fire alarm system with two-bus communication.
The upper computer is composed of a computer terminal with a display, and is loaded with upper computer two-bus communication simulation display control software.
The simulation main control module consists of a main control hardware circuit and embedded software operated by a main control chip of the main control hardware circuit.
The analog sensor module is composed of a sensor hardware circuit and embedded software operated by a main control chip thereof.
Furthermore, the simulation main control module and each simulation sensor module are in communication connection through two buses.
The analog main control module outputs voltage control signals, generates digital signals by voltage conversion of 0V, +12V and +24V and reasonably controlling the time of keeping various levels, traverses the analog sensor module on the bus by adopting a polling mode, and realizes the transmission of instruction signals of the analog sensor. Meanwhile, the simulation main control module realizes the electric energy supply to each simulation sensor module through two buses. The simulation main control module collects current on the loop through the analog quantity collection circuit, analyzes the current signal and obtains state data information fed back by the sensor in the loop.
The sensor module outputs current feedback signals, generates digital signals by current transformation of 0mA and +4mA and reasonably controlling the time of keeping various currents, and outputs corresponding feedback information in the inspection process of the main control module. The analog sensor module collects the current on a rear loop of the sensor module through the analog quantity collecting circuit, analyzes the current signal and obtains the state data information fed back by the sensor in the rear loop.
Furthermore, the 0V, +12V, +24V voltage signal of the output of analog master control module, produce through the make-and-break of two-way triode of single chip microcomputer control.
The analog sensor module outputs 0mA and +4mA current signals, and voltage drop is generated on the resistor with fixed resistance value by controlling the on-off of the triode, so that current is generated and enters the main loop.
The analog main control module performs current-voltage conversion, amplification and filtering processing on current in the loop through the analog operational amplifier, and the acquisition of loop current signals is realized through the analog quantity acquired and processed by the single chip microcomputer.
The invention has the following beneficial effects:
(1) the simulation main control module and the simulation sensor module can burn different communication protocol analysis strategies in real time and perform simulation verification on various systems communicated by two bus protocols;
(2) the upper computer is communicated with the simulation main control module and the simulation sensor module to establish two bus simulation communication man-machine interfaces, required control instructions and configuration parameters can be directly sent to the main control module through the parameter configuration table and the instruction set, uplink messages of the main control module and the sensor module are received, and bus information acquired by the module is visually acquired.
(3) Any two bus sensors can be hung on the bus, and the simulation method simulates the communication simulation of the loop card and the sensors, so that the simulation method has higher flexibility and adaptability.
The following describes embodiments of the present invention in further detail with reference to the accompanying drawings.
FIG. 1 is a schematic diagram of the overall composition of a two-bus communication simulation system;
FIG. 2 is a schematic diagram of the hardware components of a two-bus communication simulation system;
fig. 3 is a schematic diagram of an upper computer structure of a two-bus communication simulation system.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
As shown in fig. 1, the analog communication system mainly includes an upper computer, an analog main control module, and an analog sensor. The upper computer realizes the communication between the simulation main control module and the upper computer through a serial interface, issues control instructions and configuration parameters to the main control module, and acquires relevant state parameters of the main control module. The upper computer realizes the communication between the upper computer and the analog sensor module through the serial interface, and obtains the relevant state parameters of the analog sensor module. The analog sensor module is hung on two buses, wherein one bus is a 24V power supply and signal line, and the other bus is a 0V loop power supply line. A0V loop power line penetrates through the internal resistor of the analog sensor module and then is connected to the next sensor module, and a 24V power supply and a signal line directly penetrate through the power supply input end of the sensor module and are connected to the power supply input end of the next sensor.
As shown in fig. 2, the analog main control module operates in a low power consumption mode in a standby state, performs downlink message analysis after receiving an upper computer control instruction or configuration parameters, and converts the message instruction analysis into a level signal to be output. The main control module controls the two triodes through the output pin, the control module outputs a control signal level amplitude of 0V, +12V or +24V, and simultaneously controls the on-off time of the triodes according to the internal clock of the controller, so that the duration of each level amplitude is controlled, and a level signal containing data information is output.
The simulation main control module controls the three-level signal to inspect the simulation sensor module. The analog sensor module acquires voltage signals in a loop in real time through the voltage acquisition circuit, compares the processed voltage signals with +12V and +24V through the comparator to acquire bus level information, analyzes information contained in the level information, and acquires control instructions and configuration parameters issued by the master controller. The controller executes corresponding operations according to the control instruction and the configuration parameters, such as feeding back corresponding information of the sensor module according to the query instruction, changing the sensitivity parameter of the sensor, modifying the short address and the like.
The analog sensor module controls the loop current signal to respond to the analog main control module. The analog sensor module controls the two triodes through the output pin, and generates current through voltage drop generated on the resistor with the fixed resistance value, so that the control module outputs the current in a loop, and simultaneously controls the on-off time of the triodes according to the internal clock of the controller, thereby controlling the time of the current amplitude value, and further outputting a current signal containing data information.
As shown in fig. 3, a main control interface of the upper computer display control software is used as a human-computer interaction interface, an operator issues a corresponding control instruction through an instruction set, sets parameters such as a short address and sensitivity of the sensor module through a parameter configuration table, and issues the control instruction to the module-end controller through a serial interface between the upper computer and the module through a downlink after the instruction is issued. And meanwhile, the serial interface receives the state parameters from the module end, and the state parameters are transmitted to the state parameter table of the master control interface of the upper computer in an ascending way to be displayed in real time.