COM port control - Need help!
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
COM port control - Need help!
Hello! It's been a while since I've been on...
Anyway, I need help using the COM ports. I am testing using QBasic, but I usually use PDS. I need help on sending values from a COM port to another computer. It's a basic program, but I can't figure out how to send out to a COM port. Any and all help would be appreciated. Thanks.
PATZ
Patz QuickBasic Creations
P.S. - The program sends ASC values from a COM port and another computer recieves them and shows the character on the screen. MY IDEA!!! PATENTED!!!
Anyway, I need help using the COM ports. I am testing using QBasic, but I usually use PDS. I need help on sending values from a COM port to another computer. It's a basic program, but I can't figure out how to send out to a COM port. Any and all help would be appreciated. Thanks.
PATZ
Patz QuickBasic Creations
P.S. - The program sends ASC values from a COM port and another computer recieves them and shows the character on the screen. MY IDEA!!! PATENTED!!!
-
- Veteran
- Posts: 703
- Joined: Sun Nov 14, 2004 7:36 am
- Contact:
Hi there,
You can open the com port much like you open a file using the OPEN statement. The help file in the PDS or any QB should detail it quite nicely for you . just see about the OPEN statement.
Hope this helps.
You can open the com port much like you open a file using the OPEN statement. The help file in the PDS or any QB should detail it quite nicely for you . just see about the OPEN statement.
Hope this helps.
When God created light, so too was born, the first Shadow!
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
woah... fast reply...
Anyway, I'm in the middle of a move, and my computer with PDS is currently packed. That's why I'm using QBasic right now. (I don't usually mess with libraries - I have Future 3 for PDS) Is it possible to do this in QBasic? I would like to get it running as soon as possible.
Also, is there amy sort of program that can tell what your COM port codes are?
Anyway, I'm in the middle of a move, and my computer with PDS is currently packed. That's why I'm using QBasic right now. (I don't usually mess with libraries - I have Future 3 for PDS) Is it possible to do this in QBasic? I would like to get it running as soon as possible.
Also, is there amy sort of program that can tell what your COM port codes are?
-
- Veteran
- Posts: 703
- Joined: Sun Nov 14, 2004 7:36 am
- Contact:
Yup QBasic should do it just as good as PDS.
As for the com port codes? what do you mean, the physical address? Or the kind of code you can send?
If you go to your BIOS settings, com ports should be in there somewhere.
Typically com1 is $03f8 but you should only need to open "COM1:" not the address itself.
As for the com port codes? what do you mean, the physical address? Or the kind of code you can send?
If you go to your BIOS settings, com ports should be in there somewhere.
Typically com1 is $03f8 but you should only need to open "COM1:" not the address itself.
When God created light, so too was born, the first Shadow!
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
The example in QBasic reads:
OUT port%, data%
- port% A number in the range 0 65535 that identifies the port
- data% A numeric expression to send to the port
Example:
x% = INP(&H3FC) <These confuse me
OUT &H3FC, (x% XOR 1)
So... I know what to do for the data% and what for the recieving side (COM trapping), but I can't send. Maybe PDS would work better for this.
And, to me, the OPEN COM statement makes no sense...
P.S. MystikShadows, ASCII-WORLD rocks! I just sent a contribution. I hope it becomes one of the great sites. Good Luck!
OUT port%, data%
- port% A number in the range 0 65535 that identifies the port
- data% A numeric expression to send to the port
Example:
x% = INP(&H3FC) <These confuse me
OUT &H3FC, (x% XOR 1)
So... I know what to do for the data% and what for the recieving side (COM trapping), but I can't send. Maybe PDS would work better for this.
And, to me, the OPEN COM statement makes no sense...
P.S. MystikShadows, ASCII-WORLD rocks! I just sent a contribution. I hope it becomes one of the great sites. Good Luck!
-
- Veteran
- Posts: 703
- Joined: Sun Nov 14, 2004 7:36 am
- Contact:
Excellent .....I see a few in there, what's the file name so I can sort it out and put it in it's rightful ASCII world section?
When God created light, so too was born, the first Shadow!
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
-
- Newbie
- Posts: 5
- Joined: Wed Apr 20, 2005 6:54 pm
Usually the COM ports are accessed as files, with OPEN, PRINT # and INPUT #. Why are you doing it the hard way?
Comm ports are the same in QB and in PDS
This should help http://faq.qbasicnews.com/?blast=SerialComms
Comm ports are the same in QB and in PDS
This should help http://faq.qbasicnews.com/?blast=SerialComms
Yes, I remember when you gave that to me a while ago. What's basically throwing me off is the damn protocol.Antoni wrote:Usually the COM ports are accessed as files, with OPEN, PRINT # and INPUT #. Why are you doing it the hard way?
Comm ports are the same in QB and in PDS
This should help http://faq.qbasicnews.com/?blast=SerialComms