<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>「用 PHP 寫 RS232 串列通訊程式」的迴響</title>
	<atom:link href="http://blog.linym.net/archives/187/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.linym.net/archives/187</link>
	<description>我的學習心得、筆記</description>
	<lastBuildDate>Tue, 02 Mar 2010 14:52:11 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>作者：網站製作學習誌 &#187; [Web] 連結分享</title>
		<link>http://blog.linym.net/archives/187/comment-page-2#comment-36297</link>
		<dc:creator>網站製作學習誌 &#187; [Web] 連結分享</dc:creator>
		<pubDate>Wed, 25 Nov 2009 02:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-36297</guid>
		<description>[...] 用 PHP 寫 RS232 串列通訊程式 [...]</description>
		<content:encoded><![CDATA[<p>[...] 用 PHP 寫 RS232 串列通訊程式 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：lym520</title>
		<link>http://blog.linym.net/archives/187/comment-page-2#comment-29040</link>
		<dc:creator>lym520</dc:creator>
		<pubDate>Fri, 10 Apr 2009 14:21:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-29040</guid>
		<description>&lt;a href=&quot;#comment-29018&quot; rel=&quot;nofollow&quot;&gt;@station2&lt;/a&gt; 
1. 應該是 dio 沒有正確載入所以找不到 function，PECL 和 PHP 版本要對應，不能差太多，例如 PHP 5.2.x 要搭配 5.2.x PECL，否則也會發生無法載入情形。 
2. 是的，放在 ext 裡面，前面不要分號。
3. Device open 之後就可以對其存取(read、write...)，範例中是持續由裝置讀取1個字元，有讀取到東西就直接印出來。所以像是 GPS 應該可以讀到資料，但是如果要對資料做處理是不會這樣寫的^^&quot;
我當初學習是參考&lt;a href=&quot;http://tldp.org/HOWTO/Serial-Programming-HOWTO/&quot; rel=&quot;nofollow&quot;&gt;這篇教學&lt;/a&gt;，裡面寫得很完整。</description>
		<content:encoded><![CDATA[<p><a href="#comment-29018" rel="nofollow">@station2</a><br />
1. 應該是 dio 沒有正確載入所以找不到 function，PECL 和 PHP 版本要對應，不能差太多，例如 PHP 5.2.x 要搭配 5.2.x PECL，否則也會發生無法載入情形。<br />
2. 是的，放在 ext 裡面，前面不要分號。<br />
3. Device open 之後就可以對其存取(read、write...)，範例中是持續由裝置讀取1個字元，有讀取到東西就直接印出來。所以像是 GPS 應該可以讀到資料，但是如果要對資料做處理是不會這樣寫的^^"<br />
我當初學習是參考<a href="http://tldp.org/HOWTO/Serial-Programming-HOWTO/" rel="nofollow">這篇教學</a>，裡面寫得很完整。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：station2</title>
		<link>http://blog.linym.net/archives/187/comment-page-2#comment-29018</link>
		<dc:creator>station2</dc:creator>
		<pubDate>Fri, 10 Apr 2009 02:12:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-29018</guid>
		<description>請問大大一下
1.如果出現Fatal error: Call to undefined function dio_open() in C:\AppServ\www\rs232.php on line 13
這種錯誤是不是表示我PECL那邊沒設定好呢?
2.還有在php.ini裡面放的extension=php_dio.dll是要放在那堆extension裏面嗎?前面也要加;號嗎?
3.可以麻煩大大解釋一下exec設定值以外的程式嗎?

非常謝謝大大了T.T小弟為了能用php抓gps找了2個禮拜的方法了...麻煩你了T.T</description>
		<content:encoded><![CDATA[<p>請問大大一下<br />
1.如果出現Fatal error: Call to undefined function dio_open() in C:\AppServ\www\rs232.php on line 13<br />
這種錯誤是不是表示我PECL那邊沒設定好呢?<br />
2.還有在php.ini裡面放的extension=php_dio.dll是要放在那堆extension裏面嗎?前面也要加;號嗎?<br />
3.可以麻煩大大解釋一下exec設定值以外的程式嗎?</p>
<p>非常謝謝大大了T.T小弟為了能用php抓gps找了2個禮拜的方法了...麻煩你了T.T</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：lym520</title>
		<link>http://blog.linym.net/archives/187/comment-page-2#comment-27288</link>
		<dc:creator>lym520</dc:creator>
		<pubDate>Fri, 06 Feb 2009 14:15:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-27288</guid>
		<description>&lt;a href=&quot;#comment-27241&quot; rel=&quot;nofollow&quot;&gt;@air&lt;/a&gt; 
確定已經掛上 DIO 模組後，可以參考官網手冊這篇底下的範例：
&lt;a href=&quot;http://tw2.php.net/manual/en/function.dio-tcsetattr.php&quot; rel=&quot;nofollow&quot;&gt;http://tw2.php.net/manual/en/function.dio-tcsetattr.php&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p><a href="#comment-27241" rel="nofollow">@air</a><br />
確定已經掛上 DIO 模組後，可以參考官網手冊這篇底下的範例：<br />
<a href="http://tw2.php.net/manual/en/function.dio-tcsetattr.php" rel="nofollow">http://tw2.php.net/manual/en/function.dio-tcsetattr.php</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：air</title>
		<link>http://blog.linym.net/archives/187/comment-page-2#comment-27241</link>
		<dc:creator>air</dc:creator>
		<pubDate>Thu, 05 Feb 2009 10:39:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-27241</guid>
		<description>請問如果linux
要怎麼改??</description>
		<content:encoded><![CDATA[<p>請問如果linux<br />
要怎麼改??</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：focus</title>
		<link>http://blog.linym.net/archives/187/comment-page-2#comment-26877</link>
		<dc:creator>focus</dc:creator>
		<pubDate>Thu, 22 Jan 2009 07:52:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-26877</guid>
		<description>謝謝版主. 在多人共同使用的情況下會搶COM port. 可用以下open方法避免:
...
error_reporting(0);
while (1) {
  $fd = dio_open(&#039;COM3:&#039;, O_RDWR &#124; O_NOCTTY &#124; O_NONBLOCK) ;
  if ($fd) break; 
//  echo(&quot;.&quot;);
  sleep(1); 
}
error_reporting(E_ALL);
...</description>
		<content:encoded><![CDATA[<p>謝謝版主. 在多人共同使用的情況下會搶COM port. 可用以下open方法避免:<br />
...<br />
error_reporting(0);<br />
while (1) {<br />
  $fd = dio_open('COM3:', O_RDWR | O_NOCTTY | O_NONBLOCK) ;<br />
  if ($fd) break;<br />
//  echo(".");<br />
  sleep(1);<br />
}<br />
error_reporting(E_ALL);<br />
...</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：max</title>
		<link>http://blog.linym.net/archives/187/comment-page-2#comment-25273</link>
		<dc:creator>max</dc:creator>
		<pubDate>Wed, 10 Dec 2008 10:16:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-25273</guid>
		<description>請問一下要是要寫入一個字元到RS232裝置裡讓裝置可以啟動是要該如何寫呢?
我是這樣寫(寫入D這一個字元裝置才會啟動)
$data=&quot;D&quot;;
dio_write($fd,$data);
但是這一行程式會跟我說無法寫入~這樣的訊息給我
warning: dio_write: cannot write data to file descriptor 3 , No space left on device in 
我有試過了dio_open這是OK的
就卡再這裡沒辦法寫入一個字給裝置啟動不了
希望您可以幫幫我~謝謝了</description>
		<content:encoded><![CDATA[<p>請問一下要是要寫入一個字元到RS232裝置裡讓裝置可以啟動是要該如何寫呢?<br />
我是這樣寫(寫入D這一個字元裝置才會啟動)<br />
$data="D";<br />
dio_write($fd,$data);<br />
但是這一行程式會跟我說無法寫入~這樣的訊息給我<br />
warning: dio_write: cannot write data to file descriptor 3 , No space left on device in<br />
我有試過了dio_open這是OK的<br />
就卡再這裡沒辦法寫入一個字給裝置啟動不了<br />
希望您可以幫幫我~謝謝了</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：lym520</title>
		<link>http://blog.linym.net/archives/187/comment-page-2#comment-23818</link>
		<dc:creator>lym520</dc:creator>
		<pubDate>Tue, 11 Nov 2008 01:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-23818</guid>
		<description>Chris:
試了一下在 Vista 也是 ok 的。
會出現 Permission denied 大多是 port 被佔用無法釋放，
例如 PHP 在執行期間被強制停止或關閉，這時 port 就會被 block 住，
必須停止 Web server 才會釋放。
所以建議先用 Access Port 之類的測試工具去確認您的設備如何溝通運作，再來寫程式可以減少很多問題。</description>
		<content:encoded><![CDATA[<p>Chris:<br />
試了一下在 Vista 也是 ok 的。<br />
會出現 Permission denied 大多是 port 被佔用無法釋放，<br />
例如 PHP 在執行期間被強制停止或關閉，這時 port 就會被 block 住，<br />
必須停止 Web server 才會釋放。<br />
所以建議先用 Access Port 之類的測試工具去確認您的設備如何溝通運作，再來寫程式可以減少很多問題。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：CHRIS</title>
		<link>http://blog.linym.net/archives/187/comment-page-2#comment-23799</link>
		<dc:creator>CHRIS</dc:creator>
		<pubDate>Mon, 10 Nov 2008 18:06:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-23799</guid>
		<description>我也是發生權限問題阿?不過我是在DIO_OPEN()底下~是不是VISTA還要修改哪邊阿?</description>
		<content:encoded><![CDATA[<p>我也是發生權限問題阿?不過我是在DIO_OPEN()底下~是不是VISTA還要修改哪邊阿?</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Chris</title>
		<link>http://blog.linym.net/archives/187/comment-page-1#comment-23763</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 10 Nov 2008 04:58:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-23763</guid>
		<description>我也是出現這樣的錯誤(沒有權限),難道VISTA還有哪裡要設定嗎??

Warning: dio_open() [function.dio-open]: cannot open file COM4 with flags 2 and permissions 0: Permission denied in C:\Apache2.2\htdocs\DosDiosas\comm.php on line 6

我是出現在dio_open這一行...</description>
		<content:encoded><![CDATA[<p>我也是出現這樣的錯誤(沒有權限),難道VISTA還有哪裡要設定嗎??</p>
<p>Warning: dio_open() [function.dio-open]: cannot open file COM4 with flags 2 and permissions 0: Permission denied in C:\Apache2.2\htdocs\DosDiosas\comm.php on line 6</p>
<p>我是出現在dio_open這一行...</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：lang</title>
		<link>http://blog.linym.net/archives/187/comment-page-1#comment-10077</link>
		<dc:creator>lang</dc:creator>
		<pubDate>Fri, 06 Jun 2008 09:27:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-10077</guid>
		<description>版主：
.exec(&#039;mode COM1: baud=19200 data=8 stop=1 parity=n&#039;);
cannot open file COM1: with flags 2 and permissions 0:
    想问一下，为什么我执行了第一句说我没有权限的？ 
   顺便想知道那里可以打开串口。。</description>
		<content:encoded><![CDATA[<p>版主：<br />
.exec('mode COM1: baud=19200 data=8 stop=1 parity=n');<br />
cannot open file COM1: with flags 2 and permissions 0:<br />
    想问一下，为什么我执行了第一句说我没有权限的？<br />
   顺便想知道那里可以打开串口。。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：lym520</title>
		<link>http://blog.linym.net/archives/187/comment-page-1#comment-8580</link>
		<dc:creator>lym520</dc:creator>
		<pubDate>Wed, 07 May 2008 02:08:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-8580</guid>
		<description>Mickey:
還是需要下載 DIO(可能需自行編譯) 及更改 php.ini</description>
		<content:encoded><![CDATA[<p>Mickey:<br />
還是需要下載 DIO(可能需自行編譯) 及更改 php.ini</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Mickey</title>
		<link>http://blog.linym.net/archives/187/comment-page-1#comment-8045</link>
		<dc:creator>Mickey</dc:creator>
		<pubDate>Thu, 24 Apr 2008 15:48:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-8045</guid>
		<description>版主您好:
   請問一下，是否我在Freebsd中,使用PHP 5.1.6版就可以執行了呢？還是需要再download dio檔案及更改PHP.ini 內容呢？</description>
		<content:encoded><![CDATA[<p>版主您好:<br />
   請問一下，是否我在Freebsd中,使用PHP 5.1.6版就可以執行了呢？還是需要再download dio檔案及更改PHP.ini 內容呢？</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：lym520</title>
		<link>http://blog.linym.net/archives/187/comment-page-1#comment-7718</link>
		<dc:creator>lym520</dc:creator>
		<pubDate>Fri, 28 Mar 2008 14:07:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-7718</guid>
		<description>August:
必須要 PHP 5 才有支援 DIO</description>
		<content:encoded><![CDATA[<p>August:<br />
必須要 PHP 5 才有支援 DIO</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：August</title>
		<link>http://blog.linym.net/archives/187/comment-page-1#comment-7684</link>
		<dc:creator>August</dc:creator>
		<pubDate>Tue, 25 Mar 2008 08:57:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-7684</guid>
		<description>板主您好，
請教一下，因為我所使用的PHP版本為較舊的v4.3.1，
是不是已經內建dio了？且也不用編輯php.ini？
還是需要怎麼做才會比較正確呢？謝謝指教！</description>
		<content:encoded><![CDATA[<p>板主您好，<br />
請教一下，因為我所使用的PHP版本為較舊的v4.3.1，<br />
是不是已經內建dio了？且也不用編輯php.ini？<br />
還是需要怎麼做才會比較正確呢？謝謝指教！</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：lym520</title>
		<link>http://blog.linym.net/archives/187/comment-page-1#comment-7213</link>
		<dc:creator>lym520</dc:creator>
		<pubDate>Mon, 07 Jan 2008 01:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-7213</guid>
		<description>本站文章皆採用CC授權，只要標示來源都是歡迎分享的。</description>
		<content:encoded><![CDATA[<p>本站文章皆採用CC授權，只要標示來源都是歡迎分享的。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：小靜</title>
		<link>http://blog.linym.net/archives/187/comment-page-1#comment-7212</link>
		<dc:creator>小靜</dc:creator>
		<pubDate>Sun, 06 Jan 2008 19:31:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-7212</guid>
		<description>老大,我能將你的這篇文章一字不漏(包含這篇的網址,你的大名....)
放在我的Blog給我朋友參考嗎?
好文章阿... 學習消化中</description>
		<content:encoded><![CDATA[<p>老大,我能將你的這篇文章一字不漏(包含這篇的網址,你的大名....)<br />
放在我的Blog給我朋友參考嗎?<br />
好文章阿... 學習消化中</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：lym520</title>
		<link>http://blog.linym.net/archives/187/comment-page-1#comment-6290</link>
		<dc:creator>lym520</dc:creator>
		<pubDate>Fri, 05 Oct 2007 12:04:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-6290</guid>
		<description>第一行是使用 exec() 這個 PHP 函式執行 mode 外部指令，用來設定 com port 相關資訊，以範例來說是設定傳輸速率=19200、資料位元=8、停止位元=1、同位檢查=無，這要視設備而定，設定正確才能做存取動作。

再來就是利用迴圈每次讀取一個字元，如果有東西就顯示出來。當然這只是範例，實際上會依設備不同而有不同的存取方式。可以利用&lt;a href=&quot;http://blog.linym.net/archives/157&quot; rel=&quot;nofollow&quot;&gt;這篇&lt;/a&gt;所提到的工具來測試，確定如何和設備溝通再決定程式怎麼寫。</description>
		<content:encoded><![CDATA[<p>第一行是使用 exec() 這個 PHP 函式執行 mode 外部指令，用來設定 com port 相關資訊，以範例來說是設定傳輸速率=19200、資料位元=8、停止位元=1、同位檢查=無，這要視設備而定，設定正確才能做存取動作。</p>
<p>再來就是利用迴圈每次讀取一個字元，如果有東西就顯示出來。當然這只是範例，實際上會依設備不同而有不同的存取方式。可以利用<a href="http://blog.linym.net/archives/157" rel="nofollow">這篇</a>所提到的工具來測試，確定如何和設備溝通再決定程式怎麼寫。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：過路的貓</title>
		<link>http://blog.linym.net/archives/187/comment-page-1#comment-6289</link>
		<dc:creator>過路的貓</dc:creator>
		<pubDate>Fri, 05 Oct 2007 10:15:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linym.net/archives/187#comment-6289</guid>
		<description>大大  請教一下

exec(&#039;mode COM1: baud=19200 data=8 stop=1 parity=n&#039;);
這一行  是不是  產生一個輸入訊號  

而
$fd = dio_open(&#039;COM1:&#039;, O_RDWR);
while (1) {
    $data = dio_read($fd, 1);
    if ($data) {
        echo $data;
    }
}
dio_close($fd);

這幾行就是  把它讀出來  對嗎?

請大大  指導一下....  感謝感謝</description>
		<content:encoded><![CDATA[<p>大大  請教一下</p>
<p>exec('mode COM1: baud=19200 data=8 stop=1 parity=n');<br />
這一行  是不是  產生一個輸入訊號  </p>
<p>而<br />
$fd = dio_open('COM1:', O_RDWR);<br />
while (1) {<br />
    $data = dio_read($fd, 1);<br />
    if ($data) {<br />
        echo $data;<br />
    }<br />
}<br />
dio_close($fd);</p>
<p>這幾行就是  把它讀出來  對嗎?</p>
<p>請大大  指導一下....  感謝感謝</p>
]]></content:encoded>
	</item>
</channel>
</rss>
