Board index » delphi » Need help with getting data from parallel port

Need help with getting data from parallel port

Greetings to all programmers

Nobody has been able to reply to my message (see below). Could somebody
please help, as I need this info desperately.

You can contact me at rstopfo...@wam.co.za

I will appreciate it.

Thanks in advanced!

Riaan
Riaan Stopforth
E-mail: rstopfo...@wam.co.za
Web Site: www.riaan.50megs.com

Quote
----- Original Message -----
From: R. Stopforth <rstopfo...@wam.co.za>
Newsgroups: comp.lang.pascal.borland
Sent: Sunday, September 10, 2000 7:12 PM
Subject: Need great help with getting data from parallel port!

> Greetings to all programmers

> I have to write a program that will need to be compatable to the info I am
> giving below. Please give me an example of how to get the information to
the
> screen at least.
> ***
> I have a weather station that allows one to connect to a computer through
> the paralle port. The information is below:

> PIN        FUNCTION

> 1.            Digit Select Code D.
> 2.            Digit Select Code C.
> 3.            Digit Select Code B.
> 4.            Digit Select Code A.
> 5.            Segment d.p (decimal point)
> 6.            Segment a.
> 7.            Segment b.
> 8.            Segment c.
> 9.            Segment d.
> 10.            Segment e.
> 11.            Segment f.
> 12.            Segment g.
> 13.            Wind direction select code A.
> 14.            Wind direction select code B.
> 15.            Wind direction select code C.
> 16.            Wind direction select code D.
> 17.            N.C (No connection)
> 18.            Front Panel switch bus.
> 19.            Rear Panel switch bus.
> 20.            Digit strobe
> 21.            N.C.
> 22.            N.C.
> 23.            N.C.
> 24.            N.C.
> 25.            GND. (Ground)

> Here is the information on the "digit select codes":

> DCBA    Display DIGIT

> 0001    Temperature 10's digit.
> 0010    Barometric pressure 10's digit.
> 0011    Barometric pressure 1/10's digit.
> 0100    Wind speed 10's digit.
> 0101    Time 10's Hours.
> 0110    Time 10's minutes.
> 0111    Time 10's seconds.
> 1000    Temperature sign & overflow digit
> 1001    Temperature 1's digit.
> 1010    Barometric pressure 1's digit
> 1011    Barometric pressure 1/100's digit
> 1100    Wind Speed 1's digit.
> 1101    Time 1's Hours.
> 1110    Time 1's Minutes.
> 1111    Time 1's Seconds.

> Here is the information of the "Wind direction select Codes":

> DCBA
> 0000    N
> 0001    NNW
> 0010    WNW
> 0011    NW
> 0100    SSW
> 0101    SW
> 0110    W
> 0111    WSW
> 1000    NNE
> 1001    NE
> 1010    E
> 1011    ENE
> 1100    S
> 1101    SSE
> 1110    ESE
> 1111    SE

> Now, I would like to write a program that will receive the information and
> then store it in an array or memory as a variable. I have to use this
> information to be able to do formulas. I would like to calculate other
> weather information and predictions. This I don't have yet, but hopefully
> will get them soon.

> I need help with commands and procedures to be able to get this
information
> from the weather station to memory, so that I can then use the data to do
> the calculations.

> Could you please as previously asked, give me an example to get the data
so
> that it is usable to be used in IF etc. commands.

> You can contact me at rstopfo...@wam.co.za

> I will really appreciate it.

> Thanks in advanced.

> Riaan
> --
> Riaan Stopforth
> E-mail: rstopfo...@wam.co.za
> Web Site: www.riaan.50megs.com

--
Riaan Stopforth
E-mail: rstopfo...@wam.co.za
Web Site: www.riaan.50megs.com

 

Re:Need help with getting data from parallel port


JRS:  In article <8q331c$jo...@ctb-nnrp2.saix.net> of Sun, 17 Sep 2000
20:29:26 seen in news:comp.lang.pascal.borland, R. Stopforth

Quote
<rstopfo...@wam.co.za> wrote:

>Nobody has been able to reply to my message (see below). Could somebody
>please help, as I need this info desperately.

>You can contact me at rstopfo...@wam.co.za

Message explaining the use of newsgroups has been sent.

Quote
>> I have to write a program that will need to be compatable to the info I am
>> giving below. Please give me an example of how to get the information to
>the
>> screen at least.
>> ***
>> I have a weather station that allows one to connect to a computer through
>> the paralle port. The information is below:
>> ... ...
>> Now, I would like to write a program that will receive the information and
>> then store it in an array or memory as a variable. I have to use this
>> information to be able to do formulas. I would like to calculate other
>> weather information and predictions. This I don't have yet, but hopefully
>> will get them soon.

>> I need help with commands and procedures to be able to get this
>information
>> from the weather station to memory, so that I can then use the data to do
>> the calculations.

>> Could you please as previously asked, give me an example to get the data
>so
>> that it is usable to be used in IF etc. commands.

There is more work required to answer this than it is reasonable to ask.
Your organisation needs to employ someone with either some hardware
programming experience or substantial general programming experience,
unless you are lucky enough to find someone who has done something very
similar before.

To decode the 7-segment, you can either take the 8 bits as a byte and do
direct lookup in a pre-filled but largely empty array [0..255] of char,
or, as you have seven digits and a point, you can use an array
['0'..'9'] or [0..9] of byte and seek the pattern within it.  Actually,
Pred(Pos(Pattern, St)) will do, where St is preset of the form #123#055
... .

ISTM that further information will be needed, and the worker will need
access to the instrument manual and to the device itself.

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
 Web <URL: http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
 Proper 4-line sig. separator is as above, a line exactly "-- " (SonOfRFC1036)
 Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)

Re:Need help with getting data from parallel port


Quote
R. Stopforth <rstopfo...@wam.co.za> wrote...
> Greetings to all programmers

> I have to write a program that will need to be compatable to the
> info I am giving below. Please give me an example of how to get
> the information to the screen at least.
> ***
> I have a weather station that allows one to connect to a computer
> through the paralle port. The information is below:

I have added the equivalent signal names and directions for the
standard parallel port...

Quote
> PIN   FUNCTION                        DIR   SIGNAL

> 1.    Digit Select Code D.            OUT   STROBE
> 2.    Digit Select Code C.            OUT   D0
> 3.    Digit Select Code B.            OUT   D1
> 4.    Digit Select Code A.            OUT   D2
> 5.    Segment d.p (decimal point)     OUT   D3
> 6.    Segment a.                      OUT   D4
> 7.    Segment b.                      OUT   D5
> 8.    Segment c.                      OUT   D6
> 9.    Segment d.                      OUT   D7
> 10.   Segment e.                      IN    ACK
> 11.   Segment f.                      IN    BUSY
> 12.   Segment g.                      IN    PAPER
> 13.   Wind direction select code A.   OUT   SELECT
> 14.   Wind direction select code B.   OUT   AUTO
> 15.   Wind direction select code C.   IN    ERROR
> 16.   Wind direction select code D.   OUT   INIT
> 17.   N.C (No connection)             IN    SELECT
> 18.   Front Panel switch bus.         -     GROUND
> 19.   Rear Panel switch bus.          -     GROUND
> 20.   Digit strobe                    -     GROUND
> 21.   N.C.                            -     GROUND
> 22.   N.C.                            -     GROUND
> 23.   N.C.                            -     GROUND
> 24.   N.C.                            -     GROUND
> 25.   GND. (Ground)                   -     GROUND

You'll notice these don't quite match what your signals seem to
indicate so I can only assume your port must be one of the fancy
bi-directional types I believe are around and whose details I
do not have available.

Nevertheless, assuming you have valid inputs and outputs set-up,
I would assume you drive the interface as follows:

1. Setup the digit you want to read on Digit Select lines A..D
2. Set the Digit Strobe LOW (or maybe HIGH)
3. Read the state of the display segments a..g & dp
4. Set the Digit Strobe HIGH again (or LOW)
5. Translate the seven-segment code to decimal (these inputs
   will typically be active LOW)
6. Add the digit to the corresponding value
7. Repeat the above for all digits

I would assume that the wind direction lines A..D are always
available and would not need to be strobed.

The Decimal Point is probably fixed and will therefore not
need interpreting.

Until you know exactly where the ports and signals are to be
found, I can't help you much further.

Good Luck.
Lester Hanger

Other Threads