Для всех кто будет вытворять подобное, мое решение проблемы:
- Код: Выделить всё
ser:=TBlockSerial.Create;
ser.LinuxLock := false; //Только для *nix овых систем. Без этого параметра не робит.
ser.Connect('com1'); //Подключаемся к порту
ser.config(2400,8,'N',SB1,false,false); //стандартные настройки com порта для всех UPS
- Код: Выделить всё
//Для вывода статистики с устройства: (протокол Megatec)
ser.SendString('Q1'+#13); //команда вывода статистики
lst1.lines.Text := ser.RecvBufferStr(47,5000); //сообщение из 47 байт
Вот описание формата сообщения:
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 Inverter mode. If this occurs, the 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 percentage of maximum current, not an absolute value.
f.O/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 celsius.
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 : AVR 0:NORMAL
4
1 : UPS Failed
3
1 : UPS Type is Line-Interactive (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. AVR
active , and shutdown not active.
- Код: Выделить всё
//Запуск теста на 10 секунд
ser.SendString('T'+#13);
//Отключение/Включение звука
ser.SendString('T'+#13);
Остальные параметры я не использую.
ЗЫ Еще если кому надо: Примерный минимальный разряд батареи 12.5 Вольт, максимальный 13.6 Вольт. Примерное время работы типичного оффисного компьютера от IPPON PowerBack 600 - 5 минут.
У вас нет необходимых прав для просмотра вложений в этом сообщении.