Board Logo
« TERMINAL.bas »

Welcome Guest. Please Login or Register.
Sep 17th, 2014, 04:28am


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Please use the forums Search feature before asking.
Please post code using the code box described in Format Your Messages.
This will keep indentation, separate it better form the message and prevent gibberish.
If the code is too long for one post or additional files are needed, upload a ZIP archive to the Just BASIC Files Archive Site.

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: TERMINAL.bas  (Read 434 times)
Serial Comms
Guest
xx TERMINAL.bas
« Thread started on: Apr 28th, 2005, 4:41pm »

I've just picked up JB and am having some fun with it. I'm going to use it for control applications through serial ports. Using TERMINAL.bas I've rigged up some code to listen to devices. The question I have is in the example code how does the Variable "Com" know which port it is buffering when you are opening multiple ports?


User IP Logged

Cborrow
Member in Training
ImageImage


member is offline

Avatar

PHP Guru

AIM
Homepage PM

Gender: Male
Posts: 37
xx Re: TERMINAL.bas
« Reply #1 on: Apr 28th, 2005, 5:35pm »

In the terminal.bas program there are these three lines
Code:
'Open communications port 2.  It's handle is #comm.
    'If you need to change to com 1, this is the line to modify
    open "COM1:9600,n,8,1,ds0" for random as #comm
 


I think that all you would do is change COM1 to COM2 or COM3 depeding on the port you are looking for, but I am just taking a wild guess.

User IP Logged

Unrelated Studios
Serial Comms
Guest
xx Re: TERMINAL.bas
« Reply #2 on: Apr 29th, 2005, 2:35pm »

Sorry about not being clear. I understand how to change ports my question is regarding the input buffer "Com" (From TERMINAL.BAS:

'Set the size of the communications buffer to 16K
Com = 8192 * 2

I would have thought that each Opened device would have its own buffer. But I don't even see where a device is explicitly bound to the buffer.

User IP Logged

Rod
Administrator
ImageImageImageImageImage


member is offline

Avatar

Graphics = Goosebumps!


Homepage PM

Gender: Male
Posts: 2637
xx Re: TERMINAL.bas
« Reply #3 on: Apr 29th, 2005, 3:30pm »

From the help file:-
Quote:
To set the in and out communications buffers (each port has its own), set the variable Com (notice the uppercase C) to the desired size before opening the port. Changing the variable after opening a port does not affect the size of the buffers for that port while it is open.

    'set the size of the communications buffers
    '(in and out) to 16K each
    Com = 16384



Once you set the system variable "Com" you then use "open Com1/Com2/Com3" and that opens the specified com port with its own input and output buffers of the size specified.
« Last Edit: Apr 29th, 2005, 3:31pm by Rod » User IP Logged

Rod.

Got time for a game? http://www.freewebs.com/gamebin/
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls