Dear Sire
i am new in vb ,
and i need to start programming in MSR206
can you give the code
Best Regards
MSR206 Magnetic Card Reader
Page 1 of 19 Replies - 7331 Views - Last Post: 17 October 2010 - 02:33 AM
Replies To: MSR206 Magnetic Card Reader
#3
Re: MSR206 Magnetic Card Reader
Posted 12 October 2010 - 01:11 AM
Thank You for your Replay
i have a proplem when i read the input from the mscomm
i t comes like Ascii Code
How Can i Get The Correct MSG.
Edited by macosxnerd101: Please,
.
i have a proplem when i read the input from the mscomm
i t comes like Ascii Code
How Can i Get The Correct MSG.
Private Sub MSComm1_OnComm() Dim inbuffer() As Byte 'Declare an array of bytes Dim i As Long Select Case Me.MSComm1.CommEvent Case comEvReceive ReDim inbuffer(Me.MSComm1.InBufferCount) 'Specify the size of the array. InBuffercount gives the number of characters in the InputBuffer inbuffer = Me.MSComm1.Input 'Read the InputBuffer For i = 0 To UBound(inbuffer) 'Ubound(inbuffer) gives the upper bound of the array, which is equal to the number of characters in the InputBuffer Me.Text1.Text = Me.Text1.Text & inbuffer(i) 'TxtReceive is a text box Next i End Select End Sub
Edited by macosxnerd101: Please,

#4
Re: MSR206 Magnetic Card Reader
Posted 12 October 2010 - 01:45 AM
so you say is that you get the ascii code of the characters from the MSComm object?
the use Chr() function:
Function Chr(CharCode As Long)
Member of VBA.Strings
Returns a string containing the character associated with the specified character code
the use Chr() function:
Function Chr(CharCode As Long)
Member of VBA.Strings
Returns a string containing the character associated with the specified character code
#5
Re: MSR206 Magnetic Card Reader
Posted 12 October 2010 - 01:50 AM
ok , i use the chr$() to convert it to string
but the result is like this
s¢" (N±fu+L ?0
thnaks
but the result is like this
s¢" (N±fu+L ?0
thnaks
#6
Re: MSR206 Magnetic Card Reader
Posted 12 October 2010 - 02:09 AM
what kind of data should you get. and are you sure it`s not hex instead of ascii code
#7
Re: MSR206 Magnetic Card Reader
Posted 12 October 2010 - 02:36 AM
i use the TYSSO MSE-750 Device
when i send , i send in Hex Decimal
the Output is 270115027010280162034324007801770102011704307661600000000
00000000000000000000000000000027020002703000630280270480
when i use the Chr$() "Text1.Text = chr$(Me.Text1.Text) "
The Output is
thanks
Edited by macosxnerd101: Please,
.
when i send , i send in Hex Decimal
'Read Card MSComm1.Output = Chr$(27) & Chr$(&H6D) but when i get the output wihout Char$() "Text1.Text = Me.Text1.Text & inbuffer(i)"
the Output is 270115027010280162034324007801770102011704307661600000000
00000000000000000000000000000027020002703000630280270480
when i use the Chr$() "Text1.Text = chr$(Me.Text1.Text) "
The Output is
For i = 0 To UBound(inbuffer) Text1.Text = Me.Text1.Text & Chr$(inbuffer(i)) 'TxtReceive is a text box Next i the output is : s¢" (N±fu+L ?0 i don't know , ma be i forget somthing . below is the CODE Private Sub Command1_Click() MSComm1.Tag = &H72 MSComm1.Output = Chr$(27) & Chr$(&H72) End Sub Private Sub Form_Load() With MSComm1 'make sure the serial port is not open If .PortOpen Then .PortOpen = False .Settings = "9600,n,8,1" .CommPort = 5 'puerto de la lectora .PortOpen = True .RThreshold = 1 End With End Sub Private Sub MSComm1_OnComm() Dim inbuffer() As Byte 'Declare an array of bytes Dim i As Long Select Case Me.MSComm1.CommEvent Case comEvReceive ReDim inbuffer(Me.MSComm1.InBufferCount) 'Specify the size of the array. InBuffercount gives the number of characters in the InputBuffer inbuffer = Me.MSComm1.Input 'Read the InputBuffer For i = 0 To UBound(inbuffer) 'Ubound(inbuffer) gives the upper bound of the array, which is equal to the number of characters in the InputBuffer Me.Text1.Text = Me.Text1.Text & inbuffer(i) 'TxtReceive is a text box Next i End Select End Sub
thanks
Edited by macosxnerd101: Please,

#8
Re: MSR206 Magnetic Card Reader
Posted 12 October 2010 - 02:46 AM
well i`m not familiar with this device. but read the sheet and see what result should it return and in what format.
#9
Re: MSR206 Magnetic Card Reader
Posted 12 October 2010 - 04:21 AM
Topic split. Please avoid necroposting.
#10
Re: MSR206 Magnetic Card Reader
Posted 17 October 2010 - 02:33 AM
If you're reading magnetic swipe cards, then I'm assuming that you have a defined test card, otherwise, how will you know that what you're reading is right or wrong?
What data do you expect back from your test card and how does it compare to what you read?
Have you got the DIP switches set on the device as to how you want to use it and the comm port settings set according to the device configuration?
The device comes with a utility whereby you can check your comms settings and see what is being read from the card on all three tracks.
It might be worth installing that and verifying it against what you have in code.
What data do you expect back from your test card and how does it compare to what you read?
Have you got the DIP switches set on the device as to how you want to use it and the comm port settings set according to the device configuration?
The device comes with a utility whereby you can check your comms settings and see what is being read from the card on all three tracks.
It might be worth installing that and verifying it against what you have in code.
Page 1 of 1