Help seting up port talk and qb4.5 for modem comm on Xp?

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
iamdenteddisk
Veteran
Posts: 185
Joined: Mon Jun 30, 2008 4:10 pm

Help seting up port talk and qb4.5 for modem comm on Xp?

Post by iamdenteddisk »

has any one any idea how to setup port talk in an xp machine for qb to access the modem?

does it still require swaping addresses in your basic program like the documentation on petes say's?
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

Find the COM port address that the Modem is on. You can send AT modem commands to most modems through the COM. I don't know how well it works however. A lot depends on the modem type. Things have changed since Win 98.

You don't need to swap COM ports if you deal directly with the COM registers by using INP and OUT instead of OPEN COM. OPEN only works for COM 1 or 2 in Qbasic.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
iamdenteddisk
Veteran
Posts: 185
Joined: Mon Jun 30, 2008 4:10 pm

Post by iamdenteddisk »

thanks burger... I will try that post any outcome i get..
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

Try my Demo program here: http://www.qbasicstation.com/index.php? ... &filecat=3

Look for Q-Basics.zip in the list and download it. Unzip to your Qbasic Folder. Uses QB4.5 which is available in Member Files Functions page there also.

Go to Chapter 11 and it will give you a lot of information on any type of Port. There is a routine for trading COM ports there if you want to use OPEN. It works! There is also a way to open a COM with OUT and INP code. Also there are a list of Modem AT commands.

You still need PortTalk for XP. Once a port is accessable, it will be for BAS or EXE files until a reboot.

DON'T forget to swap the ports back at end of program!

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
iamdenteddisk
Veteran
Posts: 185
Joined: Mon Jun 30, 2008 4:10 pm

TY

Post by iamdenteddisk »

thanks!! the info is there nice work too!!
iamdenteddisk
Veteran
Posts: 185
Joined: Mon Jun 30, 2008 4:10 pm

thanks agian

Post by iamdenteddisk »

after going through the prog I wrote down the code segment, now if I understand this correctly the first time through the segment the code swaps addresses for both ports so 1 is 3 and 3 is 1 and if at the end of my program I place the segment a second time then it resets the ports to their original value.

now should I set this up so "if done or on error to reset the ports" to prevent ending up with crash in case of an error in a different part of code or droped carrier by making the second pass through the segment?
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

The code for swapping has two sections. Just use the part you need to swap. The variables will hold the previous settings so that you can reset them later. You do NOT need to swap both even and odd port numbers! Just the one you need.

The reason you have to swap them as even or odd is because each use the same IRQ (interrupt). COM 1 and COM 3 use the same IRQ set for the computer. You cannot swap 2 and 3!

All of the swap code can be run before or after using PortTalk. Just use PortTalk for the base address of the COM you are going to use. So for COM 3 after a swap, use the COM 1 's Hex base address.

Yes you could just use the code again but you already have the proper settings in the variables anyhow.

If you have code errors after a swap, just don't try to swap them again until your code is fixed! You will soon be lost as to which COM is which if you RERUN the program. A reboot should resolve the dilemma!

Ted
iamdenteddisk
Veteran
Posts: 185
Joined: Mon Jun 30, 2008 4:10 pm

super!

Post by iamdenteddisk »

this is just Grand!.. While I was waiting for the reply I got it all up and running just the way I was asking, it works beautifully...

funny thing is I had invision'd it just this way but lacked the confidence to just poke them in there without the second oppinion thanks!
Post Reply