LB Booster
« COM port numbering »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:52am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: COM port numbering  (Read 713 times)
net2014
New Member
Image


member is offline

Avatar




PM


Posts: 37
xx COM port numbering
« Thread started on: Jul 26th, 2014, 8:01pm »

Code:
open "com7:9600,8,N,1" for random as #comport 
#comport,"V"
NumBytes = lof(#comport)
resp$ = input$(#comport, NumBytes)
print resp$
close #comport

 


The above code works ok in LB4.04 but baulks at the first line in LBB.
I'm trying to send serial data to a usb/serial device which registers as com7.

WINxp/LBB v2.63
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: COM port numbering
« Reply #1 on: Jul 26th, 2014, 9:48pm »

on Jul 26th, 2014, 8:01pm, net2014 wrote:
Code:
open "com7:9600,8,N,1" for random as #comport  

LBB (or, more to the point, the Windows BuildCommDCB API function which does the work) requires the parameters to be in the conventional order - baud rate, parity, number of data bits, number of stop bits:

Code:
open "com7:9600,N,8,1" for random as #comport  

That's also the order specified in the Liberty BASIC docs, so your code worked in LB 4.04 only by chance.

Richard.
« Last Edit: Jul 26th, 2014, 10:05pm by Richard Russell » User IP Logged

net2014
New Member
Image


member is offline

Avatar




PM


Posts: 37
xx Re: COM port numbering
« Reply #2 on: Jul 27th, 2014, 09:37am »

Thanks Richard. The quoted code was just copied/pasted from serial code I have been using for years so I assumed it was correct. I wish I could remember all these LB foibles! rolleyes

Even during my working life, RS232 was often referred to as using '8N1' transmission, so I will seek out all my serial code and rearrange the parameters.

Thanks again for your speedy response.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: COM port numbering
« Reply #3 on: Jul 27th, 2014, 10:24am »

on Jul 27th, 2014, 09:37am, net2014 wrote:
Even during my working life, RS232 was often referred to as using '8N1' transmission

Perfectly logical, considering that it's the order of transmission (data bits, then an optional parity bit, then stop bit[s]), but the MS-DOS MODE command - from which everything else derives I think - didn't specify it like that.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls