Embodiment:
Specify the present invention below by accompanying drawing.
Referring to Fig. 1, a kind of four remote unit apparatus, this system comprises software and hardware, wherein said software is computer program and each the unit software that possesses the whole system function controlled; Described hardware comprises remote unit, remote control unit, four modules in remote signalling unit and distant arteries and veins unit and the host computer that is connected by the RS485 bus.
Software program comprises initialization section, communications portion and function of tonic chord processing section; Initialization section comprises hardware initialization and data variable initialization (instrument configuration information, calibration information, SOE information); Communications portion adopts two serial ports, dual communication module and semiduplex RS485 communication modes, and this software program adopts the stipulations of MODBUS-RTU to write; Starting back slave station instrument is accepting state, and interrupt mode is finished transmitting-receiving.When receiving after data satisfy condition, adopt interrupt mode to carry out the data loopback, communication operation is divided into two kinds of data acquisition and information write operations, increases calibration and check communications protocol under the expansion production model simultaneously.
Its major function processing section comprises DI, DO, AI, and wherein DI partly finishes remote signalling and distant arteries and veins function, and DO partly finishes distant control function, and AI partly finishes telemetry function.
Each module adopts the software and hardware watchdog technique, eliminates the deadlock phenomenon with this.Modular structure is attractive in appearance, and each passage all has status indicator lamp, as the successful indicator light flicker of communicating by letter.
Each module can select host computer or local toggle switch that module's address and baud rate are set.
The function of four remote unit apparatus realizes by its described four unit modules that specifically these unit modules utilize the automation control operation of electronic circuit realization to RTU multichannel low-voltage distribution.Concrete circuit theory is as follows:
Referring to Fig. 2, remote unit module M32 has 32 circuit-switched data input/output interfaces, can be connected with elements such as temperature transmitter, pressure sensors, can gather simultaneously 32 tunnel-20mA~~20mA,-5V~~the 5V direct current, the remote measurement value of the standard signal of reflection transmitter or transducer.This module is used for analog signals such as electric current, voltage, temperature, pressure and is converted to digital signal realizing being connected by the RS485 bus with the host computer of supervisory control system through communication and carrying out exchanges data.
The concrete technical parameter of this remote unit module is as follows:
Input capacity: 32 tunnel.
Remote measurement precision: 0.5%.
Communication mode: RS485.
Operational environment: 55 ℃ of-5 ℃ of TO
Storage temperature: 85 ℃ of-25 ℃ of TO
Power supply: 18~36V AC/DC or 80~270V AC/DC
This remote unit module M32 specifically comprises power circuit, data acquisition circuit, A/D data converting circuit, data processing circuit, communication output circuit.
Referring to Fig. 3, the power circuit of power circuit and existing remote unit module is basic identical, also be to provide power supply, no longer the concrete syndeton of circuit be described in detail at this to data acquisition circuit, A/D data converting circuit, data processing circuit, communication output circuit.Data acquisition circuit is gathered 30 two road curtage signal conveys to A/D data converting circuit and is carried out the A/D conversion and be delivered to data processing circuit, is delivered to host computer by the communication output circuit after data processing circuit is handled;
Power circuit DC18V-36V input, output+9V ,-9V, VCC reach+the 5V power supply.
Referring to Fig. 4, the data acquisition circuit of remote unit module M32 and A/D data converting circuit and existing data acquisition circuit and A/D data converting circuit are basic identical, wherein data acquisition circuit mainly is made of four data acquisition module CD4051, the A/D data converting circuit is made of operational amplification circuit and A/D modular converter MAX191, and concrete circuit is connected this and is not described in detail.
32 tunnel-20mA~~20mA or-5V~~per 8 circuit-switched data in the 5V input are connected with the X0-X7 pin of a data acquisition module CD4051, the X pin of four data acquisition module CD4051 also meets the input that afterwards connects operational amplification circuit by a R33, the output termination A/D modular converter MAX191 of operational amplification circuit.
The special character of data acquisition circuit is to connect a mode of connection decision circuitry on the data acquisition circuit of remote unit module, this mode of connection decision circuitry comprises resistance R 62, comparator U5/LM393, the X pin parallel connected end of four CD4051 treatment elements of one termination of resistance R 62, the positive input of another termination comparator U5/LM393, the reverse input end ground connection of comparator U5/LM393, comparator U5/LM393 is connected to respectively+9V and-power supply of 9V, output connects (A11) PC3 pin of the processor A TMEGA128 of data processing circuit.
Insert mode of connection decision circuitry, data processing circuit can the butted line mode be differentiated, thereby has enlarged the scope of input value.
Referring to Fig. 5, data processing circuit comprises processor A TMEGA128 and relevant peripheral circuit, and is also basic identical with the data processing circuit of existing remote unit module M32, is not described in detail at this.Wherein the PB1 of processor A TMEGA128 (SCK), PB2 (MOSI), PB3 (MISO) pin connect C, B, the A tripod of four data acquisition module CD4051, and the PB4 of ATMEGA128 (OC0), PB5 (OC1A), PB6 (OC1B), PB7 (OC2/OC1CB) pin connect the INT pin of four data acquisition module CD4051 respectively; The PA0 of processor A TMEGA128 (AD0), PA1 (AD1), PA2 (AD2), PA3 (AD3), PA4 (AD4), PA5 (AD5), PA6 (AD6), PA7 (AD7), PE2 (AC+/XCK0), PE3 (AC-/OC3A), PE4 (INT4/OC3B), PE5 (INT5/OC3C) pin meets the D0/D8 of A/D modular converter MAX191 respectively, D1/D9, D2/D10, D3/D11, D4, D5/SSTRB, D6/SCLKOUT, D7/DOUT, HBEN, RD, CS, the BUSY pin, the PC4 of processor A TMEGA128 (A12), PC5 (A13), PC6 (A14), PC7 (A15), PD4 (IC1), PD5 (XCK1), PD6 (T1), PD7 (T2), PE6 (INT6/T3), PE7 (INT7/IC3) pin meets local toggle switch SW, by local toggle switch SW module's address and baud rate is set.Can certainly module's address and baud rate be set by host computer.
The PC0 of processor A TMEGA128 (A8), PC1 (A9), PC2 (A10) meet status indicator lamp LM2, LM3, LM4 respectively.
The PE0 of processor A TMEGA128 (PDI/RXDO), PE1 (PDO/TXD0) pin connects one tunnel communication output circuit, this communication output circuit is by two optocoupler U8, U9, triode Q1, communication module U10, resistance R 45, R46, R47, R48, R49, R50, R51, R52, R53 forms, the A1 of RS485 bus, the B1 end is respectively by resistance R 52, R51 connects 6 of letter module U10,7 pin, 5 pin and the ground connection of C1 terminated communications module U10, the 8 pin connecting resistance R47 of communication module U10, the end of R50 also connects+the 5V power supply, input one end of resistance R 47 another termination optocoupler U8,1 pin of another terminated communications module of the input of optocoupler U8 U10,4 pin of another terminated communications module U10 of resistance R 50, output one end of optocoupler U9 and resistance R 49 1 ends, the output other end ground connection of optocoupler U9, the base stage of resistance R 49 another termination triode Q1,2 of communication module U10,3 pin and connect after connect the collector electrode of triode Q1 and an end of resistance R 48, another termination+5V power supply of resistance R 48, the grounded emitter of triode Q1, the output one end ground connection of optocoupler U8, PE0 (PDI/RXDO) pin of another termination processor A TMEGA128 and connect the VCC power supply by resistance R 46, the VCC power supply connects input one end of optocoupler U9, PE1 (PDO/TXD0) pin of another termination processor A of the input of optocoupler U9 TMEGA128 by resistance R 45.
The PD2 of processor A TMEGA128 (INT2/RXD1), PD3 (INT3/TXD1) pin connects another road communication output circuit, this communication output circuit is by two optocoupler U11, U12, triode Q2, communication module U13, resistance R 53, R54, R55, R56, R57, R58, R59, R60, capacitor C 9, C10 forms, the A2 of RS485 bus, the B2 end is respectively by resistance R 59, R60 connects 6 of letter module U13,7 pin, 5 pin and the ground connection of C2 terminated communications module U10, the 8 pin connecting resistance R55 of communication module U13, the end of R58 also connects+the 5V power supply, input one end of resistance R 55 another termination optocoupler U11,1 pin of another terminated communications module of the input of optocoupler U11 U10,4 pin of another terminated communications module U13 of resistance R 58, output one end of optocoupler U12 and resistance R 57 1 ends, the output other end ground connection of optocoupler U12, the base stage of resistance R 57 another termination triode Q2,2 of communication module U13,3 pin and connect after connect the collector electrode of triode Q2 and an end of resistance R 56, another termination+5V power supply and the capacitor C 9 of resistance R 56, a C10 end in parallel, capacitor C 9, the grounded emitter of the C10 other end in parallel and triode Q2, the output one end ground connection of optocoupler U11, PD2 (INT2/RXD1) pin of another termination processor A TMEGA128 and connect the VCC power supply by resistance R 54, the VCC power supply connects input one end of optocoupler U12, PD3 (INT3/TXD1) pin of another termination processor A of the input of optocoupler U12 TMEGA128 by resistance R 53.
Communication module U10, U13 model are 65LBC184.
Two-way communication output circuit, one tunnel communication are used for that remote unit module general parameter is provided with and debugging, and another road is used to read and the remote unit value is set.
Referring to Fig. 6, remote control unit module J 16 may command No. 16 relays output can be write down 3200 sequence of events recording of 16 passages (SOE) and be connected by the RS485 bus with host computer by software output and be carried out exchanges data.Accurately reflect the relay incident.
The technical parameter of remote control unit module J 16 is as follows:
Output capacity: 5A/250VAC or 5A/30VDC.
Remote control accuracy rate: 100%.
Remote control sweep time: 1ms.
Input circuit: 16 tunnel.
Sequence of events recording (SOE) capacity: 3200.
Communication mode: RS485.
Operational environment: 55 ℃ of-5 ℃ of TO
Storage temperature: 85 ℃ of-25 ℃ of TO
Power supply: 18~36V AC/DC or 80~270V AC/DC
Remote control unit module J 16 comprises communication imput output circuit, signal processing circuit, ten six tunnel controlling output circuit that are connected and receive the PC control signal with host computer, the communication imput output circuit is a two-way, one tunnel communication is used for that remote control unit module general parameter is provided with and debugging, and another road is used to read and the remote control unit value is set.
Signal processing circuit is controlled 16 actuatings of relay by ten six tunnel controlling output circuit after to signal processing.
Referring to Fig. 8, the signal processing circuit basically identical of the signal processing circuit of remote control unit module J 16 and existing remote control unit module is not described in detail at this.The processor that signal processing circuit adopts is ATMEGA128.
Referring to Fig. 7, the PE0 of processor A TMEGA128 (PDI/RXDO), PE1 (PDO/TXD0) pin connects one tunnel communication output circuit, this communication output circuit is by two optocoupler IC9A, IC9B, triode Q1, communication module IC10, resistance R 6, R7, R8, R9, R10, R11, R12, R13 forms, the A1 of RS485 bus, the B1 end is respectively by resistance R 13, R12 connects 6 of letter module I C10,7 pin, 5 pin and the ground connection of C1 terminated communications module I C10, the 8 pin connecting resistance R8 of communication module IC10, the end of R11 also connects+the 5V power supply, input one end of resistance R 8 another termination optocoupler IC9A, 1 pin of another terminated communications module I of the input of optocoupler IC9A C10,4 pin of another terminated communications module I C10 of resistance R 11, output one end of optocoupler IC9B and resistance R 10 1 ends, the output other end ground connection of optocoupler IC9B, the base stage of resistance R 10 another termination triode Q1,2 of communication module IC10,3 pin and connect after connect the collector electrode of triode Q1 and an end of resistance R 9, another termination+5V power supply of resistance R 9, the grounded emitter of triode Q1, the output one end ground connection of optocoupler IC9A, PE0 (PDI/RXDO) pin of another termination processor A TMEGA128 and connect the VCC power supply by resistance R 7, the VCC power supply connects input one end of optocoupler IC9B, PE1 (PDO/TXD0) pin of another termination processor A of the input of optocoupler IC9B TMEGA128 by resistance R 6.
The PD2 of processor A TMEGA128 (INT2/RXD1), PD3 (INT3/TXD1) pin connects another road communication output circuit, this communication output circuit is by two optocoupler IC11A, IC11B, triode Q2, communication module IC13, resistance R 14, R15, R16, R17, R18, R19, R20, R21, capacitor C 6, C7 forms, the A2 of RS485 bus, the B2 end is respectively by resistance R 21, R20 connects 6 of letter module I C13,7 pin, 5 pin and the ground connection of C2 terminated communications module I C13, the 8 pin connecting resistance R16 of communication module IC13, the end of R19 also connects+the 5V power supply, input one end of resistance R 16 another termination optocoupler IC11A, 1 pin of another terminated communications module I of the input of optocoupler IC11A C13,4 pin of another terminated communications module I C13 of resistance R 19, output one end of optocoupler IC11B and resistance R 18 1 ends, the output other end ground connection of optocoupler IC11B, the base stage of resistance R 18 another termination triode Q2,2 of communication module IC13,3 pin and connect after connect the collector electrode of triode Q2 and an end of resistance R 17, another termination+5V power supply and the capacitor C 6 of resistance R 17, a C7 end in parallel, capacitor C 6, the grounded emitter of the C7 other end in parallel and triode Q2, the output one end ground connection of optocoupler IC11A, PD2 (INT2/RXD1) pin of another termination processor A TMEGA128 and connect the VCC power supply by resistance R 15, the VCC power supply connects input one end of optocoupler IC11B, PD3 (INT3/TXD1) pin of another termination processor A of the input of optocoupler IC11B TMEGA128 by resistance R 14.
Communication module IC10, IC13 model are 65LBC184.
Two-way communication output circuit, one tunnel communication are used for that remote control unit module general parameter is provided with and debugging, and another road is used to read and the remote control unit value is set.
Referring to Fig. 9, ten six tunnel controlling output circuit of remote control unit module J 16 and ten six tunnel controlling output circuit basically identicals of existing remote control unit module, its difference is that ten six tunnel controlling output circuit of remote control unit module J 16 connect a led state display circuit in each control output end, road, the led state display circuit one termination+12V power supply that constitutes by light-emitting diode L5 and resistance R 22 wherein, the OUT1 pin of another termination driver module IC15/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L6 and resistance R 23 constitute, the OUT2 pin of another termination driver module IC15/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L7 and resistance R 24 constitute, the OUT3 pin of another termination driver module IC15/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L8 and resistance R 25 constitute, the OUT4 pin of another termination driver module IC15/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L9 and resistance R 26 constitute, the OUT5 pin of another termination driver module IC15/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L10 and resistance R 27 constitute, the OUT6 pin of another termination driver module IC15/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L11 and resistance R 28 constitute, the OUT7 pin of another termination driver module IC15/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L12 and resistance R 29 constitute, the OUT8 pin of another termination driver module IC15/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L13 and resistance R 30 constitute, the OUT1 pin of another termination driver module IC17/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L14 and resistance R 31 constitute, the OUT2 pin of another termination driver module IC17/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L15 and resistance R 32 constitute, the OUT3 pin of another termination driver module IC17/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L16 and resistance R 33 constitute, the OUT4 pin of another termination driver module IC17/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L17 and resistance R 34 constitute, the OUT5 pin of another termination driver module IC17/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L18 and resistance R 35 constitute, the OUT6 pin of another termination driver module IC17/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L19 and resistance R 36 constitute, the OUT7 pin of another termination driver module IC17/ULN2803; By led state display circuit one termination+12V power supply that light-emitting diode L20 and resistance R 37 constitute, the OUT8 pin of another termination driver module IC17/ULN2803.
Connect a led state display circuit in each road controlling output circuit output, the output state of display control signal is convenient to find fault intuitively.
Referring to Figure 10, remote signalling unit module K32 can gather 32 tunnel active wet contacts or passive dry contact switching value signal simultaneously.Signal adopts photoelectricity to isolate input, effectively protects internal circuit not disturbed to damage by extraneous strong signal.Be connected by the RS485 bus with host computer and carry out exchanges data, reflect the switching value state in real time, and can store 32 tunnel 3200 sequence of events recording (SOE information), accurately reflect the switching value incident.
The technical parameter of remote signalling unit K32 is as follows:
The switching value temporal resolution: multiple-contact is the separating capacity of displacement in succession, and any two contact displacements are during interval greater than 1 millisecond, and the separating capacity of unit (less than 2ms) also embodies in SOE.
Remote signalling Scanning speed: 32 passage run-down required time 1ms.
The time of trembling is gone in remote signalling: what 32 all passages were unified goes the time of trembling.
Sequence of events recording (SOE) capacity: 3200.
Input circuit: 32 tunnel.
Input mode: active wet contact or passive dry contact.
Communication mode: RS485.
Operational environment: 55 ℃ of-5 ℃ of TO
Storage temperature: 85 ℃ of-25 ℃ of TO
Power supply: 18~36V AC/DC or 80~270V AC/DC.
Distant arteries and veins unit module P32 acquisition pulse amount is connected by the RS485 bus with host computer carries out exchanges data, can carry out step-by-step counting to the meritorious or idle pulse electricity meter of electric power, and the count value power down protection also can be counted the frequency in the automation.
The technical parameter of distant arteries and veins unit module P32 is as follows:
Distant arteries and veins is gathered capacity: the 32 tunnel
Distant affectionately wide: 10ms.
Accumulative total umber of pulse (MAX): 4294967296 (nybbles)
Input mode: active wet contact or passive dry contact.
Communication mode: RS485.
Operational environment: 55 ℃ of-5 ℃ of TO
Storage temperature: 85 ℃ of-25 ℃ of TO
Power supply: 18~36V AC/DC or 80~270V AC/DC.
Remote signalling unit module K32 comprises power circuit, 30 two-way switch signals collecting input circuits, signal processing circuit, the output circuit of communicating by letter with distant arteries and veins unit module P32, power circuit provides power supply for 30 two-way switch signals collecting input circuits, signal processing circuit, communication output circuit, 30 two-way switch signals collecting input circuits are delivered to signal processing circuit with the switching pulse signal of gathering, signal processing circuit is handled the back and is delivered to host computer by the communication output circuit
Referring to Figure 11, the power circuit of the power circuit of remote signalling unit module K32 and distant arteries and veins unit module P32 and existing remote signalling unit module and distant arteries and veins unit module is basic identical, be not described in detail at this, it is input as DC18V-36V, be output as+12V, VCC ,+5V.
Referring to Figure 12,30 two-way switch signals collecting input circuit basically identicals of the 30 two-way switch signals collecting input circuits of remote signalling unit module K32 and distant arteries and veins unit module P32 and existing remote signalling unit module and distant arteries and veins unit module, a difference is that this active wet contact connects+12V at switching signal input termination one active wet contact.Make things convenient for the user to realize passive dry contact and active wet node selection, enlarged the range of application of device,
Another difference is 32 road optocoupler inputs sending and receiving optical diode L1 to L32 respectively, the end of the other end connecting resistance R1 to R32 of light-emitting diode L1 to L32.Can observe the state of switching signal so intuitively, be convenient to judge the operating state of switch.
Referring to Figure 13, the signal processing circuit of remote signalling unit module K32 and the signal processing circuit of existing remote signalling unit module are just the same, at this its annexation no longer are described in detail.
Referring to Figure 14, the signal processing circuit of distant arteries and veins unit module P32 and the signal processing circuit of existing distant arteries and veins unit module are just the same, at this its annexation no longer are described in detail.
Processor is ATMEGA128 in the signal processing circuit of remote signalling unit module K32 and distant arteries and veins unit module P32, its PE0 (PDI/RXDO), PE1 (PDO/TXD0) pin connects one tunnel communication output circuit, referring to Figure 15, this communication output circuit is by two optocoupler IC24, IC25, triode Q1, communication module IC28, resistance R 42, R43, R44, R48, R49, R52, R54, R55 forms, the A1 of RS485 bus, the B1 end is respectively by resistance R 55, R54 connects 6 of letter module I C28,7 pin, 5 pin and the ground connection of C1 terminated communications module I C28, the 8 pin connecting resistance R43 of communication module IC28, the end of R44 also connects+the 5V power supply, input one end of resistance R 43 another termination optocoupler IC24,1 pin of another terminated communications module I of the input of optocoupler IC24 C28,4 pin of another terminated communications module I C28 of resistance R 44, output one end of optocoupler IC25 and resistance R 52 1 ends, the output other end ground connection of optocoupler IC25, the base stage of resistance R 52 another termination triode Q1,2 of communication module IC26,3 pin and connect after connect the collector electrode of triode Q1 and an end of resistance R 49, another termination+5V power supply of resistance R 49, the grounded emitter of triode Q1, the output one end ground connection of optocoupler IC24, PE0 (PDI/RXDO) pin of another termination processor A TMEGA128 and connect the VCC power supply by resistance R 48, the VCC power supply connects input one end of optocoupler IC25, PE1 (PDO/TXD0) pin of another termination processor of the input of optocoupler IC25 MEGA128 by resistance R 42.
The PD2 of processor A TMEGA128 (INT2/RXD1), PD3 (INT3/TXD1) pin connects another road communication output circuit, referring to Figure 15, this communication output circuit is by two optocoupler IC26, IC27, triode Q2, communication module IC29, resistance R 45, R46, R47, R50, R51, R53, R56, R57, capacitor C 31, C19 forms, the A2 of RS485 bus, the B2 end is respectively by resistance R 57, R56 connects 6 of letter module I C29,7 pin, 5 pin and the ground connection of C2 terminated communications module I C29, the 8 pin connecting resistance R46 of communication module IC29, the end of R47 also connects+the 5V power supply, input one end of resistance R 46 another termination optocoupler IC26,1 pin of another terminated communications module I of the input of optocoupler IC26 C29,4 pin of another terminated communications module I C13 of resistance R 47, output one end of optocoupler IC27 and resistance R 53 1 ends, the output other end ground connection of optocoupler IC27, the base stage of resistance R 53 another termination triode Q2,2 of communication module IC29,3 pin and connect after connect the collector electrode of triode Q2 and an end of resistance R 51, another termination+5V power supply and the capacitor C 31 of resistance R 51, a C19 end in parallel, capacitor C 31, the grounded emitter of the C19 other end in parallel and triode Q2, the output one end ground connection of optocoupler IC26, PD2 (INT2/RXD1) pin of another termination processor MEGA128 and connect the VCC power supply by resistance R 50, the VCC power supply connects input one end of optocoupler IC27, PD3 (INT3/TXD1) pin of another termination processor of the input of optocoupler IC27 MEGA128 by resistance R 45.
Communication module IC28, IC29 model are 65LBC184.
Two-way communication output circuit, one tunnel communication are used for the remote signalling unit module and distant arteries and veins unit module general parameter is provided with and debugging, and another road is used to read and remote signalling unit module and distant arteries and veins unit module value be set.
More than be one of embodiments of the present invention,, do not spend performing creative labour, on the basis of the foregoing description, can do multiple variation, can realize purpose of the present invention equally for those skilled in the art.But this variation obviously should be in the protection range of claims of the present invention.