12.07.2015 Views

softalk-pc-1982-12-reduced

softalk-pc-1982-12-reduced

softalk-pc-1982-12-reduced

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(start) 1000001 (stop) (stop)(start) 1000010 (stop) (stop)(start) 1000011 (stop) (stop)· which, of course, is much simpler to understand and decode. Insuch a situation, we would have one start bit, seven data bits, andtwo stop bits. Essentially, ten bits would be transmitted for eachcharacter of information.The other problem we run into is differentiating between signalsand noise. In many cases it is extremely difficult to make out voiceinformation over the telephone lines. Computers face a similarproblem in identifying ones, zeros, and no information at all. Consequentlymany errors can occur, even in the ~implesttransmission.To guard against these errors, a scheme called parity wasintroduced. ·The Extra Bit. The parity scheme works very simply-and oftenquite elegantly. The transmitting device counts the number of onesbeing sent for each character. An additional bit is then tacked on toeach character. The additional bit is either a one or a zero, dependingon whether the totid count of ones is odd or even. This eliminatesthe worst type of transmission error, in which a single bit in acharacter is not received correctly. Such a simple error, since it isn'tcatastrophic, is very difficult to detect. However, when ~uch anerror occurs, the entire sense of the information being transmitted,particularly if the information is numeric, can be modified.Three types of parity are used. Even parity adds another bit toeach character in such a manner that the total number of ones isalways even. Odd parity does the opposite; it ensures that each. character contains an odd number of ones. If the receiving devicedetects a character that does not conform to this rule (whicheverrule is in effect), it can signal the controlling software; the latterthen requests that the transmitting device retransmit the offendingcharacter until it gets it right. No parity means that the upper bitwhichis always transmitted first-is always set to either a one or azero and is therefore meaningless and to be ignored at thereceiving end.The last of the strange terms used in this context of mode commandis baucj. Baud is simply a numeric indication of the speed atwhich characters are transmitted. For example, the term 300 baudmeans that three hundred total bits are transmitted every second.This usually can be translated roughly into a number of charactersper second by following a simple rule of thumb. The most popularmethod of sending information between two devices is to use onestart bit, one stop bit, one parity bit, and seven data bits-for a totalof ten bits per character. Therefore, a transmission rate of 300 baudusually translates to thirty characters per second. ·Dual Bauds. When you are entering the baud rate parameter inthis version of the mode command it is necessary only to enter thefirst two characters. For example, if you are setting up for 300 baud,simply enter 30. For 9 ,600 baud, enter 96. The baud rates that modewill accept are no, 150, 300, 600, 1,200, 2,400, 4,800, or 9,600.In this context the mode command is used to configure a general-purposeserial (asynchronous) interface to a specific piece ofperipheral hardware. In general, the add-on equipment will be welldocumented and will have a table explaining how these parametersare to be set. The last parameter, however, the P, is used to indicatethat the peripheral equipment attached to the named serial port isactually a serial printer.When this parameter has been specified, the <strong>pc</strong> will outpu.tinformation in a special mode. This mode takes care of what arecalled timeout errors. Timeout errors arise when a device does notanswer a call within a specified time. The purpose of this type oferror is to prevent the computer from hanging if a peripheral dies inthe middle of an operation. That is, if a piece of attached equipmentfails to perform, then the computer will wait for only a prespecifiedamount of time before it gives up and goes back into operation.Aborting Aborts. In the case of a printer, there are times when24you won't want the computer to return to normal operation whenthe printer has been shut down. For example, if you are using aletter-quality printer and are manually changing sheets of paper betweenpages, you will not be too happy if the computer aborts theprinting operation each time you try to make a change. Specifying aP as the final parameter in this version of the mode commandremedies this situation.However, if you ever find yourself in a situation where you donot want the computer to wait for you-for example, when theprinter really does break down-simply press the control-break keycombination, and normal operation will resume.The fourth and final application of the mode command brings usto a point where we need to discuss a feature of DOS that sets itapart from other operating systems of its genre. This feature iscalled dev ice independent input/ output. Without getting too technical,the purpose of this feature is primarily to allow the redirectionof input and output streams.To date, we have seen one interesting example of this feature inthe method by which we've created batch files on the fly-by usingtheCOPY CON: MYFILE.BATcommand. What this command accomplished was the redirectionof character stream required for the copy command froma disk file to the keyboard-with the result that copy actually treatedthe characters typed at the keyboard as though they were a disk file.In a similar fashion, the character stream output that is ~ormallydirected to a parallel line printer, such as the IBM 80 CPS Dot­Matrix Printer, can be redirected to a serial letter-quality printer attachedto an asynchronous communications interface card. You'daccomplish this by means of the command ·MODE LPT#:=COMnwhere# is the number of the line printer (either 1, 2, or 3) and n isthe serial port number (either 1 or 2 for the IBM asynch card). Thiscommand initializes the letter-quality printer as the primary outputdevice. To redirect the output back to the parallel printer, you'dissue the commandMODE LPTI :80,6- the same command we saw earlier.That pretty much covers the function of the mode command.Since it is such an obscure command, much detail was eliminatedfrom this discussion. This was done deliberately for two reasons.First, many of the idiosyncrasies of DOS should now be familiar toyou, and as we have seen before, rules that apply to one DOS commandcan usually be applied generally. Second, mode is not the typeof command that should be part of the everyday operation ofyour <strong>pc</strong>.In fact, the mode command should really only be used when youwant to reconfigure your system. This should be necessary onlywhenever the system's physical configuration changes-wheneveryou install a new printer, or if you add a modem to your system, forexample. By experimenting and reading the manufacturer's documentationyou should be able to determine which version of themode command, if any, is required to reconfigure your system.You Batcha! If you determine that you do indeed need to usemode, you should build it into a batch file so you can invoke it withvery little fuss. This eliminates the need for long, involved keystrokesequences every time you turn your system on. If it is a permanentalteration that you will need to have in effect all the time,then you should take advantage of DOS's Autoexec.bat capabilities.Thankfully, that about does it for this month. As you can see,the mode command is a bit more complex than its simple nameimplies. Since this is the Christmas season, though, many peoplewill be adding new peripheral equipment to their systems. Let'shope this month's article will help in putting it all together andmaking it work. .Happy holidays!.A.softolk

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!