×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

accessing COM ports created by PCI serial card

accessing COM ports created by PCI serial card

accessing COM ports created by PCI serial card

(OP)
I have been given the unenviable task of making one of our legacy (DOS 5.0) systems work with current technology. Specifically, I need to be able to have 4 COM ports on a system. Well 2 of them are ok, since they are hard-wired into the motherboard. The other 2 have to be obtained through a PCI serial card.

The issue I am having is that I have been COMPLETELY unable to programmatically access the Com 3&4 that are created with this PCI card. The ports are there, and I can detect them, but whenever I try and send data to them, it does not work. However, I can ‘echo’ commands to the port through DOS, and the device receives the data just fine. Below I am posting the 2 versions code that I have written to try & access the ports.


‘-=-=- BEGIN CODE SAMPLE #1 -=-=-
DEFINT A-Z
Open$ = "COM1: 1200,E,7,1,BIN,CD0,CS0,DS0,OP0,RS,TB2048,RB2048"
OPEN Open$ FOR RANDOM AS #1
CLOSE #1
‘-=-=- BEGIN CODE SAMPLE #1 -=-=-

This code generates the message “Bad file name in line…”.

‘-=-=- BEGIN CODE SAMPLE #2 -=-=-
DEFINT A-Z
DIM PortAdd
DEF SEG = 0
PortAdd = PEEK(&H404) + 256& * PEEK(&H405)    'For COM3
DEF SEG


Packet$ = CHR$(2) + CHR$(90) | CHR$(3)
FOR x = 1 TO LEN(Packet$)
OUT PortAdd, ASC(MID$(Packet$, x, 1))
NEXT x
‘-=-=- BEGIN CODE SAMPLE #2 -=-=-

With example #2, the data never actually reaches the device. I have also plugged in a packet analyzer in, and I know I am sending the data, but the COM port (3 in this case) never gets it.


Anyone got any ideas?

Thanks in advance

Thought for the day: Beware of Gods who cannot laugh...

RE: accessing COM ports created by PCI serial card

I don't know how to do it with QBasic, but with Visual Basic 4 you can with mscomm.ocx  There is a choice for wich port you want to use.

RE: accessing COM ports created by PCI serial card

Totally unrelated but have you considered using a multiport card such as digi, computone, specialix, or equinox?  With drivers already written and support available.

Ed Fair
 efair@atlnet.com
 
Any advice I give is my best judgement based on my interpretation of the facts you supply.

Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.

RE: accessing COM ports created by PCI serial card

(OP)
I currently am using a multi-port card made by Siig. They provide drivers, but I still cannot access the ports. After talking with their support people, they have told me:

"Our PCI controller are compatible with DOS if you do not need a specify resource settings. PCI devices are setup by driver and will share the NEXT best resources your system have available. So depending on you system and the PCI slot  your resource setting may vary."

... which to me sounds like a cop-out answer, but it is the only one I have been able to squeeze out of them so far.

Thought for the day: Beware of Gods who cannot laugh...

RE: accessing COM ports created by PCI serial card

PCI is like that. I was thinking ISA with the previous post. It has fixed addresses.

Ed Fair
 efair@atlnet.com
 
Any advice I give is my best judgement based on my interpretation of the facts you supply.

Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.

RE: accessing COM ports created by PCI serial card

You might look into the use of a FOSSIL driver. With it, you would use a series of interrupt calls to communicate with the card. The FOSSIL driver would intercept those interrupt calls and do the actual I/O on your program's behalf.

The following link should take you to a site describing what interrupt calls to make to talk to the FOSSIL driver. As for making interrupt calls, let me know if you need help with this, and I'll write up a quick FAQ.

http://www.ctyme.com/intr/alpha-f.htm#FOSSIL

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close