Sir,
I have my project its a Barcode System, since i dont know yet how to use RS-232, My question is:
1. RS-232 is only for Sending Date and Reading Data? its just for open the MScomm port and Settings.? How can i interface it in VB6 Programming?
Sir,
can you give explanation of these code:
MSComm1.PortOpe n=True
Ms.comm1.Settin gs=9600,n,1,8
Sir is there other code need to enabled Rs-232?
2. Sir can you provide me samples of Barcode system using RS-232 in VB6?
Sir, thank you in advance! and More power
Julius
6 6805
Sir,
I have my project its a Barcode System, since i dont know yet how to use RS-232, My question is:
1. RS-232 is only for Sending Date and Reading Data? its just for open the MScomm port and Settings.? How can i interface it in VB6 Programming?
Sir,
can you give explanation of these code:
MSComm1.PortOpe n=True
Ms.comm1.Settin gs=9600,n,1,8
Sir is there other code need to enabled Rs-232?
2. Sir can you provide me samples of Barcode system using RS-232 in VB6?
Sir, thank you in advance! and More power
Julius
Hey Julius, Welcome to the scripts. You are posting your posts in the wrong forums.
That first one for example should have been here: http://www.thescripts.com/forum/forum30.html
And this qusetion is better asked in the vb forum
Hey Julius, Welcome to the scripts. You are posting your posts in the wrong forums.
That first one for example should have been here: http://www.thescripts.com/forum/forum30.html
And this qusetion is better asked in the vb forum
Thank you sir for informing me.
Julius
Sir,
I have my project its a Barcode System, since i dont know yet how to use RS-232, My question is:
1. RS-232 is only for Sending Date and Reading Data? its just for open the MScomm port and Settings.? How can i interface it in VB6 Programming?
Sir,
can you give explanation of these code:
MSComm1.PortOpe n=True
Ms.comm1.Settin gs=9600,n,1,8
Sir is there other code need to enabled Rs-232?
2. Sir can you provide me samples of Barcode system using RS-232 in VB6?
Sir, thank you in advance! and More power
Julius
Thank you sir for informing me.
Julius
Welcome. No need for the "sir" next time though.
This worked for me with an serial Metrologic Voyager:
Suppose your MSComm control is named BarcodeComm
Settings are: 9600,n,8,1 - 'in your forms declaration section
-
Dim WithEvents BarcodeTimer As Timer
-
-
Initialization somwhere, e.g. in form_Load:
-
BarcodeComm.CommPort = 1
-
BarcodeComm.PortOpen = True
-
BarcodeTimer.Interval = 100
-
BarcodeTimer.Enabled = True
-
-
'use a timer to read from the serial port:
-
Private Sub BarcodeTimer_Timer()
-
Dim barcodeRead as String
-
barcodeRead = ReadBarcode()
-
-
if barcodeRead <> "" then
-
'handling the code read...
-
Msgbox "Barcode=" + barcodeRead
-
Endif
-
End Sub
-
-
Function ReadBarcode() As String
-
On Error GoTo ReadBarcode_ERROR
-
-
Static comInput As String
-
Static ReadBarcodeRunning As Integer
-
-
If ReadBarcodeRunning Then
-
ReadBarcode = ""
-
Exit Function
-
Else
-
ReadBarcodeRunning = True
-
-
If BarcodeComm.InBufferCount > 0 Or Len(comInput) > 0 Then
-
Do
-
comInput = comInput + comControl.Input
-
-
'if received data contains CR+LF, then exit
-
If InStr(comInput, Chr$(13) + Chr$(10) > 0 Then
-
Exit Do
-
Else
-
dummy = DoEvents()
-
End If
-
Loop
-
-
'remove CR+LF
-
posP = InStr(comInput, Chr$(13) + Chr$(10))
-
t$ = Left$(comInput, posP - 1)
-
-
'anything beyond CRLF belongs to next barcode
-
comInput = MID$(comInput, posP + 2)
-
-
ReadBarcode = t$
-
Else
-
ReadBarcode = ""
-
End If
-
-
ReadBarcodeRunning = False
-
End If
-
-
ReadBarcode_EXIT:
-
Exit Function
-
-
ReadBarcode_ERROR:
-
MsgBox "Error in ReadBarcode:" + vbcrlf + Error$
-
Resume Next
-
End Function
BEWARE:
make sure that the barcode scanner adds CR+LF as delimiters after each barcode or adjust the delimiter detection in ReadBarcode() accordingly
Let me know if this helped a little...
Thank You Sir, for the Code you gave me... Thanks Again God Bless U...
Julius
This worked for me with an serial Metrologic Voyager:
Suppose your MSComm control is named BarcodeComm
Settings are: 9600,n,8,1 - 'in your forms declaration section
-
Dim WithEvents BarcodeTimer As Timer
-
-
Initialization somwhere, e.g. in form_Load:
-
BarcodeComm.CommPort = 1
-
BarcodeComm.PortOpen = True
-
BarcodeTimer.Interval = 100
-
BarcodeTimer.Enabled = True
-
-
'use a timer to read from the serial port:
-
Private Sub BarcodeTimer_Timer()
-
Dim barcodeRead as String
-
barcodeRead = ReadBarcode()
-
-
if barcodeRead <> "" then
-
'handling the code read...
-
Msgbox "Barcode=" + barcodeRead
-
Endif
-
End Sub
-
-
Function ReadBarcode() As String
-
On Error GoTo ReadBarcode_ERROR
-
-
Static comInput As String
-
Static ReadBarcodeRunning As Integer
-
-
If ReadBarcodeRunning Then
-
ReadBarcode = ""
-
Exit Function
-
Else
-
ReadBarcodeRunning = True
-
-
If BarcodeComm.InBufferCount > 0 Or Len(comInput) > 0 Then
-
Do
-
comInput = comInput + comControl.Input
-
-
'if received data contains CR+LF, then exit
-
If InStr(comInput, Chr$(13) + Chr$(10) > 0 Then
-
Exit Do
-
Else
-
dummy = DoEvents()
-
End If
-
Loop
-
-
'remove CR+LF
-
posP = InStr(comInput, Chr$(13) + Chr$(10))
-
t$ = Left$(comInput, posP - 1)
-
-
'anything beyond CRLF belongs to next barcode
-
comInput = MID$(comInput, posP + 2)
-
-
ReadBarcode = t$
-
Else
-
ReadBarcode = ""
-
End If
-
-
ReadBarcodeRunning = False
-
End If
-
-
ReadBarcode_EXIT:
-
Exit Function
-
-
ReadBarcode_ERROR:
-
MsgBox "Error in ReadBarcode:" + vbcrlf + Error$
-
Resume Next
-
End Function
BEWARE:
make sure that the barcode scanner adds CR+LF as delimiters after each barcode or adjust the delimiter detection in ReadBarcode() accordingly
Let me know if this helped a little...
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: bajopalabra |
last post by:
hi
session("myVar") = rs.getRows( )
don't work when number of records
is greater than 10
does anybody know WHY ???
is it a Session object limitation ???
thanks
|
by: Joseph Markovich |
last post by:
I'm having some trouble with VB in Access 2000. I have a form that the
user enters in just one number (in this case, it's a base salary) and
then the program is going to do a bunch of math (which is not all
shown) and populate a table with these new, calculated salary values.
I know I shouldn't be storing calculated values in the table, but I...
|
by: dixie |
last post by:
I have some code that adds new records into a table for each ID in a list
box when a button on a form is clicked. This works fine. My problem now is
that I wish to be able to edit all the records for people whose ID is in the
list box. I made minor changes to the code (mainly replacing rs.AddNew with
rs.Edit)and it appears to be updating...
|
by: Mike |
last post by:
I have some simple code see below.
I have response written out the query and it is valid and returns values
when ran directly against my db, which is Oracle. My OS is Win 2003.
My question is I never get to the point of the loop. It always thinks I am
at the RS.EOF. Similar code works in other asp pages on the same server.
How do I...
|
by: John |
last post by:
I can't get my head around this!
I have the following code:
<%
.... Code for connection to the database ...
.... Code for retrieving recordset ...
If Not rs.EOF Then
... Do something...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |