Page 1 of 1

PureBasicFramwork

Posted: Fri Nov 03, 2023 6:14 pm
by SMaag
Since a while I'm developing a kind of FrameWork for PureBasic. All code is OpenSource and free to use. But until now it's in a brainstorming and developing state.
The goal is to have a reliable base for industrial software development, because in my opinion PureBasic would be a great Tool for industrial Software.
First I tried the BlackBox Component Pascal Framework for industrial software. This is a very great tool under the hood, and the code is nearly identical to the PLC-Programming Code "STL" which can be used to program the most PLC types. But the developemnt of ComponentPascal nearly stopped. PureBasic has this reduced complexity that Nikolaus Wirth demanded for future programming languages. I had a look to Lazarus FreePascal, what is a great Tool and nearly compatible with Delphi. But for the most PLC programmers the full Pascal System is to complex. Visual Studio with the Gigabytes of installation is not the way if you want to install the develpment enviroment on the machines PC.
PureBasic would be one of the best alternatives because of the very good license conditions and a not expensive license. So if necessary it should be no problem to buy a license for each machine PC.

But it will be a long road to realize everything! At the moment this is mostly a winter work for me!

If anyone is out there who want to be part of the development! You are welcome!
There is a lot of work to do.
- writing testcode and search for bugs
- having ideas
- doing optimations

If you want to help there are some works to do (here some examples what I have in mind):
- writing a automatic documenter/helpfile for the functions: I added NAME: DESC: VAR(): to each Procedure
so it can be extracted easy from the SourceCode. Here an expample for the structure I used

Code: Select all

  Procedure.i Calculate_MinMax(*STLobj.TSolid)
  ; ============================================================================
  ; NAME: Calculate_MinMax 
  ; DESC: Calculates Min and Max Coordinates of the STL-Object
  ; DESC: and save it in the STLobj \Min and \Max Vector
  ; VAR(*STLobj.TSolid): Pointer to STL-Solid-Object
  ; RET.i : #TRUE if done
  ; ============================================================================
- Programming a standard Framework Status Form which can be integrated in applications to
show in a TreeView all integrated Moduls an show the documentation for the Modul.

- Maybe programming a Standard Framework-Test-Application

here the link to the Github repository:
https://github.com/Maagic7/PureBasicFrameWork

Re: PureBasicFramwork

Posted: Fri Nov 03, 2023 7:44 pm
by idle
You've put a lot of work into it already by the looks of it. It's well laid out.

Re: PureBasicFramwork

Posted: Fri Nov 03, 2023 9:08 pm
by Fred
That's indeed a lot of code here. What is PLC exactly ?

Re: PureBasicFramwork

Posted: Fri Nov 03, 2023 9:41 pm
by SMaag
That's indeed a lot of code here. What is PLC exactly ?
PLC folder will contain Code to access, for the first, Siemens S7300/400 1200/1500PLC's.
(Thats why I earn my money with that stuff)
I will use OpenSource Libraries Snap7 and libnodave to get access to the PLC's.
The goal is to progamm DataLoggers which are running on a Raspi to archive sensor values and production datas.

https://snap7.sourceforge.net/

https://libnodave.sourceforge.io/
https://sourceforge.net/projects/libnodave/

parallel I try to integrate a ModBus Library what is a relative easy protokoll and it is used by the Wago Controllers, Schneider Electric
and some other Hardware.
With that stuff it should be possible to use PureBasic (on Raspi) for SmartHome integration!

Re: PureBasicFramwork

Posted: Fri Nov 03, 2023 10:17 pm
by idle
SMaag wrote: Fri Nov 03, 2023 9:41 pm
That's indeed a lot of code here. What is PLC exactly ?
PLC folder will contain Code to access, for the first, Siemens S7300/400 1200/1500PLC's.
(Thats why I earn my money with that stuff)
I will use OpenSource Libraries Snap7 and libnodave to get access to the PLC's.
The goal is to progamm DataLoggers which are running on a Raspi to archive sensor values and production datas.
pigpiod is probably the most versatile lib for PI's
viewtopic.php?t=78440
it addresses the noise issues of PWM on the PI, allows GPIO pins for any purpose and also wraps I2C, SPI, and serial links.

Re: PureBasicFramwork

Posted: Fri Nov 03, 2023 10:21 pm
by Kuron
Fred wrote: Fri Nov 03, 2023 9:08 pm That's indeed a lot of code here. What is PLC exactly ?
Usually refers to Programmable Logic Controllers

Re: PureBasicFramwork

Posted: Sun Nov 05, 2023 1:43 am
by mk-soft
For snap7 I have an extended include with various auxiliary functions.
See signature OneDrive ... OneDrive Industry

The FrameWork should also run on all OS.

The snap7 interface actually also runs on an Arm processor. Tested on my Raspberry ;)
The standard Modbus/TCP interface should also be implemented. Need to tidy up here and can provide the client and server Modbus/TCP interface.

Re: PureBasicFramwork

Posted: Sun Nov 05, 2023 1:35 pm
by AZJIO
You simply have a collection of functions that are no worse or better, and not necessarily ideal for every task. You can see my selection here or here.

Re: PureBasicFramwork

Posted: Mon Nov 06, 2023 12:07 am
by Piero
SMaag wrote: Fri Nov 03, 2023 6:14 pm
PLC-Programming Code

- having ideas
- doing optimations
Is that meant to `optimate´ stuxnet? :shock: :P

Re: PureBasicFramwork

Posted: Mon Nov 13, 2023 2:49 pm
by SMaag
AZIJO wrote
You simply have a collection of functions that are no worse or better, and not necessarily ideal for every task. You can see my selection here or here.
Tanks for the link. I didn't know this! And yes you are right, it is a collection of functions. Especally in the lowest level.

mk-soft wrote
For snap7 I have an extended include with various auxiliary functions.
See signature OneDrive ...
Tanks for that link! Especeally because it is OPC communikation. I will try to integrate this!

For ModBus I have a Brainstorming Code (Struture definition only!) ModBus is not that complicated. So it's possible to code it with the standard documentation. (not like 3D-STEP where it is not possible to understand the documentation)

But anyway if you have any working code that you can publish, I will try to integrate it. Code should be OpenSource!

Piero wrote
Is that meant to `optimate´ stuxnet?
Thank God I'm not good enough to program such things. So no one will ask me to do it! :wink: