<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://mdminfo.ru/index.php?action=history&amp;feed=atom&amp;title=%D0%A7%D1%82%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D1%81_%D1%81%D1%87%D0%B5%D1%82%D1%87%D0%B8%D0%BA%D0%B0_%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8%D0%B8_%22%D0%9C%D0%B5%D1%80%D0%BA%D1%83%D1%80%D0%B8%D0%B9_200%22</id>
	<title>Чтение данных с счетчика электроэнергии &quot;Меркурий 200&quot; - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://mdminfo.ru/index.php?action=history&amp;feed=atom&amp;title=%D0%A7%D1%82%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D1%81_%D1%81%D1%87%D0%B5%D1%82%D1%87%D0%B8%D0%BA%D0%B0_%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8%D0%B8_%22%D0%9C%D0%B5%D1%80%D0%BA%D1%83%D1%80%D0%B8%D0%B9_200%22"/>
	<link rel="alternate" type="text/html" href="https://mdminfo.ru/index.php?title=%D0%A7%D1%82%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D1%81_%D1%81%D1%87%D0%B5%D1%82%D1%87%D0%B8%D0%BA%D0%B0_%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8%D0%B8_%22%D0%9C%D0%B5%D1%80%D0%BA%D1%83%D1%80%D0%B8%D0%B9_200%22&amp;action=history"/>
	<updated>2026-06-02T10:04:12Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://mdminfo.ru/index.php?title=%D0%A7%D1%82%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D1%81_%D1%81%D1%87%D0%B5%D1%82%D1%87%D0%B8%D0%BA%D0%B0_%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8%D0%B8_%22%D0%9C%D0%B5%D1%80%D0%BA%D1%83%D1%80%D0%B8%D0%B9_200%22&amp;diff=720&amp;oldid=prev</id>
		<title>Neonov: /* Описание */</title>
		<link rel="alternate" type="text/html" href="https://mdminfo.ru/index.php?title=%D0%A7%D1%82%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D1%81_%D1%81%D1%87%D0%B5%D1%82%D1%87%D0%B8%D0%BA%D0%B0_%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8%D0%B8_%22%D0%9C%D0%B5%D1%80%D0%BA%D1%83%D1%80%D0%B8%D0%B9_200%22&amp;diff=720&amp;oldid=prev"/>
		<updated>2020-01-16T06:40:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Описание&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 09:40, 16 января 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Строка 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Описание==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Описание==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Чтение данных с счетчика электроэнергии &amp;quot;Меркурий 200&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Чтение данных с счетчика электроэнергии &amp;quot;Меркурий 200&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Версия для Linux. Для Windows нужно править функцию чтения порта. Может не работать на некоторых ядрах Linux.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Код==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Код==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l159&quot;&gt;Строка 159:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 161:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;else{ // если нет напряжения, кричим&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;else{ // если нет напряжения, кричим&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;say('Нет напряжения',2);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;say('Нет напряжения',2);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Файл:Usbto485.png|мини|слева]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Neonov</name></author>
	</entry>
	<entry>
		<id>https://mdminfo.ru/index.php?title=%D0%A7%D1%82%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D1%81_%D1%81%D1%87%D0%B5%D1%82%D1%87%D0%B8%D0%BA%D0%B0_%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8%D0%B8_%22%D0%9C%D0%B5%D1%80%D0%BA%D1%83%D1%80%D0%B8%D0%B9_200%22&amp;diff=718&amp;oldid=prev</id>
		<title>Neonov: /* Описание */</title>
		<link rel="alternate" type="text/html" href="https://mdminfo.ru/index.php?title=%D0%A7%D1%82%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D1%81_%D1%81%D1%87%D0%B5%D1%82%D1%87%D0%B8%D0%BA%D0%B0_%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8%D0%B8_%22%D0%9C%D0%B5%D1%80%D0%BA%D1%83%D1%80%D0%B8%D0%B9_200%22&amp;diff=718&amp;oldid=prev"/>
		<updated>2020-01-16T06:26:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Описание&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 09:26, 16 января 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Строка 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Юзеркейсы]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Юзеркейсы]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Описание==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Описание==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Расчет восхода, заката и сумерек средствами PHP.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Чтение данных с счетчика электроэнергии &amp;quot;Меркурий 200&amp;quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Код==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Код==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Neonov</name></author>
	</entry>
	<entry>
		<id>https://mdminfo.ru/index.php?title=%D0%A7%D1%82%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D1%81_%D1%81%D1%87%D0%B5%D1%82%D1%87%D0%B8%D0%BA%D0%B0_%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8%D0%B8_%22%D0%9C%D0%B5%D1%80%D0%BA%D1%83%D1%80%D0%B8%D0%B9_200%22&amp;diff=717&amp;oldid=prev</id>
		<title>Neonov: Новая страница: «Category:Юзеркейсы ==Описание== Расчет восхода, заката и сумерек средствами PHP.  ==Код== &lt;pre&gt;functi...»</title>
		<link rel="alternate" type="text/html" href="https://mdminfo.ru/index.php?title=%D0%A7%D1%82%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D1%81_%D1%81%D1%87%D0%B5%D1%82%D1%87%D0%B8%D0%BA%D0%B0_%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8%D0%B8_%22%D0%9C%D0%B5%D1%80%D0%BA%D1%83%D1%80%D0%B8%D0%B9_200%22&amp;diff=717&amp;oldid=prev"/>
		<updated>2020-01-16T06:24:30Z</updated>

		<summary type="html">&lt;p&gt;Новая страница: «&lt;a href=&quot;/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F:%D0%AE%D0%B7%D0%B5%D1%80%D0%BA%D0%B5%D0%B9%D1%81%D1%8B&quot; title=&quot;Категория:Юзеркейсы&quot;&gt;Category:Юзеркейсы&lt;/a&gt; ==Описание== Расчет восхода, заката и сумерек средствами PHP.  ==Код== &amp;lt;pre&amp;gt;functi...»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Юзеркейсы]]&lt;br /&gt;
==Описание==&lt;br /&gt;
Расчет восхода, заката и сумерек средствами PHP.&lt;br /&gt;
&lt;br /&gt;
==Код==&lt;br /&gt;
&amp;lt;pre&amp;gt;function crc16_modbus($string) {&lt;br /&gt;
    $auchCRCHi=array( 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,&lt;br /&gt;
                0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,&lt;br /&gt;
                0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,&lt;br /&gt;
                0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,&lt;br /&gt;
                0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81,&lt;br /&gt;
                0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,&lt;br /&gt;
                0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,&lt;br /&gt;
                0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,&lt;br /&gt;
                0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,&lt;br /&gt;
                0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,&lt;br /&gt;
                0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,&lt;br /&gt;
                0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,&lt;br /&gt;
                0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,&lt;br /&gt;
                0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,&lt;br /&gt;
                0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,&lt;br /&gt;
                0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,&lt;br /&gt;
                0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,&lt;br /&gt;
                0x40);&lt;br /&gt;
    $auchCRCLo=array(    0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06, 0x07, 0xC7, 0x05, 0xC5, 0xC4,&lt;br /&gt;
                0x04, 0xCC, 0x0C, 0x0D, 0xCD, 0x0F, 0xCF, 0xCE, 0x0E, 0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09,&lt;br /&gt;
                0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9, 0x1B, 0xDB, 0xDA, 0x1A, 0x1E, 0xDE, 0xDF, 0x1F, 0xDD,&lt;br /&gt;
                0x1D, 0x1C, 0xDC, 0x14, 0xD4, 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, 0x12, 0x13, 0xD3,&lt;br /&gt;
                0x11, 0xD1, 0xD0, 0x10, 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3, 0xF2, 0x32, 0x36, 0xF6, 0xF7,&lt;br /&gt;
                0x37, 0xF5, 0x35, 0x34, 0xF4, 0x3C, 0xFC, 0xFD, 0x3D, 0xFF, 0x3F, 0x3E, 0xFE, 0xFA, 0x3A,&lt;br /&gt;
                0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38, 0x28, 0xE8, 0xE9, 0x29, 0xEB, 0x2B, 0x2A, 0xEA, 0xEE,&lt;br /&gt;
                0x2E, 0x2F, 0xEF, 0x2D, 0xED, 0xEC, 0x2C, 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26,&lt;br /&gt;
                0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, 0xA0, 0x60, 0x61, 0xA1, 0x63, 0xA3, 0xA2,&lt;br /&gt;
                0x62, 0x66, 0xA6, 0xA7, 0x67, 0xA5, 0x65, 0x64, 0xA4, 0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F,&lt;br /&gt;
                0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB, 0x69, 0xA9, 0xA8, 0x68, 0x78, 0xB8, 0xB9, 0x79, 0xBB,&lt;br /&gt;
                0x7B, 0x7A, 0xBA, 0xBE, 0x7E, 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, 0xB4, 0x74, 0x75, 0xB5,&lt;br /&gt;
                0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, 0x70, 0xB0, 0x50, 0x90, 0x91,&lt;br /&gt;
                0x51, 0x93, 0x53, 0x52, 0x92, 0x96, 0x56, 0x57, 0x97, 0x55, 0x95, 0x94, 0x54, 0x9C, 0x5C,&lt;br /&gt;
                0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E, 0x5A, 0x9A, 0x9B, 0x5B, 0x99, 0x59, 0x58, 0x98, 0x88,&lt;br /&gt;
                0x48, 0x49, 0x89, 0x4B, 0x8B, 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C,&lt;br /&gt;
                0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83, 0x41, 0x81, 0x80,&lt;br /&gt;
                0x40);&lt;br /&gt;
    $length	= strlen($string);&lt;br /&gt;
    $uchCRCHi   = 0xFF;&lt;br /&gt;
    $uchCRCLo   = 0xFF;&lt;br /&gt;
    $uIndex     = 0;&lt;br /&gt;
    for ($i=0;$i&amp;lt;$length;$i++) {&lt;br /&gt;
        $uIndex   	= $uchCRCLo ^ ord(substr($string,$i,1));&lt;br /&gt;
        $uchCRCLo   = $uchCRCHi ^ $auchCRCHi[$uIndex];&lt;br /&gt;
        $uchCRCHi   = $auchCRCLo[$uIndex] ;&lt;br /&gt;
    }&lt;br /&gt;
    return(chr($uchCRCLo).chr($uchCRCHi));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// форматируем шеснадчатиричную строку&lt;br /&gt;
function nice_hex($str) {&lt;br /&gt;
    return strtoupper(implode(' ',str_split($str,2)));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// параметры порта&lt;br /&gt;
exec('/bin/stty -F /dev/ttyUSB0 cs8 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts');&lt;br /&gt;
&lt;br /&gt;
// открываем порт&lt;br /&gt;
$fp = fopen(&amp;quot;/dev/ttyUSB0&amp;quot;, &amp;quot;r+&amp;quot;);&lt;br /&gt;
if (!$fp) {&lt;br /&gt;
	echo &amp;quot;Error opening port&amp;quot;;&lt;br /&gt;
	die();&lt;br /&gt;
}&lt;br /&gt;
// делаем адрес и команду и посылаем ее в порт&lt;br /&gt;
$cmd = '000EB6DE63';// 00 + 0EB6DE Адрес + 63 команда&lt;br /&gt;
$cmd .= bin2hex(crc16_modbus(hex2bin($cmd)));&lt;br /&gt;
fwrite($fp, hex2bin($cmd));&lt;br /&gt;
&lt;br /&gt;
// читаем данные из порта&lt;br /&gt;
$result = '';&lt;br /&gt;
$c = '';&lt;br /&gt;
stream_set_blocking($fp,0);&lt;br /&gt;
$timeout=microtime(1)+0.5;&lt;br /&gt;
while (microtime(1)&amp;lt;$timeout) {&lt;br /&gt;
	$c=fgetc($fp);&lt;br /&gt;
	if($c === false){&lt;br /&gt;
			usleep(5);&lt;br /&gt;
			continue;&lt;br /&gt;
	}&lt;br /&gt;
	$result .= $c;&lt;br /&gt;
}&lt;br /&gt;
fclose($fp);&lt;br /&gt;
//====================================================&lt;br /&gt;
//usleep (20);&lt;br /&gt;
//exec('/bin/stty -F /dev/ttyUSB0 cs8 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts');// инициализация порта. возможно нужно будет раскомментировать, или запустить один раз&lt;br /&gt;
// открываем порт&lt;br /&gt;
$fp = fopen(&amp;quot;/dev/ttyUSB0&amp;quot;, &amp;quot;r+&amp;quot;);&lt;br /&gt;
if (!$fp) {&lt;br /&gt;
	echo &amp;quot;Error opening port&amp;quot;;&lt;br /&gt;
	die();&lt;br /&gt;
}&lt;br /&gt;
// делаем адрес и команду и посылаем ее в порт&lt;br /&gt;
$cmd = '000EB6DE27';// 00 + 0EB6DE Адрес + 27 команда&lt;br /&gt;
$cmd .= bin2hex(crc16_modbus(hex2bin($cmd)));&lt;br /&gt;
fwrite($fp, hex2bin($cmd));&lt;br /&gt;
// Read answer from port&lt;br /&gt;
$result2 = '';&lt;br /&gt;
$c = '';&lt;br /&gt;
stream_set_blocking($fp,0);&lt;br /&gt;
$timeout=microtime(1)+0.5;&lt;br /&gt;
while (microtime(1)&amp;lt;$timeout) {&lt;br /&gt;
	$c=fgetc($fp);&lt;br /&gt;
	if($c === false){&lt;br /&gt;
			usleep(5);&lt;br /&gt;
			continue;&lt;br /&gt;
	}&lt;br /&gt;
	$result2 .= $c;&lt;br /&gt;
}&lt;br /&gt;
fclose($fp);&lt;br /&gt;
//=========================================&lt;br /&gt;
// парсим ответы&lt;br /&gt;
$crc_answer = substr($result,-2);                // crc16 in answer&lt;br /&gt;
$addr = substr($result,1,3);   			 // address of power device&lt;br /&gt;
$answer_cmd = substr($result,4,1);              // answered command&lt;br /&gt;
$answer = substr($result,5,-2);                  // answer string&lt;br /&gt;
//============================================&lt;br /&gt;
$crc_answer2 = substr($result2,-2);                // crc16 in answer&lt;br /&gt;
$addr2 = substr($result2,1,3);   			 // address of power device&lt;br /&gt;
$answer_cmd2 = substr($result2,4,1);              // answered command&lt;br /&gt;
$answer2 = substr($result2,5,-2);&lt;br /&gt;
//===========================================&lt;br /&gt;
// проверка CRC&lt;br /&gt;
$crc_check = 'FAIL';&lt;br /&gt;
if (crc16_modbus(substr($result,0,-2))==$crc_answer) {&lt;br /&gt;
	$crc_check = 'OK';&lt;br /&gt;
}&lt;br /&gt;
//================================================&lt;br /&gt;
$crc_check2 = 'FAIL';&lt;br /&gt;
if (crc16_modbus(substr($result2,0,-2))==$crc_answer2) {&lt;br /&gt;
	$crc_check2 = 'OK';&lt;br /&gt;
}&lt;br /&gt;
//================================================&lt;br /&gt;
// форматируем выходные данные&lt;br /&gt;
//echo 'ADDRESS: '.nice_hex(bin2hex($addr)).&amp;quot;\n&amp;quot;;&lt;br /&gt;
//echo 'COMMAND: '.nice_hex(bin2hex($answer_cmd)).&amp;quot;\n&amp;quot;;&lt;br /&gt;
//echo 'ANSWER:  '.nice_hex(bin2hex($answer)).&amp;quot;\n&amp;quot;;&lt;br /&gt;
//echo 'CRC:     '.$crc_check.&amp;quot;\n&amp;quot;; &lt;br /&gt;
//echo '---------'.&amp;quot;\n&amp;quot;;&lt;br /&gt;
//echo 'Full request: '.nice_hex($cmd).&amp;quot;\n&amp;quot;;&lt;br /&gt;
//echo 'Full answer:  '.nice_hex(bin2hex($result)).&amp;quot;\n\n&amp;quot;;&lt;br /&gt;
$Uv = bin2hex(substr($answer,0,2))/10;// Напряжение&lt;br /&gt;
$Ia = bin2hex(substr($answer,2,2))/100;// Ток&lt;br /&gt;
$Pv = bin2hex(substr($answer,4,3))/1000;// Мощность&lt;br /&gt;
$tarif1 = bin2hex(substr($answer2,0,4))/100;// Данные счетчика первого тарифа&lt;br /&gt;
$tarif2 = bin2hex(substr($answer2,4,4))/100;// Данные счетчика второго тарифа&lt;br /&gt;
&lt;br /&gt;
if ($Uv &amp;lt;&amp;gt; '0'){ // если есть напряжение, записываем данные в свойства&lt;br /&gt;
sg('counter.volt',$Uv);&lt;br /&gt;
sg('counter.amper',$Ia);&lt;br /&gt;
sg('counter.watt',sprintf(&amp;quot;%.2f&amp;quot;,$Pv));&lt;br /&gt;
sg('counter.count',$tarif1);&lt;br /&gt;
sg('counter.count2',$tarif2);&lt;br /&gt;
}&lt;br /&gt;
else{ // если нет напряжения, кричим&lt;br /&gt;
say('Нет напряжения',2);&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Neonov</name></author>
	</entry>
</feed>