As long as those snippets come with vetting, comments, do basic parameter checking, and handle errors in a planned manner, I totally agree. (Sorta like… umm… libraries, actually!)
Like the two examples that were provided by @Ariba for configuring PWM and quadrature counting....and this relative-know-nothing (heck I used a word that I thought meant idiot but I checked and it means something completely different ) is off to the races
Only thing I need to figure-out now is serial comms which don't worry me at all
Fully agree on the points in the initial post. BASIC is a fine language, just suffers from a bad name. Everything is perfectly readable and maintaining old code is so easy. In fact, I boldly claim that BASIC is a much better language than Python (which is S**t in my own view), but... marketing runs the game.
If there was a "new" language 1:1 copy of BASIC, but with some new and fancy name, with enough noise it may well take over.
Pascal is equally nice, and just like BASIC suffers from artificially made bad reputation. Should be much more promoted as a viable choice.
@knivd said:
Fully agree on the points in the initial post. BASIC is a fine language, just suffers from a bad name. Everything is perfectly readable and maintaining old code is so easy. In fact, I boldly claim that BASIC is a much better language than Python (which is S**t in my own view), but... marketing runs the game.
If there was a "new" language 1:1 copy of BASIC, but with some new and fancy name, with enough noise it may well take over.
Pascal is equally nice, and just like BASIC suffers from artificially made bad reputation. Should be much more promoted as a viable choice.
Well, everything that I do is paid-for and therefore, needs to be done in the shortest possible time. I need the Prop for 12-axis, closed loop motion control....absolute breeze with FlexBasic...all running beautifully.
I want an interpreter on the front-end and so I use the Picomite (Micromite Basic interpreter)
My HMI is an Android device because I don't believe in proprietary data-input/output devices in this day and age. Here I use RFO Basic (interpreter) + Mougino's add-on libraries.
All of this Basic stuff adds-up to a product that has no equal and I will accept any challenges
Would you be able to demo your system on P2 Live Forum ?
What you have created sounds awesome, and I reckon a lot of people would be interested.
Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device
Yeah, your right. But I still think the finished concept would be interesting (and inspiring), to see how P2 is actually working in commercial products.
I'll drop a note to Ken with the details so he can reach out to you next time he's planning P2LF schedules.
In the meantime.... Thanks for thinking about doing this!
Would you be able to demo your system on P2 Live Forum ?
What you have created sounds awesome, and I reckon a lot of people would be interested.
Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device
Although I've seen some of your work first hand I'd be interested in seeing more.
It always nice to see another Brit from the North West of England flying the P2 flag
Would you be able to demo your system on P2 Live Forum ?
What you have created sounds awesome, and I reckon a lot of people would be interested.
Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device
How you work, is where the high value is. I would enjoy and benefit from seeing it personally.
@Mickster said:
Nothing more than a simple if a = 3 then a = 5, type of thing. FlexBasic @250MHz was 7.772 million/sec whereas MMBasic was around 100,000/sec
Would you be able to demo your system on P2 Live Forum ?
What you have created sounds awesome, and I reckon a lot of people would be interested.
Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device
Although I've seen some of your work first hand I'd be interested in seeing more.
It always nice to see another Brit from the North West of England flying the P2 flag
Hey buddy.....need to catch-up sometime before BoJo pulls another fast one.
Would you believe that one of the most active members of the MMBasic community is in Leyland?
Would you be able to demo your system on P2 Live Forum ?
What you have created sounds awesome, and I reckon a lot of people would be interested.
Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device
Although I've seen some of your work first hand I'd be interested in seeing more.
It always nice to see another Brit from the North West of England flying the P2 flag
Hey buddy.....need to catch-up sometime before BoJo pulls another fast one.
Would you believe that one of the most active members of the MMBasic community is in Leyland?
Let's see if we can catch up before Christmas then. I'll PM you.
@Mickster said:
I am typing perfectly legible FlexBasic code and it simply works and is readable...I look at code that is written in other languages and it is just effed-up!!!!
Why do we do this?
I became self-employed in 1986, thanks to QuickBasic and have only kicked butt ever since.
BASIC has interpreters AND compilers... Does any other language?
Python. Its all a matter of what you want to do, and how fast you need it to run.
@Mickster said:
I am typing perfectly legible FlexBasic code and it simply works and is readable...I look at code that is written in other languages and it is just effed-up!!!!
Why do we do this?
I became self-employed in 1986, thanks to QuickBasic and have only kicked butt ever since.
BASIC has interpreters AND compilers... Does any other language?
Python. Its all a matter of what you want to do, and how fast you need it to run.
Well, similar to a high-end CNC, there is the real-time system that drives and coordinates the axes and then there's the G-code interpreter that commands the positioning of the axes. In my case, FlexBasic and P2 handle the real-time portion and MMBasic (interpreter) provides the sequence commands that are edited directly on the chip...no need to compile. All that's needed is a VT-100 terminal.
CNC is not really a matter of stupid flat-out speed. What is much more important is consistent speed. When something is supposed to be executed in one millisecond, it shall be done in one millisecond. It is completely useless to design a system that does most of those things in a microsecond and for a few of those things takes a minute, even if the total time is less. S.
You are printing a line that contains a newline, and print itself adds a newline.
I'm not an expert on BASIC, but in the open line you assign the file-descriptor #2 to the opened file. This is an argument for the input statement, as well as the variable in which to read the line into. So the comma is needed to separate these arguments I'd say.
Oh, I think I now understand your question properly. The output only goes until the first comma. I'm as confused as you are about that.
"input n$" reads a string from the file. The data are separated by commas, so if the input data is 1,2,3 then only the "1" gets put into the read string.
Normally to input a complete line of text ignoring commas in most 'Basics' the function "line input#" is used.
Not sure if this is supported in flexbasic
Comments
Libraries promote the effective/consistent reuse of vetted code.
Precisely
As long as those snippets come with vetting, comments, do basic parameter checking, and handle errors in a planned manner, I totally agree. (Sorta like… umm… libraries, actually!)
Like the two examples that were provided by @Ariba for configuring PWM and quadrature counting....and this relative-know-nothing (heck I used a word that I thought meant idiot but I checked and it means something completely different ) is off to the races
Only thing I need to figure-out now is serial comms which don't worry me at all
Fully agree on the points in the initial post. BASIC is a fine language, just suffers from a bad name. Everything is perfectly readable and maintaining old code is so easy. In fact, I boldly claim that BASIC is a much better language than Python (which is S**t in my own view), but... marketing runs the game.
If there was a "new" language 1:1 copy of BASIC, but with some new and fancy name, with enough noise it may well take over.
Pascal is equally nice, and just like BASIC suffers from artificially made bad reputation. Should be much more promoted as a viable choice.
Well, everything that I do is paid-for and therefore, needs to be done in the shortest possible time. I need the Prop for 12-axis, closed loop motion control....absolute breeze with FlexBasic...all running beautifully.
I want an interpreter on the front-end and so I use the Picomite (Micromite Basic interpreter)
My HMI is an Android device because I don't believe in proprietary data-input/output devices in this day and age. Here I use RFO Basic (interpreter) + Mougino's add-on libraries.
All of this Basic stuff adds-up to a product that has no equal and I will accept any challenges
Hi Mickster!
Would you be able to demo your system on P2 Live Forum ?
What you have created sounds awesome, and I reckon a lot of people would be interested.
Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device
Yeah, your right. But I still think the finished concept would be interesting (and inspiring), to see how P2 is actually working in commercial products.
I'll drop a note to Ken with the details so he can reach out to you next time he's planning P2LF schedules.
In the meantime.... Thanks for thinking about doing this!
Although I've seen some of your work first hand I'd be interested in seeing more.
It always nice to see another Brit from the North West of England flying the P2 flag
I just stared testing the Picomite, just out of curiosity do you have a sense of how fast MMBasic is when compared to flexbasic on a p2?
How you work, is where the high value is. I would enjoy and benefit from seeing it personally.
Nothing more than a simple if a = 3 then a = 5, type of thing. FlexBasic @250MHz was 7.772 million/sec whereas MMBasic was around 100,000/sec
Very cool, thanks!
Hey buddy.....need to catch-up sometime before BoJo pulls another fast one.
Would you believe that one of the most active members of the MMBasic community is in Leyland?
Let's see if we can catch up before Christmas then. I'll PM you.
Python. Its all a matter of what you want to do, and how fast you need it to run.
Well, similar to a high-end CNC, there is the real-time system that drives and coordinates the axes and then there's the G-code interpreter that commands the positioning of the axes. In my case, FlexBasic and P2 handle the real-time portion and MMBasic (interpreter) provides the sequence commands that are edited directly on the chip...no need to compile. All that's needed is a VT-100 terminal.
CNC is not really a matter of stupid flat-out speed. What is much more important is consistent speed. When something is supposed to be executed in one millisecond, it shall be done in one millisecond. It is completely useless to design a system that does most of those things in a microsecond and for a few of those things takes a minute, even if the total time is less. S.
Now, FlexBasic can open a file on a SD card and input/output data from it.
(1) why I got every second empty line and what exactly commas do?
This code
returns this:
while the test file looks like this:
(2) Is there any way to list the directory or check if file exists?
You are printing a line that contains a newline, and print itself adds a newline.
I'm not an expert on BASIC, but in the open line you assign the file-descriptor #2 to the opened file. This is an argument for the input statement, as well as the variable in which to read the line into. So the comma is needed to separate these arguments I'd say.
Oh, I think I now understand your question properly. The output only goes until the first comma. I'm as confused as you are about that.
Why do you open the file so often?
"input n$" reads a string from the file. The data are separated by commas, so if the input data is 1,2,3 then only the "1" gets put into the read string.
Now the question is: why it didn't input "2,3,4,5"
Edit.. and then it input "kwas"
Get rid of the for-next and wait for whatever constitutes an EOF, I guess (?)
I open the file once, at the start
How can I wait for something I read from the file?
Hi
Normally to input a complete line of text ignoring commas in most 'Basics' the function "line input#" is used.
Not sure if this is supported in flexbasic
Dave
Could this topic have a more meaningful title?
Starting to look like a youtuber's click-bait, right?