Sharing Resources via Serial and Parallel Ports
The best way to communicate between two computers is, of course, to set up a local area network. If there is no network established and you want to carry out online communication, and the distance is not too far (for example, not more than 20 meters), you can consider directly connecting the two machines through the parallel port or RS-232 serial port of the computer to realize communication, data and file transfer, and sharing of software and hardware resources. Using port connection for data transfer between two computers does not require a network card, a modem, or a floppy disk as a medium. It is a simple and easy method for communication and data transfer. What is especially commendable is that it can realize the sharing of software and hardware resources between the two computers, such as sharing hard disks, CD-ROM drives, and printers.
To carry out point-to-point communication between two microcomputers, hardware is needed to connect the parallel port or serial port with a connection cable, and then it can be realized with the support of communication software. This article comprehensively introduces the implementation technology of point-to-point communication without a network card between two microcomputers from three aspects: connection method of signal lines, production of connection cables, and communication software.
I. Connection Method of Signal Lines
Microcomputers usually have one parallel port and two standard RS-232 serial ports. We can choose any one of these ports for communication between the two machines. If possible, parallel port communication should be used as much as possible because the transmission rate of the parallel port is much higher than that of the serial port.
Serial port 1 (COM1) is mostly 9-pin, while serial port 2 (COM2) and the parallel port are 25-pin. The functions of the pins of each port are different, and the connection methods are also different.
1. Serial Port Communication
Only three wires need to be connected for communication between serial ports, namely the receiving and transmitting data lines and the information ground wire. When connecting, for one machine, it is transmitting data, and for the other machine, it is receiving data, so the receiving and transmitting data lines need to be cross-connected. There are the following three specific connection methods for communication between serial ports.
(1) 9-pin to 9-pin serial port
A machine B machine
2●←→●3
3●←→●2
5●←→●5
(2) 9-pin (A machine) to 25-pin (B machine) serial port
A machine B machine
2●←→●3
3●←→●2
5●←→●7
(3) 25-pin serial port to 25-pin serial port
A machine B machine
2●←→●3
3●←→●2
7●←→●7
2. Parallel Port Communication
There are only 5 input lines such as pins 10, 11, 12, 13, 15 on the parallel port. Therefore, when carrying out double-machine connection communication, only 5 output lines can be used. Therefore, the connection method between the parallel ports of the two machines is as follows.
The numbers listed above are the pin numbers of the connectors, and these pin numbers are usually marked on the serial and parallel ports. Since the parallel port uses 5 pairs of lines for data transmission, the data transmission speed is much faster than that of serial port communication. Therefore, the parallel port should be used as much as possible, especially when a large amount of data needs to be transmitted between the two machines.
II. Production of Connection Cables
The connection cables between the two machines can be purchased at computer accessory stores. When purchasing, it is necessary to clarify whether the connectors on both sides are pins or holes. Usually, a 25-pin to 25-pin connector is used for connecting two parallel ports, and a hole-to-hole connector is used for connecting two serial ports.
Connection cables can also be made by oneself. No matter whether the sockets on the computer are pins or holes, it is relatively difficult to directly connect with wires, resulting in poor contact at the interface. Here, two methods are recommended: making a serial port connection cable using the connection cable of a waste mouse, and making a parallel port connection cable using the waste printer cable.
1. Production of 9-pin Serial Port Connection Cable
The mouse only uses 4 of the 9 pins of the serial port, namely pins 2, 3, 5, and 7. When using serial port communication, only pins 2, 3, and 5 need to be connected. The mouse is a device that is easy to damage, and the main damage part is the mouse head. Its connection cable and connector generally do not break. Cut off the connection cables of two scrapped mice, and it can be found that there are 4 wires under the protective sheath, with colors brown, yellow, green, and white, corresponding to pins 2, 3, 5, and 7 respectively. According to the connection method introduced earlier, cross-connect the green wires in the two mouse connection cables, and cross-connect the brown and yellow wires (that is, the brown wire on the first side is connected to the yellow wire on the second side, and the yellow wire on the first side is connected to the brown wire on the second side), and the white wire is not used. After the wires are connected, tape the interface to make a 9-hole to 9-hole serial port connection cable. Using the waste mouse connection cable to make the serial port connection cable is convenient, practical, time-saving, and economical, and it is a good method of waste utilization.
2. Production of Parallel Port Connection Cable
It is also convenient to make a parallel port connection cable using a printer cable. First, disassemble both ends of the cable, and solder down all the wires at the end connected to the printer; then, according to the pin numbers and wire colors at the other end of the cable, solder the corresponding colored wires to the corresponding pins of a 25-pin D-type plug according to the parallel port connection method introduced earlier; finally, solder the ground wire connecting the chassis to the D-type plug. In this way, a 25-pin parallel port to parallel port connection cable is made.
3. Production of 25-pin to 25-pin Serial Port Connection Cable
To produce a 25-pin to 25-pin serial port connection cable, two 25-hole plugs are needed, and a waste mouse connection cable is also needed. According to the wire colors and the connection method introduced earlier, solder the wires at both ends to the corresponding pins.
III. Communication Software
After inserting both ends of the connection cable into the corresponding serial ports of the two machines, data communication cannot be carried out immediately, and support from communication software is also required. There are many software that can realize direct communication between two machines, and the following are commonly used ones, which can be selected according to the actual situation.
1. Direct Cable Connection of Windows 95
The "Direct Cable Connection" function of Windows 95 allows using a cable to connect the parallel port or serial port of two machines to realize online communication. The process of establishing the connection and realizing communication is as follows.
(1) Install Direct Cable Connection on the server
① In the Windows 95 desktop environment, through "My Computer" → "Control Panel" → "Network", select "Dial-up Network Adapter", and in the "Basic Network Logon Type (L)" window, select "Microsoft Network Client".
② Through "My Computer" → "Control Panel" → "Add/Remove Programs" → "Install Windows" → "Communication" → "Direct Cable Connection", install the "Direct Cable Connection" program.
③ Through "My Computer" → "Control Panel" → "Network" → "File and Print Sharing", determine the sharing permissions. There are two options: "Can provide others with access to my files" and "Can let others print to my printer".
④ Through "My Computer", right-click any drive letter in this window, select "Sharing", that is, enter the sharing level setting window. In this window, the sharing level and password can be set. If other drives are to be shared, right-click other drive letters in the "My Computer" window and set the sharing level and password. The same method can be used to set shared folders.
⑤ Through "Start" → "Programs" → "Accessories" → "Direct Cable Connection", run the Direct Cable Connection program, set it as "Host", and select COM1 as the connection port.
In this way, a server providing shared resources is set up. In the future, when connecting, if no modification is made, just run the "Direct Cable Connection" program. If the connection port needs to be changed, the server is changed to a client, or the shared resources are modified, the corresponding settings need to be modified.
(2) Install Direct Cable Connection on the client
The method of installing the Direct Cable Connection program on the client is the same as that on the server. After the Direct Cable Connection program is installed on the client, run it, set it as "Client", and select COM1 as the connection port. In the future, just run the Direct Cable Connection program directly, and no more settings are needed unless the settings need to be modified.
(3) Advantages and disadvantages
By running the Direct Cable Connection program on the server and the client respectively, the connection between the server and the client can be established. If there is a password, the password verification will be carried out during the connection. After the connection is established, the client can access the shared resources of the server through "Network Neighborhood" on the Windows 95 desktop.
The main advantages of using the Direct Cable Connection program of Windows 95 to connect two microcomputers and realize communication are: ① After the connection is established, the client can use the shared resources provided by the server, and the client and the server can run independently; ② If the connected server has been on the local area network, the client can also access all online resources through the server; ③ All resources on the server can be shared, such as CD-ROM drives, network drives, etc.
The only shortcoming of using the Direct Cable Connection program of Windows 95 to connect two microcomputers for communication is that the requirements for the machines are relatively high, because both the client and the server need to install Windows 95/98 for connection, and some low-end machines such as those below 386 cannot install and run Windows 95/98.
2. DRIVEMAP of PCTools 9.0
PCTools 9.0 provides a relatively practical and convenient double-machine online communication software DRIVEMAP, which can connect two computers through a serial port or a parallel port, and use an empty drive letter of the local machine to map a physical drive of another machine. We call the machine that uses a drive letter to map a certain drive of another machine the server, and the machine whose drive is mapped the client. The method of carrying out online communication through DRIVEMAP is as follows.
(1) First, run DRIVEMAP on the client.
At the system prompt of the client, type DRIVEMAP (assuming that the file is in the current directory or the备查 directory). If it is the first time to run DRIVEMAP, the installation window of DRIVEMAP will appear, and it will require entering the user name and password. The user name must be entered to identify different microcomputers connected. The password item is optional, and just press the Enter key if no password is wanted. Then select Next to enter the next-level connection device selection menu, select the COM1 serial port. Then select OK to enter the device redirection selection menu. If it is not the first time to run DRIVEMAP, directly enter the device redirection selection menu. Press x or Esc key to exit the DRIVEMAP installation, and the connection preparation work of the client is done.
(2) Run DRIVEMAP on the server, and the screen display and operation are the same as the client installing DRIVEMAP. In the listed all used drives of the local machine and the unused but available drive letters, select a drive letter for mapping. If there is no available empty drive letter in the system, the "LASTDRIVER=" statement in the CONFIG.SYS file needs to be modified to make there be an available empty drive letter in the system. Move the DRIVEMAP operation bar to the empty drive letter mark (assuming it is F:), press Enter. Select the connection port COM1 for online use and press Enter, then determine which drive of the other machine is connected with the local F drive letter, select and press the O key to return to the previous window, then press the Esc (or x) key to exit the DRIVEMAP interface. After that, the two machines can communicate. Moreover, the two machines can operate independently without affecting each other.
(3) Advantages and disadvantages
Using DRIVEMAP in PCTools 9.0 as the communication software between the two machines has many outstanding advantages: ① The server uses a drive of the client (including the CD-ROM drive) as its own drive. If the environment of the server (memory size, BIOS version, graphics card and monitor, etc.) permits, all executable files on the mapped drive can run; ② After the two machines establish the connection, they can run independently; ③ CD-ROM can be mapped.
The shortcoming of DRIVEMAP is that it can only map one drive of the client. If another drive of the client is to be mapped, the mapped drive must be exited first, and then the drive to be mapped is reselected. In addition, if the connected port needs to be changed, after the change is made, the system must be restarted to take effect.
3. Link of Norton Commander
The Link of Norton Commander also provides the function of online communication, and the specific operation is as follows.
(1) Run NC on the slave machine
At the system prompt, run NC, press F9 key to enter the NC main menu, select the Link item in Left or Right, select COM1, then select Slave, move the cursor to Link and press Enter.
(2) Run NC on the host machine
After running NC on the host machine, also press F9 key to enter the NC main menu, select the Link item in Left or Right, select COM1, then select Master, move the cursor to Link and press Enter. In this way, the two machines are connected, and the data on each drive of the slave machine can be accessed through the left (or right) panel on the host machine.
(3) Advantages and disadvantages
Using NC as the communication software between the two machines, the advantage is that the data on each drive of the slave machine can be accessed, including the CD-ROM. But there are many shortcomings: ① During the communication, the slave machine cannot do any operation; ② On the host machine, only the operation commands provided on the NC panel can be used to operate the data in the mapped drive of the slave machine, and the function is very limited; ③ The executable files on the mapped disk cannot run, and the text files on the mapped disk cannot be edited.
4. INTERLNK Software of DOS
DOS versions above 6.0 provide a program for realizing resource sharing between computers through the parallel port or serial port of the computer, which is INTERLNK and INTERSVR. The former runs on the client, and the latter runs on the server. Whether on the client or the server, the command line must be added to the CONFIG.SYS file: DEVICE=C:\DOS\INTERLNK.EXE. The steps for the client and the server to establish the connection are as follows.
(1) At the system prompt of the machine used as the server, type the INTERSVR command.
(2) Under the condition that the server runs INTERSVR, at the system prompt of the machine used as the client, type the INTERLNK command, and the screen displays the mapping relationship between the empty drive letter of the local machine (client) and the actual drive of the other machine (server). After that, the actual drive of the server can be operated with the empty drive letter of the client.
(3) Advantages and disadvantages
Using the INTERLNK software of DOS to connect and communicate between the two machines, the outstanding advantage is that multiple drive letters can be used on the client to map multiple drives on the server, and the connection port does not need to be set, and INTERLNK will automatically identify the connected port. The shortcomings are: ① During the online period, the server cannot do any other work; ② Network drives and CD-ROM cannot be mapped.