Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing COM ports created by PCI serial card

Status
Not open for further replies.

BobTheMad

Programmer
Jun 11, 1999
81
0
0
US
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...
 
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.
 
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.

 
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...
 
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.

 
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.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top