HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
Go Back  Xtreme Visual Basic Talk > > > HELP WITH MY SERIAL PORT


Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2001, 06:17 PM
garytec
Guest
 
Posts: n/a
Default HELP WITH MY SERIAL PORT


Please, i'm a novate programmer...someone can help me to obtain data via serial port and put it in a TXT file...
please us very urgent...
I need y VBA code o something like this...

Reply With Quote
  #2  
Old 09-10-2001, 06:23 PM
BillSoo's Avatar
BillSooHELP WITH MY SERIAL PORT BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default Re: HELP WITH MY SERIAL PORT

I'm not sure you can do this with VBA....

If it is VB, the general procedure would be to open the port using the MSCOMM control, then read the data using the INPUT method, then save the data with the normal file commands.

Do you know what format your data is coming in as? (ie baud rate etc)

Do you know how much data you should have?

Do you know what format you want to store it in?



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
  #3  
Old 09-10-2001, 06:45 PM
garytec
Guest
 
Posts: n/a
Default Re: HELP WITH MY SERIAL PORT

Ok, i'm a novate programmer and i need some program in VB to obtain data from a printer (this printer work with serial port)...so i need to obtain data a least 24 hours via my PC serial port, and put in these data in a file TXT... or in files of 10 KB ...TXT (that's would be ideal!)....
my transmittion velocity may be selectable ...8 Data bits and NONE parity...
hoping for your response

thank you excuse me my poor english...

Gary Sanchez.



Reply With Quote
  #4  
Old 09-10-2001, 06:53 PM
ThinkerHELP WITH MY SERIAL PORT Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default Re: HELP WITH MY SERIAL PORT

What kind of data do you expect the printer to send to your PC?

I think therefore I am... sometimes right. [img]images/icons/wink.gif[/img]
__________________
Posting Guidelines
Reply With Quote
  #5  
Old 09-10-2001, 07:02 PM
garytec
Guest
 
Posts: n/a
Default Re: HELP WITH MY SERIAL PORT

the data that i'm receive from my printer is SERIAL DATA....
i mean, SERIAL TO SERIAL (PC TO PRINTER)...

Gary.

Reply With Quote
  #6  
Old 09-10-2001, 07:15 PM
ThinkerHELP WITH MY SERIAL PORT Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default Re: HELP WITH MY SERIAL PORT

Yes, I understand it is Serial to Serial. The thing I don't understand is,
you seem to be asking how to capture data from the serial port and save
it to a file. Then you say the serial port will be connected to a printer.
As far as I know, printers don't send data back to PCs. They can send
status information that the printer driver can use to determine things
like whether or not it is ready to print, whether or not it has paper or ink
or toner, whether or not it is ready for the next page or next document.
So, it would be very helpful in answering your question if you could
explain what kind of data you expect the printer to send through the
serial port to the PC.

I think therefore I am... sometimes right. [img]images/icons/wink.gif[/img]
__________________
Posting Guidelines
Reply With Quote
  #7  
Old 09-10-2001, 07:28 PM
BillSoo's Avatar
BillSooHELP WITH MY SERIAL PORT BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default Re: HELP WITH MY SERIAL PORT

I agree with Thinker that it would be rather odd to recieve a lot of data from a printer.... however, I've attached a file which illustrates the basic principles of listening to a port.

It just listens to a port and copies the data to a text box. You will have to modify it to save to a file. Also, it may or may not handle certain characters correctly. Esp. non-ascii characters.



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
  #8  
Old 09-10-2001, 07:36 PM
garytec
Guest
 
Posts: n/a
Default Re: HELP WITH MY SERIAL PORT

ohhh!,,, Sorry my friend, i'm "tonto"...,
data is not really coming from the printer... this data is coming from a dispositive that go to the printer (is a Electronic Balance ,mark Chronos Richardson).
so, i need to capture this data ( the data that is coming to my printer)...
I wanna now if you need the kind of connector, number of pins, velocity (or if it can be selectable) or another thing more.... please let me know... and thanx again...

Gary Sanchez


Reply With Quote
  #9  
Old 09-10-2001, 07:42 PM
BillSoo's Avatar
BillSooHELP WITH MY SERIAL PORT BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default Re: HELP WITH MY SERIAL PORT

If you want to "eavesdrop" on a serial port, you pretty much need to do some hardware mods.

The simplest way would be to split a serial cable so it has a "Y" configuration. Data from the "dispositive?" goes to the printer and is also split so it goes to your computer port as well. Then you just read the data.



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
  #10  
Old 09-10-2001, 07:56 PM
garytec
Guest
 
Posts: n/a
Default Re: HELP WITH MY SERIAL PORT

OK friend, i have this cable. but the program is my problem,...
i know just a little of Visual Basic and i don't how to make this programm to capture data and put in a TXT file (of 10K capacity o somevalue, and capture data 24 hours), i have to do that tomorrow...

Gary.


Reply With Quote
  #11  
Old 09-10-2001, 08:24 PM
ThinkerHELP WITH MY SERIAL PORT Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default Re: HELP WITH MY SERIAL PORT

Ok, I understand a little bit better. However, it still doesn't completely
explain what kind of data you will be expecting. If it is straight
character-based printing, then the capture will be pretty easy. If, on the
other hand, the data is graphics printing (Like standard windows
printing) you will have a very hard time with this.

I think therefore I am... sometimes right. [img]images/icons/wink.gif[/img]
__________________
Posting Guidelines
Reply With Quote
  #12  
Old 09-11-2001, 12:32 AM
BillSoo's Avatar
BillSooHELP WITH MY SERIAL PORT BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default Re: HELP WITH MY SERIAL PORT

Check out the attached program in my post 2 above. That should capture data from a serial port to a TEXTBOX. After it is done, you can simply save the contents of the textbox like:

dim ff as integer
dim s as string

s = text1.text
ff = freefile
open "testdata.txt" for binary as #ff
put #ff,,s
close #ff



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
  #13  
Old 09-11-2001, 12:18 PM
garytec
Guest
 
Posts: n/a
Smile Re: HELP WITH MY SERIAL PORT

Hey.... thanx you very much!!! now i can store serial data in my txt file, but...
i wanna know how to store this data in files of 10 KB ... with differents names... for example ....
data1.txt, data2.txt .... data30004.txt....
or simplly 1.txt, 2.txt..... 445000.txt
please is the last question...help me with the code.

Gary Sanchez.

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
 
HELP WITH MY SERIAL PORT
HELP WITH MY SERIAL PORT
 
-->