Sending Files Through Modem
I have a question. Let's say to computers are in different rooms and the both have modems. Is it possible to directly hook these to computers up together? Like phone line to one computer and phoneline to the other computer. I want to do it where it is free and it can send strings to eachother. This way since the modem is able to send and receive data i want it where it can be hoocked directly up to another computer and can send and recieve small files. Is this possible?
Re: Sending Files Through Modem
You may like to take a look at this thread http://www.vbforums.com/showthread.php?t=502982
It's a bit long but there's an example of text file transfer between serial ports and an example of sending the contents of a TextBox from one machine to another via the serial port.
Re: Sending Files Through Modem
Quote:
Originally Posted by GDOG34
I have a question. Let's say to computers are in different rooms and the both have modems. Is it possible to directly hook these to computers up together? Like phone line to one computer and phoneline to the other computer. I want to do it where it is free and it can send strings to eachother. This way since the modem is able to send and receive data i want it where it can be hoocked directly up to another computer and can send and recieve small files. Is this possible?
For the actual modems to connect, you would need some sort of phone switching device as well to simulate a phone line, you couldn't just put a phone cord between the two modems.
Re: Sending Files Through Modem
Wait then can i have a computer do that? Simulate a phone line or download a program? Then with that program on the computer i can make a program in VB to send files?
Re: Sending Files Through Modem
I don't believe so, I'm not aware of any program that does it. I have a Panasonic Phone Signal Modulator, it gives me 22 extention lines, I can plug one computer in to line 1 and another in to line 2, then to connect them via modem, I simply tell the Network Connection to dial "#1", or "#2". I got one for $10 bucks, could problaly find one off ebay. Also works great for in house phone to phone calling.
Re: Sending Files Through Modem
Quote:
Originally Posted by wxmancanada
.....you couldn't just put a phone cord between the two modems.
I'm no expert, but I'm not so sure. If one of the Modems had an auto-answer capability it should be possible by using standard "AT" commands to call it and establish communications using good old MSComm. Interesting problem, I think I'll do some research.
Re: Sending Files Through Modem
Wait, when you dial out a modem it sends data strings and when the two computers are connected cant the other computer be in listening mode to get the strings that the computer sent out?
Re: Sending Files Through Modem
I've tried that theory, hadn't much luck.
Re: Sending Files Through Modem
Hi guys. Just a little input here. The basic electrical requirements of the phone line in your home hasn't changed since Bell patented it at the turn of the century. The Modem needs to see a DC loop current (used for voice and modulated data) and a ring signal. It's been a while but I beleive the ring signal is > 80VP @ 50-60Hz. Search the web, as I think you will find many simple examples of setting up a Local (in house) ATT compatable circuit including generating a ring signal. You will probably have spare tel lines in your CAT3 cable which you can use. You only need two conductors and the cables are usualy > two pair.
Re: Sending Files Through Modem
Here's a link to a basic telephone loop. A.G.Bell's circuit (if you can find it) would have looked nearly identical. Where you see the two telephones is were your two modems would be.
May I ask why you want to do this? The serial port is a great interface for PIC's, Stamps, Picaxe's and other microcontrolers and many other control tasks to the outside world. That said, it's archaic to use it for communication between two computers. The happiest day of my computer life was when I said ADIOS to dialup! The system you'r describing is Dialup without the dialing. Absolutley ANY LAN .... (T10/100)- CAT5, Wireless, Tel-Line Networking, you name it, will be running at light speed as compared to using modems! :cool:
http://www.privateline.com/archive/howteleworks.gif
I want to see 56K again like I want a root canal!
Re: Sending Files Through Modem
Ok, Lets say i used a serial cable. Is there a way to have a application send an recieve files through serial. Lets say i want to send text files. The User opens up the program then it shows a textbox where they can right a message then when they hit go it saves it to a file and then it asks where to send the file. and it can show the user that the computer is connected up to. (This way more than one user can receive the file.). And ever so often it can check to see if a new message was sent or file. Kinda like email.
Re: Sending Files Through Modem
Quote:
Originally Posted by GDOG34
Ok, Lets say i used a serial cable. Is there a way to have a application send an recieve files through serial. Lets say i want to send text files. The User opens up the program then it shows a textbox where they can right a message then when they hit go it saves it to a file and then it asks where to send the file. and it can show the user that the computer is connected up to. (This way more than one user can receive the file.). And ever so often it can check to see if a new message was sent or file. Kinda like email.
Gdog, I just spent a heap of time giving you the best response I could to your question, but then I did something stupid, and all that thoughtful typing disappeared right down the crapper! I'll get back to you in the morning, but until then think NETWORKING over a CAT5 (T10/100) LAN. It's pennies per foot and a hell of a lot faster and more efficient than RS232 for what you want to do!
Re: Sending Files Through Modem
? Wait I'm confused. We discussed one way and that way came to a conclusion someone was talking about using a serial port and even you talked about that so i dropped what I was thinking and moved to the theroy you had and your posyt made sense and you then say this:
Quote:
and all that thoughtful typing disappeared right down the crapper!
Using serial is the best way i think and thats what i just set up i made the cord.
Re: Sending Files Through Modem
Not wishing to put words into his mouth, I think that what Chris was saying is that using the Serial Port for inter-computer communications such as File Transfer has been superceded by Networking. It would, perhaps, be more appropriate to connect the two machines together via a LAN cable. (If just two machines then a "Cross-over" cable.) That, of course, requires that both machines have LAN Ports available. You would then, perhaps, use Winsock and TCP/IP to perform the transfers.
The advantage is that you will achieve faster transfer times, the minimum network speed, these days, is 10Mb(its)/Second, most LAN adapters run at higher speeds than that. Also, TCP is a reliable protocol (in other words, simple transmission errors will be corrected automatically for you, where errors can't be corrected TCP will report them).
The downside is that you may have to purchase LAN cards for your machine(s) and configure them to run IP and TCP (not too difficult) and whilst you could make your own, you'll probably have to purchase a suitable Cable. You also have the choice of not having to run cable, and use Wireless Networking (by purchasing the necessary Wireless adapters)
With Serial Port transfer the maximum speed is about 115Kb(its)/second and you have to perform all your own error recovery in your code. Also, and I personally think it's a shame, you see new Computers being sold these days which don't have serial ports integrated into their Motherboards - they have been superceded by USB, which is a different kettle of fish.
Saying all that, it's still quite OK to use Serial Ports for File Transfer, if you're not too interested in 'extra fast' transfers, there's not too much data involved, and the distance between the two machines is not too great (RS232 is restricted to about 50 feet, 150 feet if you use special high quality cables, depending upon the speed at which data is being sent / received)
(All IMHO)
At the end of the day, it's up to you of course. :D I personally, have never used Serial Ports for File Transfer
Re: Sending Files Through Modem
Well, I think Doogle covered much of what I lost with an errant key stroke last night. So, can we get a few questions answered before we proceed?
What are the OS's on the PC's you're using?
Do you have Ethernet jacks on these PC's?
If Ethernet ports exist then you're already set up to use Microsoft Networking. It's been included with every OS since 95, possibly even 3.0, but I'm not sure. Before I had my Ethernet setup I used the 'Direct PC' utility that Windows provided in the communications folder. It was used with a crossover (Nullmodem) cable from one serial port to the other serial port. I do not miss it!
BTW: Even if you don't have Ethernet on your PC's, Ethernet cards are cheap as dirt if you shop for them. Then you can leave your serial ports free to do fun things..... like talking to microcontrolers and other neat stuff!
If it sounds like I'm trying to discourage you from networking through serial ... Uh...Yeah!:rolleyes:
Re: Sending Files Through Modem
1. Both Windows XP. My Computer Uses XP Pro and other uese XP Home
2. Only on 1 of the computers
Yes on the contreary yes you are. No and i do not want to use a network card. Right now i dont want to spend any money. I have the serial cable and i know the downfalls. And i made up my mind to use serial. So can you help me with my problem?
Re: Sending Files Through Modem
Wow... someone choosing to send data between PC's over serial... You do realise, a really horrible basic network card, these days, will cost you around $10. Why you would want to have the computers communicate this way is beyond me..
chem
Re: Sending Files Through Modem
The first step might be to try out the code I refered to in Post #2. It's *very* basic and is an example of a simple transfer of a text file using the Serial Port. It may be somethig that you can build upon if nothing else.
Re: Sending Files Through Modem
Quote:
Originally Posted by Doogle
The first step might be to try out the code I refered to in Post #2. It's *very* basic and is an example of a simple transfer of a text file using the Serial Port. It may be somethig that you can build upon if nothing else.
I followed that topic from begining to end. Doogle did a good job of hanging in there into the wee hours of the morning posting copious amounts of Comm code! Go there and read. Also, XP still has Hyperterminal included. Why re-invent the wheel, Gdog can use that if he wants to text message.
Re: Sending Files Through Modem
It seems i did try that code from the start i had no luck. Becuase i get an error "port already open" or "invailed port number". So i tryed it on a differnet computer and it ran with no problems. Then i put it on a different computer and the rpobles occured. I couldnt start it cup becuase a port already open error. then i looked at the code a changed the port number and it is still having errors. That code will be great if it can autodetect the port it is using becuase not all computers are com1.
Re: Sending Files Through Modem
Try this code and tell me how it works for you. While I'm well aware that using ' On Error Resume Next ' can, and will, mask errors in my code, I'm using it here because I know I'm going to throw errors. The Error numbers are used to generate the ListBox report. The app loops from port 1 through 10 and reports the results in the ListBox. I wrote the code for another Comm question that has been posted here on the forum, and I wasn't going to post this until I worked out the Rem that you see at the top of the Command1.Click Sub. Go ahead and try it anyway. In the interum I will keep working on this until I get it to work the way I want in a Select Case format.
BTW: I have absolutely NO ComPorts (except Com 3, which is used for the internal Modem) on this PC. All my tests for this code were done using three USB to Serial converters pluged into 3 USB ports. When running this code on my PC it returned 4 valid ports, which is what I expected.:wave:
Code:
Option Explicit
Private Sub Command1_Click() 'This sub works but isn't reporting if the port
Dim i As Integer 'was already open.
List1.Clear
Pause 0.05 'add short delay to see list clear
On Error Resume Next
For i = 1 To 10
MSComm1.CommPort = i
MSComm1.PortOpen = True
If MSComm1.PortOpen = True Then List1.AddItem "Port " & i & " Opened successfully"
If Err = 8002 Then List1.AddItem "Port " & i & " does not exist"
Error.Clear
If Err = 8005 Then List1.AddItem "Port " & i & " is already open"
Error.Clear
If Err = 8012 Then List1.AddItem "Port " & i & " Open failed" 'The Device is not open
Error.Clear
MSComm1.PortOpen = False
Next
End Sub
Private Sub Pause(ByVal Delay As Single) 'PauseSub Cred: Mark @ A1VBCODE.COM
Dim X As Single
X = Timer + Delay ' Add a delay to the current time
Do While X > Timer ' and waits for the current time
DoEvents ' to catch up.
Loop ' Pause & Delay can be any name, but
End Sub ' references to them must also be changed.
Re: Sending Files Through Modem
Ok, I changed the code a bit and it seems to be working well. It will now report if any of the scanned ports are in use by another program, or this app itself. If you test the error trap for Error 8005 (Port already open) with the Command3 sub, click it first to open Port 1. When you click Command1 Port 1 will return "Port (1) In use by another program" and close the port as the sub loops. However, if any port is opened by another program it will remain Open until the program that opened it closes it. Here's the modified code: ;)
Code:
Option Explicit
Dim i As Integer
Dim OpenedMsg As String
Dim NoExistMsg As String
Dim InUseMsg As String
Dim FailedMsg As String
Private Sub Form_Load()
OpenedMsg = " Opened successfully!"
NoExistMsg = " Does not exist."
InUseMsg = " Is in use by another program."
FailedMsg = " Failed to open."
End Sub
Private Sub Command1_Click()
List1.Clear
Pause 0.05 'add short delay so user can see list clear
On Error Resume Next
For i = 1 To 10
MSComm1.CommPort = i
MSComm1.PortOpen = True
If Err = 8005 Then
MSComm1.PortOpen = False
List1.AddItem "Port " & i & InUseMsg
End If
If MSComm1.PortOpen = True Then List1.AddItem "Port " & i & OpenedMsg
If Err = 8002 Then List1.AddItem "Port " & i & NoExistMsg
Error.Clear
If Err = 8012 Then List1.AddItem "Port " & i & FailedMsg
Error.Clear
MSComm1.PortOpen = False
Next
End Sub
Private Sub Command2_Click()
MSComm1.CommPort = 1
MSComm1.PortOpen = True
'Err.Raise (vbObjectError + 8012)
End Sub
Private Sub Pause(ByVal Delay As Single) 'Pause Sub Cred: 'Mark' a1vbcode.com
Dim X As Single
X = Timer + Delay ' Add a delay to the current time
Do While X > Timer ' and waits for the current time
DoEvents ' to catch up.
Loop ' Pause & Delay can be any name, but
End Sub ' references to them must also be changed.