What is the value???
AIman
Posts: 531
·· I am becoming increasingly confused about why people are trying to write or find ways to work with a language outside of Pbasic for the BS2. Since the BS2 is limited in memory and only uses Pbasic, what value is there in creating an interface between·Pbasic and·different·languages?
·· It makes no sense to me to write a program that requires conversion when we still have to use the same language·in the end. My understanding is that the BS2 will not accepted downloads during realtime functions but must be programed, and since it won't·slave to something·why waste the extra lines of code? In short,·what value is there in writing a program that must contain extra code and still end up in Pbasic.
·· I don't get it.
Could someone please explain this to me?
·· It makes no sense to me to write a program that requires conversion when we still have to use the same language·in the end. My understanding is that the BS2 will not accepted downloads during realtime functions but must be programed, and since it won't·slave to something·why waste the extra lines of code? In short,·what value is there in writing a program that must contain extra code and still end up in Pbasic.
·· I don't get it.
Could someone please explain this to me?
Comments
I think the overriding answer is that another language is like a 'security blanket'. All of my children had special blankets to snuggle and to nap with...any other would give them the fits. For example, this is very easy and natural for me...
Now, if I have been doing this for 15 years or so, then the following way of typing can be really wierd...
Anyway, I wouldn't be hard on folks who want to program the BS2 using different languages. It's all about preference.
Regards,
ChuckB
PBasic only runs on the Basic Stamp, and there are millions of other systems out there that people might want to interface with a Basic Stamp. Except for other Parallax Basic Stamps, none of those systems can be programmed in PBasic. So if somebody want to create an interface between a Basic Stamp & a PC for some reason, you have to deal with a minimum of 2 systems, and 2 languages.
Even if Parallax created a version of PBasic that could run on a PC, you would still find differences and/or limitations when compared with other languages. For example, Spin is a language written for a very specific purpose, because other languages didn't meet the established design requirements. Most languages have been developed for similar reasons.
Perhaps the closest comparison that you could make with the Basic Stamp is the Javelin Stamp. It has specs very close to the other Stamps using the SX48 processor, but the diffences between PBasic & Javelin Java are considerable. There are some things that you could probably do more easily in PBasic, but there are things the Javelin can do that the Basic Stamp can't, simply because of the differences in language.
Does Pbasic have a work around with this?
If one has to learn Pbasic anyway, then why do two languages? If you can write in C or VBA and run it in PBasic then it makes sense to do it that way, however if there is no way to write in C and download in Pbasic then aren't people doing twice the work?
For example I have to go make a transition by using this code
Set System = CreateObject("EXTRA.System")·· ' Gets the system object
If (System Is Nothing) Then MsgBox "Could not create the EXTRA System object.· Stopping macro playback.": Stop
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then: MsgBox "Could not create the Sessions collection object.· Stopping macro playback.": Stop
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then MsgBox "Could not create the Session object.· Stopping macro playback.": Stop
And then start using the other language.
Can Pbasic tolerate a transition like that? If it could then we could easily setup and use most any system to download and/or work with Pbasic, but again, we still aren't getting out of the way of using Pbasic? And how would we set up a reference library?
As I stated, the ONLY computers that can be programmed using the PBasic language are the Parallax Basic Stamps. Also, the ONLY language that can be used to program the Parallax Basic Stamps is PBasic. Its very similar in that respect to the Spin language and the Propeller chip - one language & one platform to run it on.
When you're dealing with other languages and platforms, you have more options. So for instance, there are dozens of languages that you can use for programming MS Windows, but PBasic isn't one of them. That doesn't mean that you can't get a PC and Basic Stamp to communicate with each other. The way you do it is through some form of communications protocol that both systems can recognized and understand.
With PBasic,
If I send something into mass manufacturing, and all I have is PBasic...the guy on the end of the assembly line who programs the chips can EASY accidentally change something in the code (comment something out)·and program 1000+ units wrong.· He can also copy/paste the code, and make his own project.
But with a compiler...I can use a 3rd party program to encrypt and lock my code.· That way nobody can change it or take it.· I can save it as a .hex file or anything else.· I can make a small program that decrypts my pbasic file, download it, and verify it...all without the guy on the end of the line knowing what the code looks like or how to 'open' it.
This will prevent errors on the line, and keep your product as you intended it.
Be that as it may, it is harder to steal code from a preprogrammed PIC or SX chip than from a Stamp, but someone would have to want to really badly to put the effort in to do so. It's probably much easier to steal your laptop or desktop computer or go through your trash for old printouts, etc. if it's that important.
Ideally I would like to get my PC and the BS2 to talk with each other. I can't get the BS2 to accept realtime uploads but I am thinking I might be able to get a wireless link on my desktop and then program the stamp to stop at certain points in a procedure or in the house and request a new program download. It would be slower, but I could potentially use a much larger program to accomplish things instead of having to worry about lines of code.
If memory serves we are limited to 800 lines of code in the BS2 but I could be wrong. Regardless, with using a wireless download I could conceivable write whatever I wanted so long as the downloads were timed at non-crucial junctions.
If you want to remotely program your Stamp, you should be able to do it with the tokenizer mentioned by Mike Green. The tokenizer won't do it directly, but you can write a program that uses the tokenizer to compile(tokenize) your PBasic code and then upload it to your Stamp. It would be sort of like remote-controlling the Stamp IDE.
I'm not too clear on the overall benefit, however, since your PBasic program will be designed to control the circuitry connected to the Stamp, which you wouldn't be able to change remotely.