Qbasicnews.com

Full Version: GRRR..communication with a PDA
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been having some serious trouble lately with trying to send something to the PDA through COM 1. But I can't even get past the part where I set up the OPEN COM statements. My qbasic code looks like this:

Code:
OPEN "COM1: 9600,N,8,1,CS1500" FOR APPEND AS #1

And then my code on the PDA looks like this: (using OWBasic)

Code:
SRLOPEN 96, 8, 0, 1, 2, 1

(96 would be multiplied by 100 to make it 9600)

The last 1 demonstrates that the program will be in CS/RS flow.

But the problem is, my program won't even finish! In Qbasic it waits and waits but nothing happens. Do the Communication speeds have to match on both my computer and on the PDA?

Second Question:

Once I get the speeds correct, can I use print # and write # statements like I normally would in sequential files?

Thanks for any help!
No one can help me Sad Any help is appreciated!
Code:
OPEN "COM1: 9600,N,8,1,CS1500" FOR APPEND AS #1

I wonder about the CS1500 in this part. But if that's acceptable, Perhaps you need to open for Output instead of Append as append assumes that it already exists.


And then my code on the PDA looks like this: (using OWBasic)

Code:
SRLOPEN 96, 8, 0, 1, 2, 1


(96 would be multiplied by 100 to make it 9600)

The last 1 demonstrates that the program will be in CS/RS flow.

But the problem is, my program won't even finish! In Qbasic it waits and waits but nothing happens. Do the Communication speeds have to match on both my computer and on the PDA?


*** HERE it would help if the were the same speed. But usually it would try to connect at the speed you tell it to then try at a slower speed until it can connect.


Second Question:

Once I get the speeds correct, can I use print # and write # statements like I normally would in sequential files?

Thanks for any help![/quote]


If I recall, yes, these should work as they would work a standard file.
Check my comms program there: http://faq.qbasicnews.com/?blast=SerialComms
I always used OPEN FOR RANDOM for comms so I can't tell you if FOR APPEND should work.
As you can see I use PRINT # to write to port and input$ # to read from it

These parameters for the com port
OPEN "COM1: 9600,N,8,1,CS0,CD0,DS0,OP0,RS" FOR RANDOM AS #1
are guaranteed to work even with a 3 wire connection (no handshake).
You should try to find the corresponding parameters for the PDA.
This way you don't need to worry about handshake unless you are loosing fragments of your messages.