Click here to Skip to main content
15,882,017 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: find the current logged on user Pin
parths9-Aug-04 20:26
parths9-Aug-04 20:26 
Questionwhat is usual gamma correction value for generic printer? Pin
baboguru9-Aug-04 19:48
baboguru9-Aug-04 19:48 
GeneralParallel Port Question Pin
zahid_ash9-Aug-04 19:44
zahid_ash9-Aug-04 19:44 
GeneralRe: Parallel Port Question Pin
Antti Keskinen9-Aug-04 21:22
Antti Keskinen9-Aug-04 21:22 
GeneralRe: Parallel Port Question Pin
zahid_ash9-Aug-04 21:33
zahid_ash9-Aug-04 21:33 
GeneralRe: Parallel Port Question Pin
Antti Keskinen10-Aug-04 0:08
Antti Keskinen10-Aug-04 0:08 
GeneralRe: Parallel Port Question Pin
zahid_ash10-Aug-04 0:38
zahid_ash10-Aug-04 0:38 
GeneralRe: Parallel Port Question Pin
Antti Keskinen10-Aug-04 1:23
Antti Keskinen10-Aug-04 1:23 
The pins of a MODERN (at least a Pentium III -grade computer/MB) parellel port are indifferent whether you are reading or writing. You can both read and write to the data port. This is called a bi-directional LPT port.

You can use the data port (0x378) to send data (write values from 0 to 255). The data is represented in binary format, with the D0 being the least significant bit and D7 the most significant.

You can also use the data port to receive data. If you use the D0-D7 pins, you can read from address 0x378. If you input the voltages to pins S3-S6, you use the address 0x379 to read the value. Remember that the input values on S3-S6 range from 0, 8 - 248, because pins S0-S2 are not physically there, although they exist for the computer. This means that if you read from the address 0x379, and only the S3 has voltage, the received integer is 8. If all S3-S6 have voltage, the value is 248. If none have voltage, the value is 0. Note that I am not 100% sure of these values. The easiest way is to physically put a suitable voltage there and see what the function returns.

Remember to use big enough resistors in your connections. The parellel port cannot handle big currents (output or input). It will break, and most likely also damage your motherboard. The maximum current running through a pin should be around 2-3 mA. This "should" be safe, however I cannot guarantee, and will not take responsibility. The best way is to use a TTL optocoupler that will physically disconnect the actual device from the parellel port. In this way, the data is transfered in TTL logic levels, but the currents will never go over the limits.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Parallel Port Question Pin
zahid_ash10-Aug-04 1:59
zahid_ash10-Aug-04 1:59 
GeneralRe: Parallel Port Question Pin
Antti Keskinen10-Aug-04 2:41
Antti Keskinen10-Aug-04 2:41 
GeneralRe: Parallel Port Question Pin
zahid_ash10-Aug-04 2:15
zahid_ash10-Aug-04 2:15 
GeneralRe: Parallel Port Question Pin
kandyelectrical12-Dec-12 22:50
kandyelectrical12-Dec-12 22:50 
QuestionHow to know security context ? Pin
Amarelia9-Aug-04 19:16
Amarelia9-Aug-04 19:16 
GeneralcreateEventObject fails Pin
yourbuddy779-Aug-04 19:05
yourbuddy779-Aug-04 19:05 
GeneralSTATIC Text Color Problem Pin
Anonymous9-Aug-04 19:03
Anonymous9-Aug-04 19:03 
GeneralRe: STATIC Text Color Problem Pin
Johan Rosengren10-Aug-04 0:42
Johan Rosengren10-Aug-04 0:42 
GeneralRe: STATIC Text Color Problem Pin
Johan Rosengren10-Aug-04 1:23
Johan Rosengren10-Aug-04 1:23 
GeneralVisual C++ Standard Edition Pin
zecodela9-Aug-04 16:22
zecodela9-Aug-04 16:22 
GeneralRe: Visual C++ Standard Edition Pin
Antti Keskinen9-Aug-04 20:47
Antti Keskinen9-Aug-04 20:47 
GeneralC++ global const question Pin
Indrawati9-Aug-04 15:34
Indrawati9-Aug-04 15:34 
GeneralRe: C++ global const question Pin
Jeff Bogan9-Aug-04 17:27
Jeff Bogan9-Aug-04 17:27 
GeneralRe: C++ global const question Pin
Anonymous9-Aug-04 18:40
Anonymous9-Aug-04 18:40 
GeneralRe: C++ global const question Pin
Tim Smith10-Aug-04 3:52
Tim Smith10-Aug-04 3:52 
GeneralRe: C++ global const question Pin
Nitron10-Aug-04 5:47
Nitron10-Aug-04 5:47 
GeneralRe: C++ global const question Pin
Jeff Bogan10-Aug-04 5:10
Jeff Bogan10-Aug-04 5:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.