Hi,
I'm trying to send data from PIC - PC using the program mackrackit pointed to earlier in this thread.
http://www.rentron.com/receiving_data.htm
When I compile it I have this error message: Name 'comEvReceive' is not declared.
Does anyone have an idea of a fix (with as much of an explaination as you can spare please, I'm new to this). I've done lots of Googling with various answer from 'Select Case' to it can't be done in the 2008 VB-Version.
I guess I should add I'm using Visual Basic 2008 Express Edition.Code:Private Sub MSComm1_OnComm() Dim sData As String ' Holds our incoming data Dim lHighByte As Long ' Holds HighByte value Dim lLowByte As Long ' Holds LowByte value Dim lWord As Long ' Holds the Word result ' If comEvReceive Event then get data and display If MSComm1.CommEvent = comEvReceive Then sData = MSComm1.Input ' Get data (2 bytes) lHighByte = Asc(Mid$(sData, 1, 1)) ' get 1st byte lLowByte = Asc(Mid$(sData, 2, 1)) ' Get 2nd byte ' Combine bytes into a word lWord = (lHighByte * &H100) Or lLowByte ' Convert value to a string and display lblRCTime.Caption = CStr(lWord) End If End Sub
Any help much appreciated.
Dave




Bookmarks