VFP 愛用者社區 首頁 VFP 愛用者社區
本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
 
 常見問題常見問題   搜尋搜尋   會員列表會員列表   會員群組會員群組   會員註冊會員註冊 
 個人資料個人資料   登入檢查您的私人訊息登入檢查您的私人訊息   登入登入

Foxpro read data from RS232

 
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區
上一篇主題 :: 下一篇主題  
發表人 內容
K.W. Mok



註冊時間: 2012-08-09
文章: 1
來自: Hong Kong

第 1 樓

發表發表於: 星期四 八月 09, 2012 3:18 pm    文章主題: Foxpro read data from RS232 引言回覆

要用 foxpro 從電腦的 com1 取電子磅的數據
回頂端
檢視會員個人資料 發送私人訊息 MSN Messenger
bx1166



註冊時間: 2011-12-06
文章: 273


第 2 樓

發表發表於: 星期六 八月 11, 2012 9:12 am    文章主題: 引言回覆

> Run mode com1 2400,E,7,1
> comhandle=fopen('com1',12)
> if comhandle<0
> wait 'no open com1' window nowait
> return
> endif
> store '0' to cominput1
> cominput1=fgets(comhandle)
>
> any idea and solution ? Please Help

Albert,

Is Foxpro 2.6a the windows version? Foxpro 2.6 came in two flavors - The DOS version and the Windows version. Which is this?

If it is the Windows version, then this will apply:

p1.3-522 in the Language reference for Foxpro 2.6 for DOS and Windows -

In the Parameters section for FOPEN() in the Language Reference for FoxPro for MS-DOS and Windows 'Ports cannot be opened with low-level file functions in FoxPro for Windows'.

If you are in FoxPro for DOS, try opening the port in the buffered scheme:

comhandle=fopen('com1',2)

In the same vein, try upping the baud rate. I assume you are trying to communicate via a serial cable and not modems.

If the other machine is running Unix, or some variation thereof, you need to change to a seven bit word, with no stop-bit.

Also, to send to the port, use FPUTS(), not FGETS().

有個廟 叫 Google 先去拜一拜 !
回頂端
檢視會員個人資料 發送私人訊息
從之前的文章開始顯示:   
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區 所有的時間均為 台北時間 (GMT + 8 小時)
1頁(共1頁)

 
前往:  
無法 在這個版面發表文章
無法 在這個版面回覆文章
無法 在這個版面編輯文章
無法 在這個版面刪除文章
無法 在這個版面進行投票
無法 在這個版面附加檔案
無法 在這個版面下載檔案


Powered by phpBB © 2001, 2005 phpBB Group
正體中文語系由 phpbb-tw 維護製作