Read from 15-pin port

This is a discussion on Read from 15-pin port within the C Programming forums, part of the General Programming Boards category; Well, in another topic a guy needs to read data from a 15-pin port (a BIF-59...). Is there any library ...

  1. #1
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853

    Read from 15-pin port

    Well, in another topic a guy needs to read data from a 15-pin port (a BIF-59...). Is there any library to do so? He wants it for OS2

  2. #2
    Registered User
    Join Date
    Jun 2008
    Location
    Kolkata
    Posts
    1

    Post Read data from port


  3. #3
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    This is for Visual Basic though. How about for C (or maybe for C++)?

  4. #4
    Registered User
    Join Date
    Jun 2008
    Posts
    20
    Up, I really need help in trying to figure this out

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    http://www.paraport.net/documentation/index.html
    Though you want it for OS2 (which I have just heard of ). I don't know if the above would work

  7. #7
    Registered User
    Join Date
    Jun 2008
    Posts
    20
    I dont think that app will work with os2. argg, stupid os2.


    though the pc's do boot with windows AND os2 at the same time. they run simultaneously . but the machine software is on the os2 side.

  8. #8
    Registered User
    Join Date
    Jun 2008
    Posts
    20
    this is driving me nuts.
    I cant find info on port communication in os2.

    it has to be somewhere

  9. #9
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    Try this http://logix4u.net/Legacy_Ports/Para...from_BIOS.html

    It gives an idea how to find the parallel port addresses then you may want this
    http://logix4u.net/Legacy_Ports/Para...terfacing.html
    If you find the address then try reading from it. If you are not allowed....no clue. If you are then you can do your job.
    Good luck!

  10. #10
    Registered User
    Join Date
    Jun 2008
    Posts
    20
    Ok, so I figured out where to find the address in os2...but nothing was specifically listed for the port I am looking at. I emailed the company to ask if there is any info they could share with me.

    I look a little furthur too.

    and then after that I have to figure out how to read from it...ie: what programming code to use. this is so far beyond my skills so thats why I am having issues. thanks for the help so far.

  11. #11
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    Well I m not an expert. But I think you could do:
    Code:
    #define LPT1 312412412
    
    const char port = LPT1;
    char read = *port;
    And you will take advantage that you can actually assign directly an address to a pointer in C

    I don't know what happens with permission though, if the system permits you to do so. Also, usually ports are initialized, don't know why.

    Also maybe you ll have to read from more than one address.

    So you found a list with addresses but the parallel port wasn't there? No LPT or anything?

  12. #12
    Registered User
    Join Date
    Jun 2008
    Posts
    20
    i found the location that lists everything but I couldnt find anything named for that port. :/

    I just got some information in an email

    As far as I can remember upon bootup OS/2 will declare the BIF card and
    possibly the IRQ address settings (in the initial bootup screens before it
    get's to OS/2).
    IRQ 5 needs to be availible.
    As for permission im assuming it should be ok. Its os2 warp 3 which was out in like 1994 or something. Warp was co-developed by microsoft, and even windows didnt have persmission protocol until nt/xp. So Im pretty sure this thing is old enough to not have to worry about permission.

  13. #13
    Registered User
    Join Date
    Jun 2008
    Posts
    20
    anyone else?

    i havent made any progress and this is taking to long

    Ive got a port sniffer that im gonna run this aft....but nothign for code yet
    Last edited by Euphorica; 07-07-2008 at 09:13 AM.

  14. #14
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Euphorica View Post
    anyone else?

    i havent made any progress and this is taking to long
    OS/2 definitely has IO permissions, and your average application can not read/write IO (or memory mapped IO) ports without a proper driver. The only way to work around this is to have a OS/2 driver for the device you need to access. Whether that driver is part of the OS/2 distribution, part of some third party software or written by the individual asking the question is of course another matter.

    I have never written a driver for OS/2 but I did a long time ago have a DDK (Device Driver Kit) disk for it.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  15. #15
    Registered User
    Join Date
    Jun 2008
    Posts
    20
    well that just sucks.

    what can I do now? This is just a simple timer/counter that i would like to respond to the software commands so its automatic.


    having it respond to i/o of the port is the only way to do it since I dont have access to the source code. I dont even want to write to the port. Only have the little program respond to what the port is doing.

    could I copy the driver from os2? im sure i could get access to that driver. If so what would I do with it? lol sorry. As i have said im a newb and this is way over my head but i am trying.


    Im not aware of any InpOut32.dll type files for os2 (like there is for windows nt+)...though im wondering if it could work anyways?


    edit: according to the IT guy we have full access...???maybe he didnt understand my question?

    found some information on i/o with os/2
    http://www.edm2.com/0307/32-bit-io.html
    Last edited by Euphorica; 07-07-2008 at 10:52 AM.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C# output based on data read by serial port.
    By james557 in forum C# Programming
    Replies: 5
    Last Post: 12-28-2008, 06:32 AM
  2. how to read data from 15 pin connection?
    By Euphorica in forum Networking/Device Communication
    Replies: 0
    Last Post: 06-27-2008, 03:38 PM
  3. serial port - read chars twice
    By matze in forum Linux Programming
    Replies: 1
    Last Post: 12-07-2007, 06:32 AM
  4. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  5. how to make parallel port read data
    By lwong in forum Windows Programming
    Replies: 0
    Last Post: 01-05-2004, 07:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21