[Gambas-user] PLC programming with gambas3 IDE

Martin Belmonte mbelmonte at belmotek.net
Mon Feb 7 01:08:55 CET 2022


El 6/2/22 a las 21:47, Jussi Lahtinen escribió:
> Arduino is not a PLC, it is a microcontroller with a simple motherboard.
> Two completely different things.
Correct, Arduino board is not a PLC but nevertheless there are 
manufacturers that add to an Arduino board everything necessary for it 
to be one, such as for example:
https://www.controllino.com/product/controllino-mega/

> Also Gambas is compiled to bytecode which is run by the interpreter. It's
> really not possible to make the interpreter work on Arduino (unless you
> strip down most of the functions). Python works similarly, but there is a
> version which compiles python to binary. But using it on microcontrollers
> is generally a very bad idea. A lot of resources are used for very little
> gain.
It may be possible, somehow, to convert the gambas code to C code and 
then compile it and upload it to the arduino board.
The FAST option does that with JIT as you can see in: 
https://gambaswiki.org/wiki/doc/jit#t2

That is, the IDE "makes" C source code and then compiles it.
So, if it is possible to get hold of this C code, it would be possible, 
in theory, to compile it with gcc since this compiler has avr support.

> If you want to program Arduino, learn C. I haven't seen any decent
> alternatives.
You right, using C is the best option, but is not the unique way to 
programing a controller. There are several alternative IDE's to program 
an Arduino board, some of them in visual form.
https://www.controllino.com/software/

Martin.


More information about the User mailing list