Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Don Higgins
  Where is Don Higgins?
 Peoria
 Illinois - United States
 Don Higgins
 To: Anil Sharma
  Where is Anil Sharma?
 ludhiana
 India
 Anil Sharma
 Tags
Subject: RE: Reading from Serial Port with MsComm
Thread ID: 345602 Message ID: 345609 # Views: 63 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Thursday, May 24, 2012 10:59:30 PM         
   


> > Hi Experts,
> >
> > I need help to read from the serial port
> >
> > I have this error:
> >
> > Ole IDispatch exception code 0 from mscomm Error Reading ...
> >
> > oComm = CREATEOBJECT("MSCOMMLIB.MSCOMM")
> > oComm.CommPort = 1
> > oComm.Settings = "9600,N,8,1"
> > oComm.InputLen = 0
> > ocomm.portopen = .t.
> > cValue = ""
> > DO WHILE .T.
> > IF oComm.InBufferCount <= 2
> > cValue = oComm.Input
> > ENDIF
> > ENDDO
> > ocomm.portopen = .f.
> >
> >
> > Thanks
> > Sasy
>
> Are you sure your comport = 1 ?
> Check on which port your device is connected and use that port number here.
>
>
>
> Anil
>
>
> Accounting Software
>
> Web Development
>
> Accounting, Inventory, Hotel Management, Restaurant Kot Billing, MLM, Excise Accounting and much much more!.
> My Blog


Use this code to open device manager and then look under PORTS COMM AND LPT

Local lcOpen

Declare Integer ShellExecute In shell32.Dll ;
	INTEGER hndWin, String cAction, String cFileName, ;
	STRING cParams, String cDir, Integer nShowWin

lcOpen = "devmgmt.msc"

ShellExecute(0,"open",lcOpen,"","",1)


Don Higgins



http://www.youtube.com/watch?v=dcuFx85o8XU


ENTIRE THREAD

Reading from Serial Port with MsComm Posted by Sasy Caravella @ 5/24/2012 8:36:20 PM
RE: Reading from Serial Port with MsComm Posted by Anil Sharma @ 5/24/2012 9:17:09 PM
RE: Reading from Serial Port with MsComm Posted by Don Higgins @ 5/24/2012 10:59:30 PM
RE: Reading from Serial Port with MsComm Posted by Sasy Caravella @ 5/25/2012 10:37:44 AM
RE: Reading from Serial Port with MsComm Posted by Sasy Caravella @ 5/24/2012 11:00:19 PM
RE: Reading from Serial Port with MsComm Posted by Anil Sharma @ 5/25/2012 11:25:18 AM
RE: Reading from Serial Port with MsComm Posted by Sasy Caravella @ 5/25/2012 11:35:08 AM
RE: Reading from Serial Port with MsComm Posted by Don Higgins @ 5/28/2012 5:03:31 PM
RE: Reading from Serial Port with MsComm Posted by Suresh Adhikari @ 5/29/2012 12:51:46 PM