Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Visual Basic





See Related Forum Messages: Follow the Links Below to View Complete Thread

Serial Port Monitor Source Code
I am looking for some code that would give me the ability to monitor data from a serial
port. I have found some programs on the web but no souce code to incorporate into a VB
program. If anybody has any info (ActiveX or DLL) on this it would be much appreciated.

Thanks,

price1

Communicate Through The Serial Port(com1)
Hi.
I have an urgent problem.
I have a serial printer (to com1) that prints barcodes.
Does anyone know how to check if the printer is connected to the serial port and after each label i
must make sure that the lable was printed. I need the printer to "answer" me in one way or another.
(if it is out of paper and didnt manage to print)

Can this be done in VB?
It should be like a status that says that a device is connected to the serial port.
When I send all the info there should be a way to know if the information has gone through.

Thanks a million in advance.

/Andreas

Communicate With AT89C51 Microcontroller Via Serial Port
could any one help me in writing VB program to transfer data from AT89C51 microcontroller via serial communication port.

Communicate VB With External Buttons Using Serial Port
I am very new in VB. Need help urgently. Now I am doing a program, which I want to communicate external 3 buttons to the vb to control the commandbuttons using serial port RS232. basically I have 3 external buttons and 3 commandbuttons, the 3 external buttons one is move left, one is move right and one is enter. I just want the 3 external button to moving around the commandbuttons and enter. Anyone can help? have any idea how to do it? thanks alot!!!!!

Send Text File To Serial Port To Communicate With A 8051 Embeded Device.
Hai guys. Here is my problem. i got a form with a SEND command button and a file list box that list out the contain of a folder. The folder got some text file in it. what is would like to do is when i select a text file in the file list box and click the SEND button, my appliaction will the the text file to the serial port and my hardware a 8051 microcontroller embeded device will receive the text file. i know i can use MS comm control. But i don't konw the code. I search the forum and what i get is mostly sending data to modem, not other device. So can any one provide me with the code.
Here is what i found :

Private Sub cmdcomman1_click()
' Buffer to hold input string
Dim Instring As String
' Use COM1.
MSComm1.CommPort = 3
' 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm1.Settings = "9600,N,8,1"
' Tell the control to read entire buffer when Input
' is used.
MSComm1.InputLen = 0
' Open the port.
MSComm1.PortOpen = True
' Send the attention command to the modem.
MSComm1.Output = "ATV1Q0" & Chr$(13) ' Ensure that
' the modem responds with "OK".
' Wait for data to come back to the serial port.
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
Loop Until InStr(buffer$, "OK" & vbCrLf)
MsgBox buffer

i try this code and didi get a respond from my modem. Can i use the same code for my device. Please Help. Thanks.Have A Nice Day

Bar Code Reader From Serial Port
My bar code reader sends data via the com port. I would like to save this data into a log file. This has to be easy. Anyone got any idea? Do I have to open a communication for the com port? Do I have to set the parameters for the communication (like baud rate, parity and so on)? Anyone got any idea?

I would be really happy if this would work.

Parallel Port Interface Source Code
hi guys! i need ur help. i'm new here and i have read some of discussions regarding parallel port communication. i understand that i need inpout32.dll or other dll to be able to send a binary data to the port using VB6. im a newbie when it comes to VB programming and what i need is the exact source code to send a binary 1 or 0 signal to the parallel port. could anybody give me that simple exact code? some of the links and examples that i've seen are too complicated for a beginner like me. pls help, i need it for my project...just paste it here pls... thank you so much in advance!!

Sample Code For Read-Write Text Files Off The Serial Com Port Of A Pocket PC
Gentlemen:

Do you guys know where to find a sample code for reading and writing text files off the Serial communication Port of a Pocket PC and later synchronize with its desktop PC?

One part of the application involves using a Pocket PC for connecting to the Vending Machine Serial port and reading the Accounting and Maintenance Data. The data is basically a Text based file, we need to read this file and save it with a file name composed of: MachineSerialNumber+Date+Time.txt.

Once the data is collected from all the Vending Machines we have to download it to the desktop computer back in the office. Any insight will be highly appreciated.


I will be using:

Microsoft eMbedded Visual Tools
With eMbedded Visual Basic 3.0

Sample Code For Read-Write Text Files Off The Serial Com Port Of A Pocket PC
Gentlemen:

Do you guys know where to find a sample code for reading and writing text files off the Serial communication Port of a Pocket PC and later synchronize with its desktop PC?

One part of the application involves using a Pocket PC for connecting to the Vending Machine Serial port and reading the Accounting and Maintenance Data. The data is basically a Text based file, we need to read this file and save it with a file name composed of: MachineSerialNumber+Date+Time.txt.

Once the data is collected from all the Vending Machines we have to download it to the desktop computer back in the office.


I will be using:

Microsoft eMbedded Visual Tools
With eMbedded Visual Basic 3.0

How To Communicate With USB Port...
Good day,
I have using MSComm Object to communicate(CommPort) with one device in VB6.0. it's working fine. Now i want to change from CommPort to USB Port. what object do i use for this task.
Advanced thnz for ur help.

How To Communicate With COM Port?
hi,

how to communicate with
COM port without using
Active X Controls in VB

How Do You Communicate Through The IrDA Port?
I have used winsock and done tome TCP/IP programming in the past and a little bit of serial programming, again, in the past, but am wondering how to communicate through the IrDA port of my laptop. How do you send signals out of it. Eventually, I would like to send the correct signals out to run a tv or something, but starting out, I suppose I need to know how to communicate with the IrDA port at all.

I have Visual Basic 6.

Thanks.

Communicate Directly With PS/2 Or Other Port
I want to create a button that I can press with my foot when my hands are busy. When the button is pressed it will send a message to whatever port it is connected to and my program will receive the message and do whatever it is that I will program it to do.

My question is this:
Does anyone have suggestions as to how I will make this button so that the computer will know when it is pressed, and how can I make my program know when the button is pressed.

I would use a COM port and the MSComm control but I do not have a cable to connect to a COM port. I expect I will need to use a USB port since that is easiest.

Communicate With Hradware Port
I'm unable to use the old functions(INP and OUT) from the old Basic with VB6. I want to know if there is a DLL that contains these functions and that is usable with VB6

Communicate Directly With PS/2 Or Other Port
I want to create a button that I can press with my foot when my hands are busy. When the button is pressed it will send a message to whatever port it is connected to and my program will receive the message and do whatever it is that I will program it to do.

My question is this:
Does anyone have suggestions as to how I will make this button so that the computer will know when it is pressed, and how can I make my program know when the button is pressed.

I would use a COM port and the MSComm control but I do not have a cable to connect to a COM port. I expect I will need to use a USB port.

Communicate With Printer Through COM Port
I've started doing a small program which required to print out on Olivetti PR2e Passbook Printer (text only, the printer is connected to computer by COM1 port without any driver installed)
Please help
Best regard

How To Make VB Communicate With A Com Port Of Ur Pc
HIHIHI
I'm new here....Does any one know wad is the code to make ur VB.6 communicate with a com port of the pc ?

Program To Communicate With USB Port
i am a beginner in interfacing USB Port. Now i am doing a project to read/write/modify data from Smart Card via USB Port. How can i communicate to USB Port using Visual Basic 6.0. Please Help me for the same...



with advanced Thanks


Ajees

Communicate Through Parallel Port
I need to open a cash register on a parallel port. How do I open that port and send information through it? Hm. That sounds a little suspicious, doesn't it? No seriously, I'm writing a cash register application.

How Do I Communicate With A Modem Or With A Com Port?
Hi,

Does anyone happen to know how you can communicate with a com-port in VB? At this moment I know how to check for available com-ports on your PC and how to send a string of data to this port.

But how do you receive output from that port?
When I send ATI1 to my modem on COM4, then how do I receive it's reply?

I am not using the MSCOMM control, so I guess I'd have to use API calls, but which ones?

Does anyone know how to communicate with a com-port- and the device on the port or know where I can find some examples/tutorials?

Thanks,

vbDan

How To Communicate With Parallel Port Using VB.NET?
I am new to VB.NET, new to programming, really need help on this! can someone please help me...
When my circuit switch (connected to the parallel port) is switched on, it will send signal to the parallel port to activate my vb.net program to send a predefined SMS to someone. How to write this vb.net program for the parallel port to receive the signal. How should i start with my program?

'Translate Source Pascal To VB' Communicate On RS232
To communicate to my solar convertor, I have to communicate via RS232 to RS485. I received a smal source code in Pascal. Is their anyone who can 'translate' this part to VB ? .... Here is the Pascal Code;

Code:
var
ZendBuffer: array[1..6] of byte;
AantalBytesInZendBuffer
OntvangBuffer: array[1..10] of byte;
AantalBytesInOntvangstBuffer: integer;
OntvangenDatabyte: byte;

Procedure StartOntvangstRS232;
{Receive RS232 data. The last byte is always 33}
begin
AantalBytesInOntvangstBuffer := 0;
repeat
WachtOpOntvangenRS232Databyte(OntvangenDatabyte);
inc(AantalBytesInOntvangstBuffer);
OntvangBuffer[AantalBytesInOntvangstBuffer] := OntvangenDatabyte;
until OntvangenDatabyte = 33;
end;
I've made the next source;

Code:
OntvangenDatabyte = MSComm1.Input
AantalBytesInOntvangstBuffer = 0

Do Until OntvangenDatabyte = Chr$(33)
AantalBytesInOntvangstBuffer = AantalBytesInOntvangstBuffer + 1
OntvangBuffer(AantalBytesInOntvangstBuffer) = Chr$(OntvangenDatabyte)
Loop

But, you see ... error ! And no receiving anything ....

Regards,

Eric

Problem With Reading Data From Com Port(serial Port)
hi

I am developing a vb program to read data from MSR (Magnetic Stripe Reader). I have connected the MSR in com port. i want to get the data(member id) from the magnetic member card when the member swipes it on the MSR. I am using the follwoing cods to initialize and read the data



i'm initializing the device MSR in form load



Code:
form_load()



MSComm1.CommPort = 3
MSComm1.Settings = "19200,n,8,1"
MSComm1.RThreshold = 12
MSComm1.InputMode = comInputModeText
MSComm1.InputLen = 0
MSComm1.PortOpen = True



Private Sub MSComm1_OnComm()
Dim aaa As String
If MSComm1.CommEvent = comEvReceive Then
aaa = MSComm1.Input
Text1.Text = aaa

End If
End If
End Sub




My problem is, for some cards the above mentioned code is working fine. ie, i can get the data and i am checking the member id with teh table. fine. but sometimes i am not getting anything from MSR when the member swipes the card. I don;t know what is the problem in my code.

The length of the Member id will variy from member to member, for example

the format %99999-123? - length is 11 characters

%99999/01-1123? -length is 15 characters

%99997-1? - length is 9 characters



Pls suggest me what is the problem in my code. and y ii cannot get any data from some of the cards. that cards are working in another machines without any problem



Thanks in advance

reagrds

Prem

Read Data From Serial Port Or COM Port
Anyone got code to read data from Serial Port of Com port?
Can you send me a copy?

Any help appreciated

Morith

Serial Port Emulator / Virtual Com Port
Hi,

i'm trying to write a serial port emulator:

if my pc has 2 serial ports (com1 & com2) i should get a (software) com3.

In this way i can talk trough some hyperterminal-like app. to my programm.....

Has anyone a hint?

How To Get Data From Serial Port /parallel Port
How do you capture data sent through the
serial/parallel port coming from another machine(lets
say from a pabx machine sending strings of data).

Is it possible to save the data to a txt/csv file for
processing? how?

Get Info From Serial Port (mouse Port)
hi dears

can you tell me how can i receive information from serial port
i have tv tuner remote control with its sensor i insert its sensor in serail port (mouse port) and i want to get message one when i press 1 and and two when i press two
how is it possible

Is There Any Controls Of USB Port? Like MSComm To Serial Port.
Microsoft provides MSComm for controlling communication through serial port. Is there any similar controlling tool for USB?
Where can I find relevent info?

Thanks in advance!

Working With Existing Games With No Source
Hey everyone,

Same old story, i want to skill in a game or tell it todo things when im busy and not worry about it.

The game is The Sims Online. First thing im curious about is if a message box like this certain one about "5:00minutes until you are disconnected" appears, my program closes that popup.

Any ideas?

2) Ive seen cheat programs that somehow load game data and can cheat on puzzles somehow... please help if you know how to access The Sims Online .dat files or any other important sims files.

Thanks in advanced.

Can I Add A Recordset From Another Source To An Existing Access Table ?
Hi
I have an access database and now I wish to attach a recordset from another location to the database. Can this be done ?

here is the existing database code:Public Sub OpenDataBase()

Set myconnection = New ADODB.Connection
myconnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source =c:file_extractiondatabasebt.mdb"
myconnection.Open
End Sub


I have a text file which is opened as a recordset and now I wish to add it to the existing database in code as a new table called tableImport. Can this be done and how is it achived. Here is the code that I use to import the text file into a recordset.

Private Sub ImportData()

Dim connCSV As New ADODB.Connection
Dim rsImportFile As New ADODB.Recordset
Dim adcomm As New ADODB.Command
Dim path As String

connCSV.Open "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" _
& path & ";Extensions=asc,csv,tab,txt;HDR=NO;Persist Security Info=False"
strSQL = "SELECT * FROM FilqasConLoc.txt"
rsImportFile.Open (strSQL), connCSV, adOpenStatic, adLockReadOnly, adCmdText

now I wish to add this recordset from the text file to the existing database.

thx if you can advise

Crystal Rep't -- Using Existing Recordset As Data Source
I am brand new to Crystal Reports. I am using VB6 and CR 6.0. I have already
created a connection and populated recordset(which uses a complex join) in my VB6 project. I want to use the existing recordset as the data source for
the report, and then manually bind the report's controls to the recordset fields. Is this possible, and how do I do it?

Thanks,
John
RichMary98@aol.com

[NOT RESOLVED] Send To An Existing Port
Using winsock (the control - I've never worked with the Winsock APIs), how do I send a message through an existing port opened by another application? How do I listen on one?

I need to send a packet to a port opened by AIM without having to connect to oscar.aol.com myself.

USB And Serial Port ?
The new laptops do not have a serial port,DB-9. Many of the device I connect to do not have a usb port. Clearly there are some converters <Belken and others> But what are they converting. I have a lot of the legacy Serial port devices in use. The device baud rate is limited to 9600. Is there any other route to take to avoid another cable thing and associated software?

Serial Port
Hi! I'm new in this forum.
I am finding code or samples to solve this kind of problem:
1. monitoring a serial port, waiting a stream
2. decoding it and display a string, saving it in a db

I know how to solve the second part, but I'm in trouble about the first....
Can anyone help me?

Thank you in advance!!

LP

Serial (com-) Port Again
i'm runnin' win2k and i want to have something like

button on a box connected to 9pin serial is pressed, VB tells me which one it was

i have searched lvr.com and i read much about INPOUT32.DLL but i have no clue how to implement it

Serial Port - IO Box
hey,

i tried to make a program in vb, used the MScomm stuff.

theres a main card whit an atmel chip.
on the main card is an other card connected this one have address 1 at this card there is a 3th card connected. this card have 8 relays and 8 in-ports.
i could add multiple card to the main card so i have got more relays and in-ports

schema;

maincard - 2ndcard adres1 - 3th card relays

when i add an other card i get :

Code:
maincard - 2ndcard adres1 - 3th card relays..
--------- - 3ndcard adres2 - 3th card relays..
"-" = fill up :p
when i want to switch a relay i need to give the address (for card 2ndcard or 3ndcard)in the string i.e.:


Code:
mscomm1.output = chr(1) <- address one
mscomm1.output = chr(1) < relay no. 1 & chr(10) & chr(13)
when i use this two lines, relay 1 on address card 1 is switching.

when i want to READ port1 i need to do :

Code:
mscomm1.output = chr(1)
var = mscomm1.input
i need to set the output this is for address 1 otherwise i dont receive data

is there an other way to do this ? to select address 1 to READ port 1 ?
because when i re-read a port MSComm1.Output = Chr(1) is stil in it and there comes an other MSComm1.Output = Chr(1) so relay1 is always on


Code:
Private Sub Command1_Click()
'this turns relay 1 one address card 1 on
MSComm1.Output = Chr(1)
MSComm1.Output = Chr(1) & Chr(13) & Chr(10)

End Sub

Private Sub Form_Load()
MSComm1.CommPort = 2
MSComm1.Settings = "9600,N,8,1"
MSComm1.SThreshold = 1
MSComm1.PortOpen = True
End Sub

Private Sub MSComm1_OnComm()
Dim sdata As String
MSComm1.Output = Chr(1)
'MsgBox sdata

sdata = MSComm1.Input
'MsgBox "evreceive " & sdata
Text1.Text = sdata



If MSComm1.CommEvent = comEvReceive Then
sdata = MSComm1.Input
'MsgBox "evreceive " & sdata
Text1.Text = sdata
End If
End Sub

Serial Port
I'm a novice in serial port programming. Can anyone help me how to retrieve and display the data after the port is open?

Serial Port
Hi all,

I am seek help. Hope my problem is not a big problem. What we all know that if we are using the parallel port in VB6 we have to use portout 888, &hFF and we have to import the I/O.

Then the serial port is it written in the same way as the parallel port? Or is there other thing I need to take note. Thank you for your help in advance



Regards

Serial Port
Hello!!!

I'm trying to receive an input signal through the serial port, at the moment I'm able to check if there is something at the port. What I'm doing at the moment is receiving an square wave generated by a signal generator; if the signal generator is turned off, the program displays a message saying that there is no signal, and when the device is inmediatly turned on the program displays the messag saying that there is a signal (or something at the com1).

What I want to do is that if I turned the signal off at any moment when the program is still running, is display a message or an action saying that the signal has been lost, and when turning the signal on again a message saying that it is back on.

In simple words I want to constantly monitor the serial port to check if there is or not any signal while the program is running.

thank you

Serial Port Through TCP/IP
Hi Everyone, this is my first post, and i hope you can help me with this
I know VB, C, and Java Programming Languages.
It Is been months that i am not coding in vb, but i think i will get back on training soon.
I need to develop a program that redirects serial port to a TCP port like:

192.168.1.1:234 --> (is really) COM 2 of 192.168.1.1 machine.

Can i do that with VB6 ?

thanks

Serial Port Help
Forgive my ignorance. I am trying to teach myself Visual Basic and have stumbled into a problem. I work for a TV station that broadcasts major league baseball games. We are getting data from a radar gun that sends pitch speeds over a serial port. I am curious about the settings I need to get it to work. The data is a constant pulse meaning data is continuously coming over the serial port. When I plug the gun data into hyperterminal..it works fine. But I need to get it to work with my program. Right now, all I get is jibberish. I need to see numbers pop up in a text box that I have on my form.

here's my code...what else do I need?

MSComm2.CommPort = 4 ' set the port
MSComm2.Settings = "1200,n,8,1" ' set the settings
MSComm2.RThreshold = 3 ' how many characters received per onComm event
MSComm2.InBufferSize = 3
MSComm2.PortOpen = True ' open the port
MSComm2.RTSEnable = True
MSComm2.Handshaking = comXOnXoff
MSComm2.InputMode = comInputModeText


Private Sub MSComm2_OnComm()
Select Case MSComm2.CommEvent
Case comEvReceive
RADARX.Text = MSComm2.Input
End Select

End Sub


Any help is much appreciated. I am wondering if it is a terminal emulation issue. (VT100 or ANSI works when I use hyperterminal)

Thanks

Need To Know All About Serial Port
hello everybody,
this is my first topic here
i'm very happy to know such an excellent forum and such professional members
i want you to help me in this please:
i want to know all about dealing with serial port using visual basic 6.0
i'm sure you'll give me info. more than i want
it'll be good too if you told me about a free e-book to download or a site that explains an detail how to deal with serial port by VB6

THANKS FOR CONSUMING YOUR TIME READING MY TOPIC

Serial Port
I wrote this code to run a kit, connected to the serial port:

Private Sub Command_Click()

MSComm1.PortOpen = True
MSComm1.Output =chr$(156) & chr$(8)
Do
A = Doevents ()
Loop Until MSComm1.InBufferCount = 2
Print MSComm1.Input

End Sub

At the end, the code print two characters on the form.
But the two characters are only for code check.
How do I convert both of them to obtain a decimal value
from 0 to 65536 (16 bit) by VB code ?
Thank you
Frank

Serial Port
How do I translate this GWbasic code to Visual Basic code ?

OPEN"com1:1200,n,8,1"AS#1
OUT &H3FB, &H1B
PRINT#1,CHR$(191);CHR$(70) 'Transmit 2 bytes
A$=INPUT$(1,#1) 'Receive
B$=INPUT$(1,#1) 'two bytes from port 1
PRINT ASC(A$) ; ASC(B$) 'Print the two received bytes
END on the screen

This code transmit and receive two bytes to and from a device
connected to the serial port COM1.

Thank you

About Serial Port.
CAN U tell me that how can I Increase the spped of the serial port using MSCommunications control without any modem Any other devices.

Serial Port
Hiya,

I've had a search, and can't find anything that covers what I need to do..

I've seen some referenes to MSComm but cant quite get it to work how I want..

I need to be able to control individual pins on a Serial Port, so for instance I would click a button and it would switch on Pin2 with a constant flow.. is this possible?

Much appreciated..

Serial Port
Hi Folks
I am working on a project which i need to switch a relay on for 1-2 secs via the computer. Surfing on the web I have been able to gather that VB can control the serial port. So heres the question can anyone devise the code that will turn the DTR pin4 on the serial port on for 1 sec everytime I run the code(I need it in .exe format but should be able to compile it myself). If this can be done easyish then I will be more interested in getting to grips with VB myself.
Many Thanks
Paul

Serial Port
I have two computers connected to each other through the serial port with an RS232 cable. I tried with some snippets I found out there, but I cannot make anything going out of the port to the other computer (MSComm1.OutBufferCount is always 0 regardless what I wrote on its Output property). Does anybody have any example I can try? TIA,

Serial Port
Is there a way to know if the serial port is broken with the MSComm Control ?

Copyright © 2005-08 www.BigResource.com, All rights reserved