Mirror host
Other mirrors
Download
  Source
Packages
Support
  Cables
Client projects
Compatibility
Documentation
Driver projects
FAQ
Features
Mailing lists
UPS protocols
Server projects
Walnut community

Network UPS Tools

Megatec Protocol information

                        VERSION : 2.7

                        DATE : SEP. 30, 1995

		DATE	:V2.7	: JULY 30 ,1996

DATE	DESCRIPTION	MODIFY BY	
2.6	95-9-30	UPDATE "D" COMMAND (SS.SS -> SSS.SS)	Kevin Chiou	
2.7	96-8-01	Disable "D" COMMAND	Kevin Chiou	
				
A. General: This document specifies the RS232C communication protocol of
            the Advance-Intelligent UPS. The protocol provided the following
            features :

            1. Monitor charger status.
            2. Monitor battery status and condition.
            3. Monitor the utility status.
            4. Provide the power switch function for computer to turn on and
               off the utility on schedule for power saving.

            Computer will control information exchange by a query followed by
            <cr>. UPS will respond with information followed by a <cr> or
            action.

B. Hardware:

            BAUD RATE............... : 2400 bps
            DATA LENGTH.......... : 8 bits
            STOP BIT..................... : 1 bit
            PARITY........................ : NONE

            CABLING :

               COMPUTER                  UPS
            ===================================
                  RX   <----------   TX  (pin 9)
                  TX    ---------->  RX  (pin 6)
                  GND  <----------   GND (pin 7)

                  (9 pins female D-type connector)

C. COMMUNICATION PROTOCOL:

1. Status Inquiry:

Computer : Q1<cr>
        UPS      : UPS status data stream, such as
             (MMM.M NNN.N PPP.P QQQ RR.R S.SS TT.T  b7b6b5b4b3b2b1b0<cr>

        UPS status data stream :
	There should be a space character between every field for data
	separation. The meaning of each field is list as followed:

                a. Start byte    : (

		b.I/P voltage   : MMM.M
                  M is and integer number ranging from 0 to 9.
                  The unit is Volt.

                c.I/P fault voltage : NNN.N
                  N is and integer number ranging from 0 to 9.
                  The unit is Volt.

                  ** For OFF LINE UPS**

                    Its purpose is to identify a short duration voltage glitch
                  which cause OFF line UPS to go to Invter mode. If this occurs
                  input voltage will appear normal at query prior to glitch and
                  will still appear normal at next query.
                    The I/P fault voltage will hold glitch voltage till next
                  query. After query, the I/P fault voltage will be same as I/P
                  voltage until next glitch occurs.

                  ** For ON LINE UPS**

                    Its purpose is to identify a short duration utility fail
                  which cause ON line UPS to go to battery mode. If this occurs
                  input voltage will appear normal at query prior to fail and
                  will still appear normal at next query.
                    The I/P fault voltage will hold utility fail voltage till
                  next query. After query, the I/P voltage will be same as I/P
                  voltage until next utility fail occurs.

                d.O/P voltage   : PPP.P
                  P is an integer number ranging form 0 to 9.

                  The unit is Volt.

                e.O/P current   : QQQ
                  QQQ is a percent of maximum current, not an absolute value.

                f.I/P frequency : RR.R
                  R is an integer number ranging from 0 to 9.
                  The unit is HZ.

                g.Battery voltage : SS.S or S.SS
                  S is an integer number ranging from 0 to 9.
                    For on-line units battery voltage/cell is provided in the
                  form S.SS .
                    For standby units actual battery voltage is provided in
                  the form SS.S .
                    UPS type in UPS status will determine which reading was
                  obtained.

                h.Temperature   : TT.T
                  T is an integer number ranging form 0 to 9.
                  The unit is degree of centigrade.

                i.UPS Status    : <U>
                  <U> is one byte of binary information such as
                  <b7b6b5b4b3b2b1b0>.
 					Where bn is a ASCII character '0' or '1'.
.
UPS status :
Bit 	            Description                 	
 7  	1 : Utility Fail (Immediate)            	
 6  	1 : Battery Low                         	
 5  	1 : Bypass/Boost or Buck Active                 	
 4  	1 : UPS Failed                          	
 3  	1 : UPS Type is Standby (0 is On_line)  	
 2  	1 : Test in Progress                    	
 1  	1 : Shutdown Active                     	
 0  	1 : Beeper On                             	

j.Stop Byte     : <cr>

			Example: Computer : Q1<cr>
		    UPS      :
                         (208.4 140.0 208.4 034 59.9 2.05 35.0 00110000<cr>

                       Means    : I/P voltage is 208.4V.
                                  I/P fault voltage is 140.0V.
                                  O/P voltage is 208.4V.
                                  O/P current is 34 %.
                                  I/P frequency is 59.9 HZ.
                                  Battery voltage is 2.05V.
                                  Temperature is 35.0 degrees of centigrade.
                                  UPS type is on-line , UPS failed. Bypass
                                  active , and shutdown not active.

  2. Test for 10 seconds:

        Computer  : T<cr>
        UPS       : Test for 10 seconds and return to utility.

        If battery low occur during testing, UPS will return to
        utility immediately.

   3.Test until battery low :

        Computer  : TL<cr>
        UPS       : Test until battery low and return to utility.

   4.Test for specified time period :

        Computer  : T<n><cr>
        UPS       : Test for <n> minutes.

        a. During testing, UPS returns to utility immediately, if
           battery low occur.
        b. <n> is a number ranging from 01 to 99.

   5. Turn On/Off beep -- Toggle the UPS beeper :

        Computer  : Q<cr>

        When the AC power failed, UPS will generate a warning beep to
        inform the manager. Manager could toggle the warning beep by
        sending this command .

   6. Shutdown Command :

        Computer  : S<n><cr>
        UPS       : Shut UPS output off in <n> minutes.

        a. The UPS output will be off in <n> minutes, even if the
           utility power is present.
        b. If the battery low occurs before <n> minutes, the
           output is turned off immediately.
        c. After UPS shutdown, the controller of UPS monitors the
           utility power. If the utility is recovered, the UPS will wait
           for 10 seconds and connect the utility to output.
        d. <n> is a number ranging form .2, .3, ..., 01, 02, ..., up to 10.

        For example : S.3<cr> --- shut output off in (.3) minutes

   7. Shutdown and Restore Command :

        Computer  : S<n>R<m><cr>
        UPS       : Shut UPS output off in <n> minutes, and waiting
                    for <m> minutes then turn on UPS output again.

        a. The shutdown sequence is the same as the previous command.
           When the <m> minutes expired, the utility do not restore,
           the UPS will wait until utility restore.
        b. If UPS is in shutdown waiting state, the "C" command can
           let the shutdown procedure cancelled.
        c. If UPS is in restore waiting state, the "C" command can
           let the UPS output turned on, but UPS must be hold off at
           least 10 seconds. (if utility is present)
        d. <n> is a number ranging form .2, .3, ..., 01, 02, ..., up to 10.
        e. <m> is a number ranging form 0001 to 9999.

   8. Cancel Shutdown Command :

        Computer  : C<cr>
        UPS       : Cancel the SN<n><cr> and SN<n>R<m><cr> command.

        a. If UPS is in shut down waiting state, the shut down command
           is cancelled.
        b. If UPS is in restore waiting state, the UPS output is turned
           on, but UPS must be hold off at least 10 seconds.
           (if utility is present)

   9. Cancel Test Command :

        Computer  : CT<cr>
        UPS       : Cancel all test activity and connect the utility to
                    output immediately.

	10. UPS Information Command:

		Computer	: I<cr>
		UPS			: #Company_Name UPS_Model Version<cr>

	This function will make the UPS respond with the basic information
	about the company who manufacture the UPS, the model name of the
	UPS and the version number of the UPS firmware. The length of
	every field is listed as follows:
		Company_Name	: 15 characters, leave space if less than 15 characters
		UPS_Model		: 10 characters, leave space if less than 10 characters
		Version			: 10 characters, leave space if less than 10 characters
	
	There should be a space character between every field for separation.

	11. UPS Rating Information:
		
		Computer	: F<cr>
		UPS			: #MMM.M QQQ SS.SS RR.R<cr>

	This function makes the UPS answer the rating value of UPS. There
	should be a space character between every field for
	separation. The UPS's response contains the following information
	field:

			a. Rating Voltage	: MMM.M
			b. Rating Current	: QQQ
			c. Battery Voltage	: SS.SS or SSS.S
			d. Frequency		: RR.R

D. COMMAND SUMMARY:

ITEM	COMMAND 	           DESCRIPTION              	
 1a  	  D     	  Status Inquiry           *disable         	
 1  	  Q1     	  Status Inquiry                    	
 2  	  T     	  10 Seconds Test                   	
 3  	  TL    	  Test until Battery Low            	
 4  	  T<n>  	  Test for Specified Time Period    	
 5  	  Q     	  Turn On/Off beep                  	
 6  	  S<n>  	  Shut Down Command                 	
 7  	S<n>R<m>	  Shut Down and Restore Command     	
 8  	  C     	  Cancel Shut Down Command          	
 9  	  CT    	  Cancel Test Command               	
10	   I	  UPS Information Command	
11	   F	  UPS Rating Information	

E. Invalid Command/Information Handling

If the UPS receives any command that it could not handle, the UPS should
echo the received command back to the computer. The host should check if
the command send to UPS been echo or not. 
If there is any information field in the UPS's response which is
unavailable or not supported, the UPS should fill the field with '@'.

Implementation notes

S01R0001 and S01R0002 may not work on early firmware versions. The failure mode is that the UPS turns off and never returns. The fix is to push the return value up by 2, i.e. S01R0003, and it will return online properly.

Last updated: 30 October 2003 / rkroll Valid HTML 4.01!