Background technology
Because unsettled power supply quality, often cause damage, deadlock and capsule information on the system equipment hardware far to lose, therefore (Uninterruptable Power System, standard indispensable when UPS) becoming precision equipments such as buying computer equipment gradually is equipped with UPS.
UPS is connected between civil power and computer, the electrical equipment, and there is storage battery its inside, and power supply just often is responsible for battery being full of and providing burning voltage, the life-span of protection computer, electric equipment.When running into city's electrical anomaly, difference according to the UPS design, be divided into online (On-Line), the off-line type (O " working method that the online interaction formula (LineInteract ive) of manufacturer's release Line) and is recently arranged; battery electric power is converted to alternating current continues to be supplied to the computer of connection or electrical equipment to use, reach the function of not cutting off the power supply.The service time of UPS is then according to its capacity difference to some extent.The big more person's power-on time of capacity (VA) is also longer, but this time length must be different according to the consumption electric power of institute's connection device, analogy is except connecting computer, equipment such as large-sized display, CD writer, loudspeaker have also been connect, weak point that will be more next than the power-on time that singly connects a computer, so power-on time must decide according to user's operating position.Type capacious also can be chosen battery pack and expand.
So-called city electrical anomaly is not only to be to have a power failure.The situation of city's electrical anomaly is except civil power interrupts (Power Cut), voltage sag (Sags) is still arranged, voltage swells (Swell), sharp wave (Spikes), abrupt voltage wave (Surges), noise disturbs (Noise), and topic exists between high (low) voltage transient (Transients) etc., and these topics cause the loss of computer equipment or software and hardwares such as precision instrument deadlock, inner member damage, reduction of service life and data loss easily.When these taking place be enough to inscribe between electric power quality that the equipment that influences runs well, UPS all can the automatic voltage regulation filtering noise information, the stable and clean power environment of the equipment that offers.
The function of UPS is not simple " continuing supply electric power ", even because adopted UPS, fails to recover supply as long as have no progeny in the civil power, still can be in the face of the crisis of outage.Therefore the user must have no progeny in civil power and handle immediately.UPS can help the user to win the time of buffering, the time that allows the user have to fill part handles important and information that must preserve: perhaps the people is or not the computer next door, so just must see through far-end control or the mode of the function that store data automatically, shut down automatically.The function of these high wisdom comprises the sound that gives a warning, sends the ability of Email and networking keyholed back plate, and these all must take attached software according to UPS, and the PORT COM (as: RS-232) that sees through computer is come and the computer communication.
Generally speaking, UPS can see through PORT COM and computer communication and transfer control signal.The kind of PORT COM has: universe contact (Dry Contact), RS-232, SNMP (SimpleNetwork Management Power), (Universal SerialBus USB) waits several for AS400, general-purpose COM port.Wherein AS400 is at the designed PORT COM of the computer of IBM; And the communications protocol of SNMP port can allow UPS directly connect the networking need not to see through computer, and sees through the networking UPS is monitored.
And universe contact, RS-232 and USB port are modal PORT COM, can directly retrieve the signal in the UPS and see through software knows whether civil power normal, battery whether low-voltage and save File, shutdown system etc. automatically.Wherein the simplest communication modes is to see through serial port in universe contact mode to come transmission signals with simple communication (Simple Signaling).Simple signal only can be represented two states or signal, shown in A, B among Fig. 1, represents two states respectively with Hi or Lo, but not a series of 0 or 1 signal.And simple signal communication type UPS does not all come the transmission data with asynchronous serial transmission (Asynchronous Serial Data Transmission) at present, therefore can't transmit a succession of data.So present simple signal communication type UPS can't provide plug and play (COM Plug and Play, COM PnP) device identification data to computer.
Embodiment
Some embodiments of the present invention can be described in detail as follows.Yet except describing in detail, the present invention can also be widely implements at other embodiment, and scope of the present invention do not limited, its with after claim be as the criterion.
Moreover for clearer description being provided and being more readily understood the present invention, graphic interior each several part is not drawn according to its relative size, and some size is compared with other scale dependents and exaggerated; Incoherent detail section is not drawn fully yet, in the hope of graphic succinct.
A preferred embodiment of the present invention is for utilizing DB9 PORT COM (being generally serial port), the pin of DB9 PORT COM is done arrangement, make of the arrangement of the UPS of simple signal mode transmission by such pin, also can transmit plug and play identification data to computer, make computer can recognize new equipment automatically, and the guiding user install suitable driver or application program.First table is the present invention integrates simple signal and plug and play to the DB9 PORT COM pin arrangement.
First table: DB9 pin
Title |
The pin of computer DB9 |
The definition of UPS |
The signal direction of transfer |
COM |
Pin5 |
Ground connection |
|
TXD |
Pin3 |
Be set at negative signal reference position |
Computer-UPS |
RXD |
Pin2 |
The plug and play identification string |
Yarn system-computer does not cut off the power supply |
RTS |
Pin7 |
Be set at positive signal reference position |
Computer-UPS |
CTS |
Pin8 |
The alternating current mistake |
UPS-computer |
DSR |
Pin6 |
Be coupled with Pin4 |
UPS-computer |
DTR |
Pin4 |
The shutdown of storage battery pattern far-end |
Computer-the yarn that do not cut off the power supply system |
CD |
Pin1 |
The storage battery electronegative potential |
UPS-computer |
RI |
Pin9 |
Pin9 |
|
Fig. 2 is the calcspar of a preferred embodiment of the present invention.Transport to switch 16, battery charger 18 and the microprocessor 1 of power failure behind alternating current input 10 process filters or the abrupt voltage wave protector 12.Battery charger 18 transfers alternating current to direct current so that battery 20 is charged, and 20 on battery changes into alternating current through adverse current device 22 with direct current and transports to electric power so fall switch 16.After alternating voltage process filter or abrupt voltage wave protector 12 are considered ripples, after decay, deliver to the detection of microprocessor 1 again as AC power.Microprocessor detects alternating voltage 12 (seeing through filter or abrupt voltage wave protector 12), battery 20, reaches UPS output 14; detect the supply status of judging power supply by this; when the source of alternating current input 10 instability or generation power breakdown; microprocessor 1 will issue a signal to adverse current device 22; make adverse current device 22 at once direct current be changed into alternating current and transport to power failure switch 16, power failure switch 16 electric power with output switched to from the power supply of adverse current device 22 and exported this moment.And microprocessor 1 detects the voltage of battery 20 with estimating battery 20 residual capacitances or only as the reference of hanging down storage battery.Microprocessor 1 meeting constantly spreads out of the status signal of UPS, these status signals 2 reach signal potential transducer 3, to signal potential transducer 3 signal 2 is changed current potentials and become serial port signal 4,, serial port signal 5 is reached host computer 7 through PORT COM 6.The user just can know present power supply state thus.
The positive and negative power supply of the reference of serial port can be provided by UPS.Perhaps, because plug and play is enumerated in the process of (Enumeration), TXD is maintained at the accurate position of negative signal, therefore can be used as the reference negative supply of serial port interface.And RTS can keep the accurate position of positive signal in the process of waiting for plug and play identification data, so scope at this moment, and RTS can be used as the reference positive supply of serial port interface.In addition, in the monitor procedure of UPS, application program can be made as TXD the accurate position of negative signal, and RTS is made as the accurate position of positive signal, and therefore in monitor procedure, the serial line interface of signal potential transducer 3 maintains positive and negative reference power source.
In the sequential that general plug and play is enumerated, the variation of the signal level of DTR, RTS and TXD as shown in Figure 3, being described as follows of its day part:
1. in the T1 period, plug and play is enumerated software can make DTR be positioned at the accurate position of positive signal the current potential Initiation of all pins of serial port, and RTS and TXD are positioned at the accurate position of negative signal, and wait for that plug-in device transmits the back-signalling of DSR.The about 200ms of this process (± 35ms), treat that therefore plug-in device needs back-signalling within 200ms.Because the present invention is coupled to DSR (for example: DTR and DSR short circuit, or detect DTR signal and back-signalling to DSR by microprocessor 1) with DTR, therefore response DTR forever.When computer receives the back-signalling of DSR, can enter the com port setting state.
2. in the T2 period, plug and play is enumerated software can be set at the accurate position of negative signal with DTR, RTS and TXD, entering the com port setting state, this T2 period continue 200ms (± 35ms).
3. in the T3 period, plug and play is enumerated software can be set at the accurate position of negative signal with RTS and TXD, and DTR is set at the accurate position of positive signal, to finish the com port setting state.This T3 period continue 200ms (± 35ms).
4. in the T4 period, plug and play is enumerated software can be set at TXD the accurate position of negative signal, RTS and DTR are made as the accurate position of positive signal, and wait for that plug-in device transmits the plug and play identifying information in the mode that 1200 Bao rates (bit/s) see through RXD (Pin2) simulation non-synchronous transmissions.
5., promptly begin to carry out the build-in services of new equipment if plug and play is enumerated the legal plug and play identifying information of information that the software inspection is received.
For a device that plug and play is provided, two important step of plug and play enumeration process are: (1). when the T1 period, DTR is positioned at the accurate position of positive signal during this period of time, and DTR is as the detection signal of plug and play.DSR must in 200ms (± respond the detection signal of DTR in 35ms).DTR of the present invention and DSR are owing to intercoupling, so can respond the detection of DTR immediately.(2). when the T4 period, when RTS is positioned at positive signal standard position, microprocessor 1 must be with the speed of 1200 Bao rates, simulate asynchronous serial with general output input pin and transmit the plug and play identifying information, the sequence transmission periphery that the present invention can also be provided with microprocessor 1 inside, as: UART (Universalasynchronous receiver transmitter) or USART (universal synchronous/asynchronous receiver transmitter), transmit the plug and play identifying information.
This
Invention utilization is detected RTS and whether is positioned at the accurate position of positive signal as waiting for that device begins to transmit the triggering signal of plug and play identifying information, therefore worked as in the T4 period, after the microprocessor of UPS has been accepted triggering signal, promptly begin to transmit the plug and play identifying information to computer.
Moreover the present invention also can detect signal that whether DTR be positioned at the accurate position of positive signal with microprocessor 1 and replace and detect RTS and whether be positioned at the accurate position of positive signal.Since signal potential transducer 3 be with the accurate position of the positive signal of RTS as with reference to positive supply, TXD uses as the reference negative supply.So when T1 and T3 period, RTS is in the accurate position of negative signal, so signal potential transducer 3 can't operate, and the accurate position of DTR positive signal can't correctly be sent to microprocessor.But when in T4 during the period, TXD is positioned at the accurate position of negative signal, RTS and DTR are positioned at the accurate position of positive signal, therefore by the running of signal level transducer 3 signal level of the accurate position of serial port interface DTR positive signal signal 4,5 are converted to the signal level of microprocessor signals 2.Like this triggering signal that microprocessor 1 can be in correct time detecting to DTR and begin to transmit the plug and play identifying information to computer.Therefore, the present invention also can replace detection RTS with the signal that detects the accurate position of DTR positive signal and whether be positioned at the accurate position of positive signal, replaces and waits for that device begins to transmit the triggering signal of plug and play identifying information.
CTS, CD and three pins of DTR that the present invention can see through serial port transmit the state of UPS and order as follows with simple signal:
1. civil power interrupts: when UPS finds that civil power too high, low with excessivelying, frequency overruns or civil power interrupts or the like the civil power abnormal state and will export commentaries on classics by the storage battery supply.Produce a simple signal to serial port CTS by UPS this moment, undesired and operate in the storage battery pattern with the warning civil power.
2. low storage battery: when UPS output is supplied by storage battery, if the storage battery off-capacity takes place or battery voltage is crossed low or the operating time surpasses factors such as the scheduled time, UPS produces a simple signal to serial port CD, and low storage battery of warning or UPS are about to shutdown.
3. storage battery pattern far-end shutdown: when not disconnected electric system Shu makes in the storage battery pattern, the user can set in the application program of computer after civil power interrupts or keep one (adjustable/fixing) period in the storage battery pattern, start shutdown programm, automatically store computer information, see through serial port DTR and transmit shutdown command to UPS.Perhaps, when low storage battery takes place or low storage battery when continuing one section (adjustable/fixing) after, start shutdown programm, store computer information automatically, transmit shutdown command to UPS.Receive the shutdown life from now on when UPS, and postpone one period set time (being stored in the microprocessor memory) back and carry out the UPS shutdown that the stop supplies power supply is to output loading.
Therefore, if detect the triggering signal that RTS transmits the plug and play identifying information to start with, then the present invention has five pins to be coupled to microprocessor.These five pins are respectively Pin8 (CTS), Pin4 (DTR), Pin1 (CD), Pin7 (RTS) and Pin2 (RXD), wherein CTS and CD transmit simple signal to computer, make computer end learn that the state of UPS: DTR is as the simple signal of accepting to be transmitted by computer the shutdown of storage battery pattern far-end; And whether RTS is in the state that receives the plug and play identifying information of waiting in order to detect computer, and RXD is in order to transmit the plug and play identifying information to computer.
If to detect the triggering signal that DTR transmits the plug and play identifying information to start with, then the present invention only needs to be coupled four pins to microprocessor.These four pins are respectively Pin8 (CTS), Pin4 (DTRJ, Pin1 (CD) and Pin2 (RXD).Because of DTR is that high signal reference position and TXD are when being the accurate position of low signal in RTS only, its signal just can see through signal potential transducer 3 and reach microprocessor 1, so in the plug and play enumeration process, can be used as the triggering signal of transmitting plug-in device identification data. and in the monitor procedure that does not cut off the power supply, the shutdown of storage battery pattern far-end is to see through DTR by host computer to send UPS to.Therefore, DTR is simultaneously as the usefulness of the storage battery pattern far-end shutdown of the triggering signal of plug and play process and simple signal.When it then be to judge by the time length that the current potential of DTR is kept the accurate position of positive signal for the triggering signal of plug and play process or the shutdown of storage battery pattern far-end.In the plug and play enumeration process, it is not long that DTR keeps time of the accurate position of positive signal, and it is long to transmit the signal time meeting of storage battery pattern far-end shutdown.Therefore utilize and judge that the length of keeping the accurate bit time of positive signal can determine DTR to be the triggering signal of plug and play process or the state of storage battery pattern far-end shutdown.Microprocessor 1 can suppose that earlier it is the plug and play triggering signal and begins to transmit the plug and play identifying information when one receives the DTR signal.Whole process detects the DTR signal when the DTR signal retracts electronegative potential always, again according to this signal duration length judge whether to be the shutdown of storage battery pattern far-end.Therefore, when computer was sent the signal of storage battery pattern far-end shutdown, UPS still can be sent the plug and play identifying information.So so computer end is sayed it is that insignificant can being left in the basket do not influence practical operation because of it.
From the above, the present invention is minimum can be used four pins to be coupled to microprocessor just can to reach plug and play function and the transmission of UPS simple signal, but this and the unrestricted pin count that is coupled to microprocessor.
The present invention can be used for various multi-form UPSs, for example: online, off-line type and online interaction formula UPS.Make the plug and play function can be integrated into the various UPSs of serial port simple signal communication type.
Comprehensive the above, the present invention has disclosed a kind of serial port simple signal communication type UPS of tool plug and play function.This UPS has comprised a uninterruptible power supply (UPS) device, a signal potential transducer and a serial port.And uninterruptible power supply (UPS) device has comprised a microprocessor.The signal potential transducer is with a microprocessor signals and the conversion mutually of the accurate position of a serial port signal.Serial port has comprised a DTR pin, a DSR pin and a RTS pin, and wherein DSR pin and DTR pin coupling makes the DSR pin produce a back-signalling to respond a plug and play detection signal of DTR pin.Wherein, in the program process, the RTS pin can transfer the accurate position of positive signal to by the accurate position of negative signal when a plug and play is enumerated.With the positive signal of RTS or the signal of the accurate position of DTR positive signal is a triggering signal, and microprocessor produces a plug and play identifying information after detecting triggering signal.
Therefore, universe contact mode compared to prior art is come transmission signals through serial port with simple communication, can't transmit plug-in device and do the knowledge data to computer, the present invention can be integrated into the function of plug and play the UPS of simple signal mode transmission, and utilize the general output input of microprocessor to simulate the serial port non-synchronous transmissions, to transmit the plug and play identifying information to computer, automatically recognize new equipment in order to operating system, and the guiding user installs suitable driver or application program.
The above is preferred embodiment of the present invention only, is not in order to limit claim of the present invention; All other do not break away from the equivalence of being finished under the disclosed spirit and change or modification, all should be included in following claim.