Page 1 of 1

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

Posted: Tue Dec 30, 2008 7:31 pm
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?

Posted: Tue Dec 30, 2008 10:31 pm
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

Posted: Tue Dec 30, 2008 10:37 pm
by iamdenteddisk
thanks burger... I will try that post any outcome i get..

Posted: Wed Dec 31, 2008 2:47 am
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

TY

Posted: Wed Dec 31, 2008 4:39 am
by iamdenteddisk
thanks!! the info is there nice work too!!

thanks agian

Posted: Wed Dec 31, 2008 4:16 pm
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?

Posted: Wed Dec 31, 2008 5:07 pm
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

super!

Posted: Wed Dec 31, 2008 5:43 pm
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!