Search the web
Sign In
New User? Sign Up
xbasic
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 18786 - 18815 of 18815   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#18815 From: Vincent Voois <vvoois@...>
Date: Tue Nov 17, 2009 6:10 am
Subject: Re: XuiProgress
vvacme
Offline Offline
Send Email Send Email
 
I would not be bothered by submitting data larger than max.
It then depends on how the values above should be interpreted:as no value (IF
value > 500 THEN CurrentProgress = 0) or as max value (IF value > 500 THEN
CurrrentProgress = Max) or perhaps a different case:
IF (Value >= 50) && (Value <= Max) THEN
	 CurrentProgressStatus = Value
END IF

Meaning, you just ignore other values and submit only what matters.
I guess the progress meter will interpret larger values as +Inf and fully scale
out.
If you want to stay on the safe side you just filter all incoming data first and
simply convert any higher values to the max value and send the max value instead
of
just the plain data that you directly get.

Is what is being send increasing at all or are all these figures being randomly
generated? You want to use the progress meter as a sort of gauge meter?

Vince.
N0WIQ wrote:
> Hi Group,
>
> I took a look at the window code trying to understand what happens when
> the data exceeds the maximum value for the XuiProgress.  The reason I
> have deduced is related to my S meter data.  The data ranges from 50 to
> 5000 but I want the display to saturate at 500 and not care about any
> data above 500.  Would someone clarify what I should expect from
> XuiProgress if it is given data greater than its maximum value?
>

#18814 From: N0WIQ <n0wiq@...>
Date: Sun Nov 15, 2009 9:27 pm
Subject: XuiProgress
n0wiq
Offline Offline
Send Email Send Email
 
Hi Group,

I took a look at the window code trying to understand what happens when
the data exceeds the maximum value for the XuiProgress.  The reason I
have deduced is related to my S meter data.  The data ranges from 50 to
5000 but I want the display to saturate at 500 and not care about any
data above 500.  Would someone clarify what I should expect from
XuiProgress if it is given data greater than its maximum value?

--
Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18813 From: N0WIQ <n0wiq@...>
Date: Sat Nov 14, 2009 3:42 pm
Subject: GUI Designer
n0wiq
Offline Offline
Send Email Send Email
 
Hi Group,

/xbasic-6.3.4-linux-i386-20091112.tar.gz
I hate to be a nit picker but,  when I open an existing window design to
edit the text I have in the kid (XuiLabel) the GUI designer doesn't
display or change the esisting text.

--
Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18812 From: Vincent Voois <vvoois@...>
Date: Sat Nov 14, 2009 12:44 am
Subject: Re: /xbasic-6.3.4-linux-i386-20091112.tar.gz
vvacme
Offline Offline
Send Email Send Email
 
Steve Gunhouse wrote:
> On Fri, 13 Nov 2009 17:10:38 -0500, N0WIQ <n0wiq@...> wrote:
>
>> Hello Group,
>>
>> First I want to say thank you for the xbasic upgrade it has allowed me
>> to do some things I was having trouble with.  My most notable upgrade
>> was the NOHANG option for ttyUSB file I/O.
>>
>> The data from my radio for the S meter is logarithmic values.  Does any
>> one know an easy way to convert the logarithmic data to linear values.
>
> I'd guess that many people here do ... but you probably don't want to do
> that anyway.
>
> Signal strength has always been measured in decibels, which is a
> logarithmic scale. What that means is that a difference of 3 dB means one
> is twice as loud, 10 dB is 10 times as loud, etc. To change to a linear
> scale you'd use exponents, y = 10**(x/10) where x is decibels and y is
> your linear value. (Using XBasic notation, "**" means exponent.)
>
> The problem is ... a difference of 20 dB means 100, and 30 dB means 1000.
> It's a lot easier to rate things in decibels (or a similar logarithmic
> scale), and I'd venture that if you do switch to linear then you'll be
> going back to logarithmic in short order.

Here is a small example to transform -200dB (Infinite) to 0 and 0 to 12dB
I could have used EXP10() in the DbToLin function, but decided to go a bit
Steven's path.

'
'
' ####################
' #####  PROLOG  #####
' ####################
'
PROGRAM "progname"  ' 1-8 char program/file name without .x or any .extent
VERSION "0.0000"    ' version number - increment before saving altered program
	 IMPORT "xma"   ' Math library     : SIN/ASIN/SINH/ASINH/LOG/EXP/SQRT...
' IMPORT "xcm"   ' Complex library  : complex number library  (trig, etc)
	 IMPORT "xst"   ' Standard library : required by most programs
' IMPORT "xgr"   ' GraphicsDesigner : required by GuiDesigner programs
' IMPORT "xui"   ' GuiDesigner      : required by GuiDesigner programs
'

DECLARE FUNCTION  Entry ()
DECLARE FUNCTION LinToDb(Value)
DECLARE FUNCTION DbToLin(Value)
'
'
' ######################
' #####  Entry ()  #####
' ######################
'
FUNCTION  Entry ()

	 FOR X = 0 TO 4 STEP 1
		 PRINT X ;"->"; LinToDb(X);"dB"; DbToLin(X)
	 NEXT X
END FUNCTION
'
' ######################
' ##### LinToDb () #####
' ######################
'
FUNCTION LinToDb(Value)
	 EPSILON = 1e-12
	 MINUSINFDB = -200.0

    IF (Value > EPSILON) THEN
      RETURN (LOG10(Value)*20.0)
    ELSE
      RETURN MINUSINFDB
	 END IF
END FUNCTION
'
' ######################
' ##### DbToLin () #####
' ######################
'
FUNCTION DbToLin(Value)
	 EPSILON = 1e-12
	 MINUSINFDB = -200.0
    IF (Value > MINUSINFDB) THEN
      RETURN (10.0** (Value * 0.05))
    ELSE
      RETURN 0.0
	 END IF
END FUNCTION
END PROGRAM

#18811 From: "Steve Gunhouse" <svgunhouse@...>
Date: Fri Nov 13, 2009 10:54 pm
Subject: Re: /xbasic-6.3.4-linux-i386-20091112.tar.gz
sgunhouse
Offline Offline
Send Email Send Email
 
On Fri, 13 Nov 2009 17:10:38 -0500, N0WIQ <n0wiq@...> wrote:

> Hello Group,
>
> First I want to say thank you for the xbasic upgrade it has allowed me
> to do some things I was having trouble with.  My most notable upgrade
> was the NOHANG option for ttyUSB file I/O.
>
> The data from my radio for the S meter is logarithmic values.  Does any
> one know an easy way to convert the logarithmic data to linear values.

I'd guess that many people here do ... but you probably don't want to do
that anyway.

Signal strength has always been measured in decibels, which is a
logarithmic scale. What that means is that a difference of 3 dB means one
is twice as loud, 10 dB is 10 times as loud, etc. To change to a linear
scale you'd use exponents, y = 10**(x/10) where x is decibels and y is
your linear value. (Using XBasic notation, "**" means exponent.)

The problem is ... a difference of 20 dB means 100, and 30 dB means 1000.
It's a lot easier to rate things in decibels (or a similar logarithmic
scale), and I'd venture that if you do switch to linear then you'll be
going back to logarithmic in short order.

--
Steve Gunhouse

#18810 From: N0WIQ <n0wiq@...>
Date: Fri Nov 13, 2009 10:10 pm
Subject: /xbasic-6.3.4-linux-i386-20091112.tar.gz
n0wiq
Offline Offline
Send Email Send Email
 
Hello Group,

First I want to say thank you for the xbasic upgrade it has allowed me
to do some things I was having trouble with.  My most notable upgrade
was the NOHANG option for ttyUSB file I/O.

The data from my radio for the S meter is logarithmic values.  Does any
one know an easy way to convert the logarithmic data to linear values.

--
Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18809 From: Vincent Voois <vvoois@...>
Date: Fri Nov 13, 2009 8:19 pm
Subject: Re: Huray
vvacme
Offline Offline
Send Email Send Email
 
If you add debug lines around the S-meter to make them post results in the
console... (Min, max and current for instance)
What are the values that you get vs the values that you get in the compiled
version?
Usually, these ways you get a clue if something functions incorrectly because of
variables that are not what they are outside the PDE or that it must be
something else.
Also post debug lines around your calculator, if min / max and current values
are correctly applied to the progress meter.
And print the kid and gridnumbers in the console so that you know that these
have the correct values outside the PDE as well as within.
What kid-number are you sending it to, what grid number? if you pick those up
dynamically, do they still match outside the PDE?


Vince.


N0WIQ wrote:
> Hi Group,
>
> Running xbasic-linux-6.3.4 on my 32 bit lap top.  I was able to make
> significant progress reading random data through my /dev/ttyUSBn port
> (finally).
>
> There is one issue that I would like to see fixed.  In my program I have
> a decode function and a display function for displaying the S meter data
> in a progress kik of my GUI.  Running this from the xbasic PDE the
> progress kid shows changing data.  If I compile my program into an
> executable, the program runs as expected except the S meter display is
> full scale all the time.
>

#18808 From: "cw2008can" <cw2008can@...>
Date: Thu Nov 12, 2009 5:29 am
Subject: Re: XBasic-6.3.4 for Linux
cw2008can
Offline Offline
Send Email Send Email
 
Attempt number three: xbasic-6.3.4-linux-i386-20091112.tar.gz
There should not be any LoadLibrary error messages.
CW

--- In xbasic@yahoogroups.com, "cw2008can" <cw2008can@...> wrote:
>
> Let's try again with xbasic-6.3.4-linux-i386-20091111.tar.gz
> CW
>
> --- In xbasic@yahoogroups.com, "cw2008can" <cw2008can@> wrote:
> >
> > xbasic-6.3.4-linux-i386-20091110.tat.gz is now in
> > Files > members > XBasicBin
> > It includes the option $$NONBLOCK when opening a file
> > (ie) fileNumber = OPEN ("/dev/ttyS0", $$RW OR $$NONBLOCK)
> > CW
> >
>

#18807 From: N0WIQ <n0wiq@...>
Date: Wed Nov 11, 2009 10:31 pm
Subject: Huray
n0wiq
Offline Offline
Send Email Send Email
 
Hi Group,

Running xbasic-linux-6.3.4 on my 32 bit lap top.  I was able to make
significant progress reading random data through my /dev/ttyUSBn port
(finally).

There is one issue that I would like to see fixed.  In my program I have
a decode function and a display function for displaying the S meter data
in a progress kik of my GUI.  Running this from the xbasic PDE the
progress kid shows changing data.  If I compile my program into an
executable, the program runs as expected except the S meter display is
full scale all the time.

--
Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18806 From: "Mr Kite" <mrkite.2@...>
Date: Wed Nov 11, 2009 9:41 pm
Subject: Re: XstGetFilesAndAttributes and composite data types
mrkite_cincy
Offline Offline
Send Email Send Email
 
Just wanted to say thanks. Thans exactly what I needed and my issue is resolved.


--- In xbasic@yahoogroups.com, Vincent Voois <vvoois@...> wrote:
>
> Aha i guess you mean this:
> XstGetFilesAndAttributes()    maxLen = XstGetFilesAndAttributes (@ filter $, @
attributeFilter , @ file$[] , FILEINFO @ info[] )
>
> Get an array of filenames in file$[] and file information in info[] for the
files specified by the drive/path/filename in filter$ and the file attributes in
filter.
> The info[] array is type FILEINFO , as defined in " xst.DEC ". The number of
characters in the longest filename is returned in maxLen.
>
> TYPE FILEINFO
>    XLONG        .attributes
>    XLONG        .createTimeLow
>    XLONG        .createTimeHigh
>    XLONG        .accessTimeLow
>    XLONG        .accessTimeHigh
>    XLONG        .modifyTimeLow
>    XLONG        .modifyTimeHigh
>    XLONG        .sizeHigh
>    XLONG        .sizeLow
>    XLONG        .res0
>    XLONG        .res1
>    STRING*260   .name
>    STRING*14    .alternateName
> END TYPE
>
> Try to fumble with this:
>
> FUNCTION  Entry ()
> FILEINFO info[]
>
> filter$ = "c:\\WINDOWS\\*.*"
> attributeFilter=32 '(all normal files)
>
> maxLen = XstGetFilesAndAttributes (@ filter$, @attributeFilter , @ file$[] ,
@info[] )
> FOR T = 0 TO UBOUND(info[])
>  PRINT info[T].attributes
>  PRINT info[T].name
>  PRINT info[T].alternateName
> NEXT T
> END FUNCTION
>
> Mr Kite wrote:
> > I can't find much help on these two subjects.  I want to use this function
but I can't find the correct syntax to access the compenents for the data type
it uses.  If some one could at least show me an example of code that would print
the retrieved data it would help a lot.
> >
> > Thanks.
> >
> >
> >
> > ------------------------------------
> >
> > http://www.xbasic.org/
> > Yahoo! Groups Links
> >
> >
> >
> > .
> >
>

#18805 From: Vincent Voois <vvoois@...>
Date: Wed Nov 11, 2009 9:34 pm
Subject: Re: ???
vvacme
Offline Offline
Send Email Send Email
 
XBasic is 32 bit... Currently 32-compatability modes in the 64-bit Linux
distributions are lousy supported.
To get the 32-bit fontset libraries installed, you need to install Wine to get
that done for instance...
Well, not really, but most 32-bit programs rely on the 32-bit fontset libraries
which are *not* installed with the 32-bit compatability library packs if you
select
those. And there are so a few other things that make the 32-bit compatible layer
crap in the 64-bit Linux distro's.

Vince.


N0WIQ wrote:
> Hello Group,
>
> I installed /xbasic-6.3.4-linux-i386-20091111.tar.gz on my 32bit
> laptop.  Now xbasic starts without any errors.
>
> I also installed /xbasic-6.3.4-linux-i386-20091111.tar.gz on my 64 bit
> machine and I see:
> kernel32.x - loadlibraryA().C : dlopen() failed : <dl> <> -1
> <libdl.so> libdl.so: cannot open shared object file: no file or directory
>
> Now On my 64 bit machine I have installed wine.  It supples the X
> libraries that allow xbaxic to run to this point.
>

#18804 From: N0WIQ <n0wiq@...>
Date: Wed Nov 11, 2009 6:00 pm
Subject: ???
n0wiq
Offline Offline
Send Email Send Email
 
Hello Group,

I installed /xbasic-6.3.4-linux-i386-20091111.tar.gz on my 32bit
laptop.  Now xbasic starts without any errors.

I also installed /xbasic-6.3.4-linux-i386-20091111.tar.gz on my 64 bit
machine and I see:
kernel32.x - loadlibraryA().C : dlopen() failed : <dl> <> -1
<libdl.so> libdl.so: cannot open shared object file: no file or directory

Now On my 64 bit machine I have installed wine.  It supples the X
libraries that allow xbaxic to run to this point.

--
Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18803 From: "cw2008can" <cw2008can@...>
Date: Wed Nov 11, 2009 5:44 am
Subject: Re: XBasic-6.3.4 for Linux
cw2008can
Offline Offline
Send Email Send Email
 
Let's try again with xbasic-6.3.4-linux-i386-20091111.tar.gz
CW

--- In xbasic@yahoogroups.com, "cw2008can" <cw2008can@...> wrote:
>
> xbasic-6.3.4-linux-i386-20091110.tat.gz is now in
> Files > members > XBasicBin
> It includes the option $$NONBLOCK when opening a file
> (ie) fileNumber = OPEN ("/dev/ttyS0", $$RW OR $$NONBLOCK)
> CW
>

#18802 From: Kerry Miller <n0wiq@...>
Date: Wed Nov 11, 2009 4:58 am
Subject: 32 bit lap top
n0wiq
Offline Offline
Send Email Send Email
 
Hi Group,

My laptop is a 32 bit machine running Fedora11 x586.

I installed:
/xbasic-6.3.4-linux-i386-20091110.tar.gz and got this in the console:
kernel32.x - LoadLibrary().C : dlopen() failed : <clib> <> -1
<libclib.so> libclib.so: cannot open shared object file: No such file or
directory

--
Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18801 From: N0WIQ <n0wiq@...>
Date: Tue Nov 10, 2009 11:59 pm
Subject: xbasic6.3.4-linux-386...
n0wiq
Offline Offline
Send Email Send Email
 
cw2008can

I installed /xbasic-6.3.4-linux-i386-20091110.tar.gz
with tar -xzf ./xbasic-6.3.4-linux-i386-20091110.tar.gz
on my Fedora11 x86_64 machine and when I started xbasic I got:
<libclib> libclib.so: cannot open shared object file: no such file or
directory
kernel32.x - loadlibraryA().C : dlopen() : <dl> <> -1

--
Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18800 From: "cw2008can" <cw2008can@...>
Date: Tue Nov 10, 2009 9:07 pm
Subject: XBasic-6.3.4 for Linux
cw2008can
Offline Offline
Send Email Send Email
 
xbasic-6.3.4-linux-i386-20091110.tat.gz is now in
Files > members > XBasicBin
It includes the option $$NONBLOCK when opening a file
(ie) fileNumber = OPEN ("/dev/ttyS0", $$RW OR $$NONBLOCK)
CW

#18799 From: N0WIQ <n0wiq@...>
Date: Tue Nov 10, 2009 8:47 pm
Subject: Xbasic
n0wiq
Offline Offline
Send Email Send Email
 
Hi Group,

Mark, I know about "clib" but what are you talking about Xbasic has its own open().  I haven't found it in the documentation I have.

On 11/10/2009 12:44 PM, Marc wrote:
 

Steven,

If you create new program in the PDE on Linux, import clib, then add
the following line to the Entry() function:

pid = getpid()

The PDE complains that getpid() is undefined, even though it is in defined clib. The very same line of code compiles fine using xb compiler on the command line. Then the problem is that using import clib adds
an unneeded and errant entry in the makefile, which has to then be removed. In the interest of helping the guy out, I created a version
that I knew would compile and run given the instructions I provided.

--- In xbasic@yahoogroups.com, "Steve Gunhouse" <svgunhouse@...> wrote:
>
> On Tue, 10 Nov 2009 08:54:51 -0500, N0WIQ <n0wiq@...> wrote:
>
> > Hi Group,
> >
> > I have been told about using the C open() in Xbasic to get a NO_HANG
> > open. This leaves me cold. My primary concern is my program is still
> > under developement and having to recompile each time I make a change
> > seem counter productive.
>
> I'm not sure why he thinks you couldn't use it in the PDE, you'd just have
> to import your clib (instead of the individual "open", "read" and "close"
> commands). That's why it works when compiled - even if you didn't have an
> IMPORT statement for your clib, XB has one in its own libraries.
>
> --
> Steve Gunhouse
>


-- Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18798 From: "Marc" <cluvius2000@...>
Date: Tue Nov 10, 2009 7:44 pm
Subject: Re: C open
cluvius2000
Offline Offline
Send Email Send Email
 
Steven,

If you create new program in the PDE on Linux, import clib, then add
the following line to the Entry() function:

pid = getpid()

The PDE complains that getpid() is undefined, even though it is in defined clib.
The very same line of code compiles fine using xb compiler on the command line. 
Then the problem is that using import clib adds
an unneeded and errant entry in the makefile, which has to then be removed.  In
the interest of helping the guy out, I created a version
that I knew would compile and run given the instructions I provided.

--- In xbasic@yahoogroups.com, "Steve Gunhouse" <svgunhouse@...> wrote:
>
> On Tue, 10 Nov 2009 08:54:51 -0500, N0WIQ <n0wiq@...> wrote:
>
> > Hi Group,
> >
> > I have been told about using the C open() in Xbasic to get a NO_HANG
> > open.  This leaves me cold.  My primary concern is my program is still
> > under developement and having to recompile each time I make a change
> > seem counter productive.
>
> I'm not sure why he thinks you couldn't use it in the PDE, you'd just have
> to import your clib (instead of the individual "open", "read" and "close"
> commands). That's why it works when compiled - even if you didn't have an
> IMPORT statement for your clib, XB has one in its own libraries.
>
> --
> Steve Gunhouse
>

#18797 From: "Steve Gunhouse" <svgunhouse@...>
Date: Tue Nov 10, 2009 6:21 pm
Subject: Re: C open
sgunhouse
Offline Offline
Send Email Send Email
 
On Tue, 10 Nov 2009 08:54:51 -0500, N0WIQ <n0wiq@...> wrote:

> Hi Group,
>
> I have been told about using the C open() in Xbasic to get a NO_HANG
> open.  This leaves me cold.  My primary concern is my program is still
> under developement and having to recompile each time I make a change
> seem counter productive.

I'm not sure why he thinks you couldn't use it in the PDE, you'd just have
to import your clib (instead of the individual "open", "read" and "close"
commands). That's why it works when compiled - even if you didn't have an
IMPORT statement for your clib, XB has one in its own libraries.

--
Steve Gunhouse

#18796 From: N0WIQ <n0wiq@...>
Date: Tue Nov 10, 2009 1:54 pm
Subject: C open
n0wiq
Offline Offline
Send Email Send Email
 
Hi Group,

I have been told about using the C open() in Xbasic to get a NO_HANG
open.  This leaves me cold.  My primary concern is my program is still
under developement and having to recompile each time I make a change
seem counter productive.

--
Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18795 From: Kerry Miller <n0wiq@...>
Date: Mon Nov 9, 2009 11:53 pm
Subject: xbasic-6.3.3
n0wiq
Offline Offline
Send Email Send Email
 
Hi group,

I think my copy of xbasic-6.3.3-linux-386 may  have gotten corrupt.
Where do I find a fresh copy.

--
Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18794 From: "Marc" <cluvius2000@...>
Date: Mon Nov 9, 2009 9:24 pm
Subject: Re: Non Blocking Read
cluvius2000
Offline Offline
Send Email Send Email
 
port$ should be "/dev/ttyS1".  Not sure how that
got messed up in the copy and paste into the browser.

--- In xbasic@yahoogroups.com, "Marc" <cluvius2000@...> wrote:
>
> I have suggested several times to use the C open() function.  Out of
> my own curiosity, I wrote an XB program on Linux that reads in a
> non-blocking fashion from the serial port. Save it as serial.x, and
> obviously change /dev/ttyS1 to be whatever your serial device is.
>
> You can't run it in the PDE, you have to compile and run it much
> like a C program:
>
> xb serial.x
> make -f serial.mak
>
> PROGRAM "progname"
> VERSION "0.0000"
>
> IMPORT "xst"
>
> DECLARE FUNCTION  Entry ()
> EXTERNAL CFUNCTION open(path_addr, flags)
> EXTERNAL CFUNCTION read(fd, buff_addr, bytes)
> EXTERNAL CFUNCTION close(fd)
>
> $$LIN_O_ACCMODE          = 0x0003
> $$LIN_O_RDONLY           = 0x0000
> $$LIN_O_WRONLY           = 0x0001
> $$LIN_O_RDWR             = 0x0002
> $$LIN_O_CREAT            = 0x0040
> $$LIN_O_EXCL             = 0x0080
> $$LIN_O_NOCTTY           = 0x0100
> $$LIN_O_TRUNC            = 0x0200
> $$LIN_O_APPEND           = 0x0400
> $$LIN_O_NONBLOCK         = 0x0800
> $$LIN_O_NDELAY           = 0x0800
> $$LIN_O_SYNC             = 0x1000
> $$BUFF_SIZE = 32
>
> FUNCTION  Entry ()
>   port$ = "/dev  tyS1"
>   buff$ = NULL$($$BUFF_SIZE)
>
>   XstClearConsole()
>   fd = open(&port$, $$LIN_O_RDONLY | $$LIN_O_NONBLOCK | $$LIN_O_NOCTTY)
>   IF(fd > 0) THEN
> 	  PRINT("Opened serial port as: " + STRING$(fd))
> 	  ret = -1
> 	  buff_ptr = &buff$
> 	  offset = 0
>     'Try to read a byte from the serial port
>     'If there is one, append it to buff$ and print buff$
>     'otherwise, print a message that there is no data
> 	  DO
> 	    ret = read(fd, buff_ptr + offset, 1)
> 	    IF(ret > 0) THEN
> 	      PRINT(buff$)
> 	      INC offset
>         'Dont allow a buffer overflow
> 	      IF(offset >= $$BUFF_SIZE) THEN offset = 0
>       ELSE
>         a$ = INLINE$("No Data! Press q to quit, Enter to read again >>")
>         IF(a$ == "q") THEN EXIT DO
> 	    END IF
> 	  LOOP
> 	  close(fd)
>   ELSE
> 	  PRINT("Error opening serial port!")
>   END IF
> END FUNCTION
> END PROGRAM
>
>
>
>
> --- In xbasic@yahoogroups.com, N0WIQ <n0wiq@> wrote:
> >
> > Hi Group,
> >
> > My lament:  I haven't found and none has suggested how I should do a
> > Non-Blocking read so I could monitor a serial port that has no data or
> > is not connected to anything without hanging on the read.  I have tried
> > the READ() command and I have tried the XstbinRead() function and so far
> > I haven't found a way around nothing connected.  I am afraid I am going
> > to have to give up on Xbasic
> >
> > --
> > Kerry N0WIQ
> > My web site URL is:
> > http://mywebpages.comcast.net/n0wiq
> >
>

#18793 From: "Marc" <cluvius2000@...>
Date: Mon Nov 9, 2009 9:15 pm
Subject: Re: Non Blocking Read
cluvius2000
Offline Offline
Send Email Send Email
 
I have suggested several times to use the C open() function.  Out of
my own curiosity, I wrote an XB program on Linux that reads in a
non-blocking fashion from the serial port. Save it as serial.x, and
obviously change /dev/ttyS1 to be whatever your serial device is.

You can't run it in the PDE, you have to compile and run it much
like a C program:

xb serial.x
make -f serial.mak

PROGRAM "progname"
VERSION "0.0000"

IMPORT "xst"

DECLARE FUNCTION  Entry ()
EXTERNAL CFUNCTION open(path_addr, flags)
EXTERNAL CFUNCTION read(fd, buff_addr, bytes)
EXTERNAL CFUNCTION close(fd)

$$LIN_O_ACCMODE          = 0x0003
$$LIN_O_RDONLY           = 0x0000
$$LIN_O_WRONLY           = 0x0001
$$LIN_O_RDWR             = 0x0002
$$LIN_O_CREAT            = 0x0040
$$LIN_O_EXCL             = 0x0080
$$LIN_O_NOCTTY           = 0x0100
$$LIN_O_TRUNC            = 0x0200
$$LIN_O_APPEND           = 0x0400
$$LIN_O_NONBLOCK         = 0x0800
$$LIN_O_NDELAY           = 0x0800
$$LIN_O_SYNC             = 0x1000
$$BUFF_SIZE = 32

FUNCTION  Entry ()
   port$ = "/dev  tyS1"
   buff$ = NULL$($$BUFF_SIZE)

   XstClearConsole()
   fd = open(&port$, $$LIN_O_RDONLY | $$LIN_O_NONBLOCK | $$LIN_O_NOCTTY)
   IF(fd > 0) THEN
	   PRINT("Opened serial port as: " + STRING$(fd))
	   ret = -1
	   buff_ptr = &buff$
	   offset = 0
     'Try to read a byte from the serial port
     'If there is one, append it to buff$ and print buff$
     'otherwise, print a message that there is no data
	   DO
	     ret = read(fd, buff_ptr + offset, 1)
	     IF(ret > 0) THEN
	       PRINT(buff$)
	       INC offset
         'Dont allow a buffer overflow
	       IF(offset >= $$BUFF_SIZE) THEN offset = 0
       ELSE
         a$ = INLINE$("No Data! Press q to quit, Enter to read again >>")
         IF(a$ == "q") THEN EXIT DO
	     END IF
	   LOOP
	   close(fd)
   ELSE
	   PRINT("Error opening serial port!")
   END IF
END FUNCTION
END PROGRAM




--- In xbasic@yahoogroups.com, N0WIQ <n0wiq@...> wrote:
>
> Hi Group,
>
> My lament:  I haven't found and none has suggested how I should do a
> Non-Blocking read so I could monitor a serial port that has no data or
> is not connected to anything without hanging on the read.  I have tried
> the READ() command and I have tried the XstbinRead() function and so far
> I haven't found a way around nothing connected.  I am afraid I am going
> to have to give up on Xbasic
>
> --
> Kerry N0WIQ
> My web site URL is:
> http://mywebpages.comcast.net/n0wiq
>

#18792 From: Vincent Voois <vvoois@...>
Date: Mon Nov 9, 2009 8:01 pm
Subject: Re: Non Blocking Read
vvacme
Offline Offline
Send Email Send Email
 
This stuff is just not that easy....
If i couldn't manage it from within XBasic,
I went looking for a library that could and used the library to perform the hard
work for me.
But finding the right library on Windows could be as fruitless as the attempt of
doing it yourself as on the Windows world, if you want something specific:you
have
to pull your wallet for it.
Fortunately on Linux, you can ask for these possibilities on various Linux
forums and folks pop many opportunities right out of their sleeves.
And specially if it comes up to communication, Linux has plenty tools to come
around with.

Don't give up so soon :)

Vince.

N0WIQ wrote:
> Hi Group,
>
> My lament:  I haven't found and none has suggested how I should do a
> Non-Blocking read so I could monitor a serial port that has no data or
> is not connected to anything without hanging on the read.  I have tried
> the READ() command and I have tried the XstbinRead() function and so far
> I haven't found a way around nothing connected.  I am afraid I am going
> to have to give up on Xbasic
>

#18791 From: N0WIQ <n0wiq@...>
Date: Mon Nov 9, 2009 11:00 am
Subject: Non Blocking Read
n0wiq
Offline Offline
Send Email Send Email
 
Hi Group,

My lament:  I haven't found and none has suggested how I should do a
Non-Blocking read so I could monitor a serial port that has no data or
is not connected to anything without hanging on the read.  I have tried
the READ() command and I have tried the XstbinRead() function and so far
I haven't found a way around nothing connected.  I am afraid I am going
to have to give up on Xbasic

--
Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18790 From: xbasic@yahoogroups.com
Date: Fri Nov 6, 2009 12:30 am
Subject: New file uploaded to xbasic
xbasic@yahoogroups.com
Send Email Send Email
 
Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the xbasic
group.

   File        : /members/sciwise/Spl3ftCp.zip
   Uploaded by : gedcda72 <sciwise@...>
   Description : Spline and control points , fft

You can access this file at the URL:
http://groups.yahoo.com/group/xbasic/files/members/sciwise/Spl3ftCp.zip

To learn more about file sharing for your group, please visit:
http://help.yahoo.com/l/us/yahoo/groups/original/general.htmlfiles

Regards,

gedcda72 <sciwise@...>

#18789 From: N0WIQ <n0wiq@...>
Date: Wed Nov 4, 2009 11:48 am
Subject: Re: Re: ttyUSBn #2
n0wiq
Offline Offline
Send Email Send Email
 
Hi Group,

I have only used stty to set flags.  I will have to look closer at the man page or info and see how to interpret the flags, my intial view didn't mean anything useful to me.

On 11/03/2009 09:17 PM, cw2008can wrote:
 

Would this command help?
"stty -F /dev/ttyS0 -a"
If the device name is correct it gives all the current settings.
If the device name is wrong it responds "No such device"
CW

--- In xbasic@yahoogroups.com, N0WIQ <n0wiq@...> wrote:
>
> Hello Group,
>
> Correct me if I am incorrect, when I do a ls -la /dev/ttyUSB* I see a
> list of ttyUSBn and the n ranges from 0 to 4. Four of these entries are
> a One USB to Four tty adapter. At this time the one to four doesn't
> have anything connected to any of the tty ports. If I understand Linux
> a little the ls -la and the less /proc/bus/input/devices should have
> something to do with the ls -la. At any rate when I did less
> /proc/bus/input/devices I would have to study a lot more to make sense
> out of what I see. I would like to know if something is connected to or
> disconnected from the ttyUSBn port before I try to read that port.
>
> On 11/03/2009 02:54 PM, Z P wrote:
> >
> > It wasn't too hard to locate info.. so here goes
> >
> > Initially outside your program try the follwing in the console window
> >
> > *less /proc/bus/input/devices*
> >
> > This ought to come up witha a list of dvices connected to Your machine.
> >
> > In there You ought to find Your modem as well.
> > The rest is up to you ( how You integrate this into your basic code) and how You check for modem presence.
> >
> > I must say I have been follwing Your developments and wish I had Your tenacity.
> >
> >
> >
> >
> > --- On *Wed, 11/4/09, N0WIQ /<n0wiq@...>/* wrote:
> >
> >
> > From: N0WIQ <n0wiq@...>
> > Subject: [xbasic] ttyUSBn
> > To: "XBasic" <xbasic@yahoogroups.com>
> > Date: Wednesday, November 4, 2009, 3:28 AM
> >
> > Hi Group,
> >
> > I have a frustration: Is there any way I could check if anything is
> > connected to a ttyUSB I/O port before I try to read from it.
> >
> > --
> > Kerry N0WIQ
> > My web site URL is:
> > http://mywebpages. comcast.net/ n0wiq
> > <http://mywebpages.comcast.net/n0wiq>
> >
> >
> >
>
> --
> Kerry N0WIQ
> My web site URL is:
> http://mywebpages.comcast.net/n0wiq
>


-- Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18788 From: "cw2008can" <cw2008can@...>
Date: Wed Nov 4, 2009 4:17 am
Subject: Re: ttyUSBn #2
cw2008can
Offline Offline
Send Email Send Email
 
Would this command help?
"stty -F /dev/ttyS0 -a"
If the device name is correct it gives all the current settings.
If the device name is wrong it responds "No such device"
CW

--- In xbasic@yahoogroups.com, N0WIQ <n0wiq@...> wrote:
>
> Hello Group,
>
> Correct me if I am incorrect,  when I do a ls -la /dev/ttyUSB* I see a
> list of ttyUSBn and the n ranges from 0 to 4.  Four of these entries are
> a One USB to Four tty adapter.  At this time the one to four doesn't
> have anything connected to any of the tty ports.  If I understand Linux
> a little the ls -la and the less /proc/bus/input/devices should have
> something to do with the ls -la.  At any rate when I did less
> /proc/bus/input/devices I would have to study a lot more to make sense
> out of what I see.  I would like to know if something is connected to or
> disconnected from the ttyUSBn port before I try to read  that port.
>
> On 11/03/2009 02:54 PM, Z P wrote:
> >
> > It wasn't too hard to locate info.. so here goes
> >
> > Initially outside your program try the follwing in the console window
> >
> > *less /proc/bus/input/devices*
> >
> > This ought to come up witha a list of dvices connected to Your machine.
> >
> > In there You ought to find Your modem as well.
> > The rest is up to you ( how You integrate this into your basic code) and how
You check for modem presence.
> >
> > I must say I have been follwing Your developments and wish I had Your
tenacity.
> >
> >
> >
> >
> > --- On *Wed, 11/4/09, N0WIQ /<n0wiq@...>/* wrote:
> >
> >
> >     From: N0WIQ <n0wiq@...>
> >     Subject: [xbasic] ttyUSBn
> >     To: "XBasic" <xbasic@yahoogroups.com>
> >     Date: Wednesday, November 4, 2009, 3:28 AM
> >
> >     Hi Group,
> >
> >     I have a frustration: Is there any way I could check if anything is
> >     connected to a ttyUSB I/O port before I try to read from it.
> >
> >     --
> >     Kerry N0WIQ
> >     My web site URL is:
> >     http://mywebpages. comcast.net/ n0wiq
> >     <http://mywebpages.comcast.net/n0wiq>
> >
> >
> >
>
> --
> Kerry N0WIQ
> My web site URL is:
> http://mywebpages.comcast.net/n0wiq
>

#18787 From: N0WIQ <n0wiq@...>
Date: Wed Nov 4, 2009 3:15 am
Subject: ttyUSBn #2
n0wiq
Offline Offline
Send Email Send Email
 
Hello Group,  

Correct me if I am incorrect,  when I do a ls -la /dev/ttyUSB* I see a list of ttyUSBn and the n ranges from 0 to 4.  Four of these entries are a One USB to Four tty adapter.  At this time the one to four doesn't have anything connected to any of the tty ports.  If I understand Linux a little the ls -la and the less /proc/bus/input/devices should have something to do with the ls -la.  At any rate when I did less /proc/bus/input/devices I would have to study a lot more to make sense out of what I see.  I would like to know if something is connected to or disconnected from the ttyUSBn port before I try to read  that port.

On 11/03/2009 02:54 PM, Z P wrote:
 

It wasn't too hard to locate info.. so here goes

Initially outside your program try the follwing in the console window

less /proc/bus/input/devices

This ought to come up witha a list of dvices connected to Your machine.

In there You ought to find Your modem as well.
The rest is up to you ( how You integrate this into your basic code) and how You check for modem presence.
 
I must say I have been follwing Your developments and wish I had Your tenacity.

        


--- On Wed, 11/4/09, N0WIQ <n0wiq@comcast.net> wrote:

From: N0WIQ <n0wiq@comcast.net>
Subject: [xbasic] ttyUSBn
To: "XBasic" <xbasic@yahoogroups.com>
Date: Wednesday, November 4, 2009, 3:28 AM

 

Hi Group,

I have a frustration: Is there any way I could check if anything is
connected to a ttyUSB I/O port before I try to read from it.

--
Kerry N0WIQ
My web site URL is:
http://mywebpages. comcast.net/ n0wiq



-- Kerry N0WIQ
My web site URL is:
http://mywebpages.comcast.net/n0wiq

#18786 From: Z P <chatnick_au@...>
Date: Tue Nov 3, 2009 9:54 pm
Subject: Re: ttyUSBn
chatnick_au
Offline Offline
Send Email Send Email
 
It wasn't too hard to locate info.. so here goes

Initially outside your program try the follwing in the console window

less /proc/bus/input/devices

This ought to come up witha a list of dvices connected to Your machine.

In there You ought to find Your modem as well.
The rest is up to you ( how You integrate this into your basic code) and how You check for modem presence.
 
I must say I have been follwing Your developments and wish I had Your tenacity.



--- On Wed, 11/4/09, N0WIQ <n0wiq@...> wrote:

From: N0WIQ <n0wiq@...>
Subject: [xbasic] ttyUSBn
To: "XBasic" <xbasic@yahoogroups.com>
Date: Wednesday, November 4, 2009, 3:28 AM

 

Hi Group,

I have a frustration: Is there any way I could check if anything is
connected to a ttyUSB I/O port before I try to read from it.

--
Kerry N0WIQ
My web site URL is:
http://mywebpages. comcast.net/ n0wiq



Messages 18786 - 18815 of 18815   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help