Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Possible Compiler Error - Program Memory Data/BasicX Option

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
cloxwerx



Joined: 01 Dec 2005
Posts: 37
Location: Tucson, Arizona

Posted: 04 December 2005, 5:48 AM    Post subject: Possible Compiler Error - Program Memory Data/BasicX Option Reply with quote

I get a compiler complaint about "in-line initializers are only supported in native mode" when compiling the following in BasicX mode.

Code:
option explicit
option language BasicX

Public SETNMEA4800    As New ByteVectorData   'GPS command to enter NMEA mode at 4800 baud
Public SETRESET    As New ByteVectorData    'GPS command for factory settings

Public Sub Main ()
Call SETNMEA4800.Source("SETNMEA4800.TXT")   'Load (at compile) NMEA and 4800 baud GPS command
Call SETRESET.Source("SETRESET.TXT")         'Load (at compile) GPS reset to factory setting
End Sub


Dennis
Back to top
mikep



Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX

Posted: 04 December 2005, 6:04 AM    Post subject: Reply with quote

Unfortunately the other type of BasicX block data initialization doesn't work either (shown below).
Code:
option explicit
option language BasicX

Public SETNMEA4800    As New ByteVectorData ("Data.Txt") 'GPS command to enter NMEA mode at 4800 baud

Public Sub Main ()
'Call SETNMEA4800.Source("DATA.TXT")   'Load (at compile) NMEA and 4800 baud GPS command
End Sub

All is fine when the Option Language is commented out.

Mike
http://home.austin.rr.com/perks/micros/


Last edited by mikep on 04 December 2005, 19:32 PM; edited 1 time in total
Back to top
pdubinsky



Joined: 25 Nov 2005
Posts: 66
Location: South Carolina

Posted: 04 December 2005, 13:33 PM    Post subject: Re: Possible Compiler Error - Program Memory Data/BasicX Opt Reply with quote

Dennis,

Which GPS are you using? I've just started working with a Laipac G-30 and the code snippet that you posted looked like a SiRF command to get the rcvr out of SiRF mode and into NWEA mode. I'm attempting to do that to limit the G-30 to sending only RMC msgs. Can (will) you share any thoughts, tips, gotchas, code?

Thx,
Paul


cloxwerx wrote:

....
Code:
option explicit
option language BasicX

Public SETNMEA4800    As New ByteVectorData   'GPS command to enter NMEA mode at 4800 baud

....


Dennis
Back to top
cloxwerx



Joined: 01 Dec 2005
Posts: 37
Location: Tucson, Arizona

Posted: 04 December 2005, 16:08 PM    Post subject: Reply with quote

Paul,

Using a BX-24 I built an amateur radio project that worked with a MicroBlox PS1E GPS (SIRF compatible). The process was to get NMEA sentences, parse them and periodically transmit APRS sentences via a radio/modem combination. There's a lot of code and it's well documented so you may find it useful to see how I worked with the GPS to talk to it in SIRF mode and get it to NMEA mode. I zipped the BX-24 source and associated files and you can get it at:
http://members.cox.net/desertlavender/basicx/APRSPS1E2T/APRSPS1E2T.zip

An article describing the project hardware and software was published in "QEX" in the Jan-Feb 2005 issue.

If you have any questions I'd be happy to help out.

Dennis
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 04 December 2005, 17:26 PM    Post subject: Reply with quote

Quote:
in-line initializers are only supported in native mode


Error confirmed and resolved. Thanks.

It appears that the only workaround is to not use BasicX compatibility mode. Is there a particular reason why you are using that mode? One reason for doing so is to ensure that your program remains backward compatible with BasicX. Other than that, there is no advantage that I see and there are significant disadvantages. The main one is that the expanded capabilities of ZBasic are not available but, also, RAM is used less efficiently. In particular, strings are not allocated dynamically, unused variables are not eliminated and true block scoping of variables in a procedure (that allows space to be re-used) is not implemented.
Back to top
cloxwerx



Joined: 01 Dec 2005
Posts: 37
Location: Tucson, Arizona

Posted: 04 December 2005, 20:22 PM    Post subject: Reply with quote

Don,

I'm in tune with all the reasons for wanting to use the ZBasic native mode. I have a number of BasicX programs and a large one in particular that stretches the limits of the BX-24. I will be changing it over to native mode to enhance it. Meanwhile, I was curious as to how compatible the two compilers/chips are so that any/most mods to the program will work on both.

Should I continue with the assumption that you want to be made aware of compatibility problems if they are not documented as differences even when in "option Language BasicX" mode?

Best regards,

Dennis
Back to top
pdubinsky



Joined: 25 Nov 2005
Posts: 66
Location: South Carolina

Posted: 04 December 2005, 21:19 PM    Post subject: Reply with quote

Dennis,


Thanks for the quick response. This my first try at using a GPS with
this small a processor and I've hesitated to try it on the BX-24
because of the RAM requirements and the native speed of the BX-24.
Now with the ZX-24, it's a whole new (and exciting) ball game so the
project has come back to light. When we get a little farther, I'll
post and update.


Thx, again,
Paul


At

cloxwerx wrote:
Paul,

Using a BX-24 I built an amateur radio project that worked with a MicroBlox PS1E GPS (SIRF compatible). The process was to get NMEA sentences, parse them and periodically transmit APRS sentences via a radio/modem combination. There's a lot of code and it's well documented so you may find it useful to see how I worked with the GPS to talk to it in SIRF mode and get it to NMEA mode. I zipped the BX-24 source and associated files and you can get it at:
http://members.cox.net/desertlavender/basicx/APRSPS1E2T/APRSPS1E2T.zip

An article describing the project hardware and software was published in "QEX" in the Jan-Feb 2005 issue.

If you have any questions I'd be happy to help out.

Dennis
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 04 December 2005, 23:06 PM    Post subject: Reply with quote

Quote:
Should I continue with the assumption that you want to be made aware of compatibility problems if they are not documented as differences even when in "option Language BasicX" mode?
Yes, indeed.

The goal is to be able to compile, with no changes, as many BasicX programs as possible. If changes are required, it should be because of inherent limitations that make it impossible or impractical to be otherwise. Examples of such inherent limitations are that the time units of InputCapture are one half that of BasicX and that the SPI clock is twice the frequency for the same value supplied to OpenSPI.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group