|
-
Jan 20th, 2007, 12:32 AM
#1
Thread Starter
New Member
Receive data from my reader using MScomm
The program below show the receive function. When i swap the tag to the reader, the reader will receive the data and show the tad id to the monitor. But when i RUN this program, the data didn't come out
Please have me to check the code below, and give me a idea to solve it. THK
Option Explicit
Private Sub MSComm1_OnComm()
Dim tRECEIVED As String
If MSComm1.CommEvent = comEvReceive Then
tRECEIVED = MSComm1.Input
Label2.Caption = tRECEIVED
Label3.Caption = "Detected"
Else
Label3.Caption = "Not detect"
End If
End Sub
Private Sub Form_Load()
Label1.Caption = "Attach an RFID Tag Reader"
Label2.Caption = ""
Label3.Caption = "Not detect"
MSComm1.PortOpen = True
End Sub
-
Jan 20th, 2007, 02:46 AM
#2
Frenzied Member
Re: Receive data from my reader using MScomm
philipmact:
Welcome to VBForums.
First of all let me tell you at the start that I don't know much about the RFID technology and I don't think you are going to find any RFID gurus in this forum.
Second, I have only worked with the MSCOMM control in relation to modems.
With those two things in mind I am going to take a stab at providing you some information which may or may not be helpful.
In your posting you state:
show the receive function
However, your code does not contain any Function.
You have a form load event which puts text into two labels and leaves one label empty, and you set the portopen property to True.
You also have a Private Sub MSComm1_OnComm() event with which you are attempting to read the Input from MSComm1.
My first question would be, how do you know what, if anything is being received by MSComm1?
I am assuming that you have an RFID reader attached to MSComm1. And, apparently you also have a tag for the reader to read since you state:
When I swap the tag to the reader, the reader will receive the data and show the tag ID to the monitor.
The next assumption I will make is that your RFID reader came with some software that you installed in order to make the RFID reader work with your computer. It is that software that reads the input generated by the RFID reader and displays it on your monitor.
Most likely it is the objects and properties of that software that you are going to have to manipulate with your Visual Basic code. I don't know how you will find out what those objects and properties are except possibly by looking at the files that were installed when you installed the RFID software.
I am sure you can do it, just like you can manipulate a Word document or an Excel spreadsheet or a scanner using Visual Basic. I just can't tell you exactly how since I don't know anything about the RFID software your have.
Quite possibly the above information is of absolutely no value to you, but since no one else had given you any kind of a reply I thought I would share my thoughts about it.
Good Luck
-
Jan 20th, 2007, 10:46 AM
#3
Thread Starter
New Member
Re: Receive data from my reader using MScomm
Thank for your quick reply AIS4U. Form your 1st question
"If anything is being received by MSComm1"
i have tested this with RS232 HEX COM TOOL .

This application can send and receive ASCII or HEX data as shown the pictures above. Select the appropriate PC COM port and 9600-baud, 8 bits, 1 stop, no parity, and hardware handshaking protocol from the drop down menu. A simple test for correct communication between PC and the reader is to send "z" command using the "RS232 Terminal" software shown above. If received correctly the reader will replies with the reader type,software version and IB Technology disclaimer message.
"The next assumption I will make is that your RFID reader came with some software that you installed in order to make the RFID reader work with your computer. It is that software that reads the input generated by the RFID reader and displays it on your monitor."
THe RFID reader was came with C++ software, but for my project i need to use VB to write it.
So i need the VB program to read my ID when the reader detected by the reader.My idea are shown as below~
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|