OpenPLC and Graphical Programming with Rasberry PI


19 posts
by samedsoft » Fri Mar 16, 2012 9:01 am
Kids do like graphical programming right?

Can we have an ethernet enabled and open source;  design, code generation, debugging enabled PLC system with Rasberry PI?

Yes, We CAN!

We can use Beremiz open source project and adapt Rasberry PI drivers, make files…

http://www.beremiz.org/

http://www.beremiz.org/documen.....pen-editor

We can even integrate Modbus TCP and EtherCAT protocols for Remote IO"s. CAN bus is already supported..

IEC 61131-3 and PLCOpen will help our kids to be ready for future Automation and Robotics career in their hand. It will lead automation systems to be more affordable and easier to enhance..

http://www.plcopen.org/pages/t.....pt2011.pdf



Posts: 2
Joined: Wed Dec 07, 2011 11:30 am
by ebiian » Sun Jul 22, 2012 11:00 am
is there somebody who has made a project with beremiz ?
User avatar
Posts: 9
Joined: Thu Jul 19, 2012 7:25 am
by vorrias » Tue Feb 12, 2013 8:22 pm
Hello
Nice to see somebody asking that. I was the first one about 1 year ago that startet a discussion on porting BEREMIZ on RASPI. Some may remember me.
That was (and still is) an excelent idea. I abandon the idea because the Beremize project looked abandoned that time. But now as far as I can see is on and working.
I am working now with CoDeSys and CANOPEN (same enviroment) but it is nice to see Beremize on PI. I hope somebody will port it. It will be a greate tool for learning PLCOPEN standards (and do some real project as well with CANOPEN). So I can load it on my RASPI
Vasilis
Posts: 51
Joined: Mon Aug 15, 2011 3:31 pm
by 0x17 » Fri Mar 01, 2013 6:07 pm
Beremiz works on the Raspberry Pi.
I'm now working on a "Proof of Concept", the IO-module is now an Arduino, which is using Modbus.
This weekend I'll write a library for Beremiz (I did it last weekend, but I wrote it in C++, but the Beremiz C-Extensions works only with C (owned)).

I'll give feedback, when it's done (maybe Monday).
Posts: 6
Joined: Thu Jan 24, 2013 2:49 pm
by higgins-demack » Fri Mar 15, 2013 4:35 am
For those who prefer object-oriented, event-driven logic as per IEC 61499 rather than point-oriented, cyclic logic as per IEC 61131, have a look at 4DIAC.org (http://www.fordiac.org/) and their open source IDE and runtime (http://sourceforge.net/projects/fordiac/).

The 4DIAC IDE is Eclipse based - I don't know of anyone who as tried to run it on the RPi, but the runtime called FORTE is written in C++ to the POSIX API and it runs fine on the RPi. I have built and run it myself. To build it, you need to have a recent version of cmake on the RPi.

There are a few little wrinkles in the runtime - if you want any graphical UI components you have to also use the Function Block Development Kit (FBDK) from Holobloc (http://www.holobloc.com/doc/fbdk/index.htm), on a PC (it is Java-based and free for non-commercial use, but not open source). The fact that this is possible is proof of the openness and interoperability of these two products.

I am in the process of developing an input/output function block that will initially read and write the GPIOs on the RPi. When this is finished I aim to publish it through the 4DIAC project. Incidentally, 4DIAC also has function blocks for Lego Mindstorms.
Posts: 13
Joined: Thu Jul 05, 2012 9:01 am
by Nexus12 » Fri Mar 29, 2013 10:00 pm
0x17 wrote:Beremiz works on the Raspberry Pi.
I'm now working on a "Proof of Concept", the IO-module is now an Arduino, which is using Modbus.
This weekend I'll write a library for Beremiz (I did it last weekend, but I wrote it in C++, but the Beremiz C-Extensions works only with C (owned)).

I'll give feedback, when it's done (maybe Monday).

How did you make out creating the library - sounds intriguing
Posts: 10
Joined: Sat Jan 05, 2013 10:37 pm
by 0x17 » Wed Apr 24, 2013 6:19 pm
@Nexus12
I uploaded my project on https://bitbucket.org/espees_plc/espees.
Its the release "v0.1".

It is just now a "Proof of Concept", so don't expect to much.
I only have time on the weekends, so it takes time to complete this project,
but I should release the next version "v0.2" in three or four weeks.
Posts: 6
Joined: Thu Jan 24, 2013 2:49 pm
by zaidpirwani » Sun Apr 28, 2013 3:51 pm
Hi,

I would love to have Beremix working on my Raspi and have it control the IO, however, my project was has external modules for IO, using AVR/Pic controllers. will it be possible to use beremiz code to monitor and control those IO boards... they may be connecte via I2C or RS485...

my project detail can be seen here in this post: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=41&t=455&p=339712#p339712

@vorrias I would LOVE to hear from you about my project and if there is anything new regarding Raspberry Pi and OpenPLC / PLC project.
User avatar
Posts: 25
Joined: Sat Sep 22, 2012 6:18 am
Location: Karachi, Pakistan
by zaidpirwani » Sun Apr 28, 2013 4:00 pm
0x17 wrote:@Nexus12
I uploaded my project on https://bitbucket.org/espees_plc/espees.
Its the release "v0.1".

It is just now a "Proof of Concept", so don't expect to much.
I only have time on the weekends, so it takes time to complete this project,
but I should release the next version "v0.2" in three or four weeks.


I don't have my Pi now, so I will try to try your code later this week, BTW, my IO modules are supposed to be I2C or Rs485 - they may be Arduino or simple AVR or PIC based, haven't decided on the controller yet. will my approach be possible with beremiz, we are not experts at programming but we will try so pelase help out in this matter.

Until then I will try to see what your code does and maybe I will be able to port it for my use.

THANKS..

also, is there anything specific I need to know about when installing beremiz on my Pi, I have the latest Raspbian installed....?

UPDATE: I now have looked at ModBus and still reading, I was mistaking it as something equivalent to RS485... I need to dig deeper... but am I right in saying that: I can send send data in ModBus form over an Rs485 network...?
User avatar
Posts: 25
Joined: Sat Sep 22, 2012 6:18 am
Location: Karachi, Pakistan
by 0x17 » Wed May 01, 2013 8:30 am
UPDATE: I now have looked at ModBus and still reading, I was mistaking it as something equivalent to RS485... I need to dig deeper... but am I right in saying that: I can send send data in ModBus form over an Rs485 network...?


Yes, you can. But be carefully, when you create a RS-485 module. Modbus uses only half-duplex instead of full-duplex (like Profibus).
Posts: 6
Joined: Thu Jan 24, 2013 2:49 pm
by ZArie » Thu May 02, 2013 10:19 am
0x17,
Seems that you are doing well with the Beremiz on PI.
Can the Bermeiz be executed on Windows and its output be loaded to the PI just for doing I/O control ? this in case that no GUI is required.
BR,
Arie
Posts: 5
Joined: Sat Aug 04, 2012 11:15 am
by 0x17 » Thu May 02, 2013 3:21 pm
Yes, you have the application BeremizService (Software-PLC), which can be run without GUI.
With Beremiz you can program the Software-PLC.

Windows is a little more complicated, because I broke it with the libmodbus2 library (no Windows support).
But libmodbus3 should work under Windows, so I'll implement when the project is at a later stage.

And you're right, normally you don't like to program the Software-SPS on the Raspberry Pi itself,
and thats the reason, why I started coding a Client and a Server for the Software-SPS, so you can program it from a Client-PC (will be in next release).

When this is ready then I'll try find a easy way for cross-compiling, because my Software should not only run on the RPI, I wanna support a x86 or x86_64 Ubuntu PC too.
Posts: 6
Joined: Thu Jan 24, 2013 2:49 pm
by zaidpirwani » Thu May 16, 2013 7:40 pm
0x17 wrote:Beremiz works on the Raspberry Pi.
I'm now working on a "Proof of Concept", the IO-module is now an Arduino, which is using Modbus.
This weekend I'll write a library for Beremiz (I did it last weekend, but I wrote it in C++, but the Beremiz C-Extensions works only with C (owned)).

I'll give feedback, when it's done (maybe Monday).



could you share the circuit and code etc so I can at least get it working to where you are and then move from there... THANKS...
User avatar
Posts: 25
Joined: Sat Sep 22, 2012 6:18 am
Location: Karachi, Pakistan
by TonyD » Fri May 17, 2013 1:21 pm
Likewise, sounds a great project would love to see a write up of it
Tony
User avatar
Posts: 343
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
by Ph1lj2 » Thu Jun 13, 2013 2:40 pm
0x17

Hi
I have just tried to install EsPeEs, using the install instruction on bitbucket. Maybe it's me but after executing the 6 sudo instructions, using the either-version I get back

-bash: cd: /path/to/espess_v0.1/: No such file or directory

after executing the cd /path/to/espess_v0.1 as in line 1.

Please let me know what I'm doing wrong

cheers
Posts: 35
Joined: Sat Oct 20, 2012 9:21 pm
by zaidpirwani » Fri Jun 14, 2013 1:43 am
well, I had got it to work just by following the instructions, haven't actually properly used Beremiz yet... I have an exam in a couple hours so I can't check much but I will hopefully get back here later tonight with more info.

Maybe there is something missing or some package not installed, I have installed all of these on my Raspi (http://zaidpirwani.com/1290/raspberry-pi-setting-up-for-electronics-and-development-work/).
User avatar
Posts: 25
Joined: Sat Sep 22, 2012 6:18 am
Location: Karachi, Pakistan
by viper_lasser » Sat Sep 28, 2013 12:31 pm
Can Anybody share some information how to write same program in beremiz, compile it and download it to RPi ?

When I wrote simple program in fbd I can't compile it because beremiz crashed.

How can I write program and later execute it on Rpi ?
How can I can access to specified i/o on rpi

In classicladder we can define input or output by specified string like "/dev/class/gpio/input1"
Posts: 1
Joined: Sat Sep 28, 2013 12:24 pm
by vorrias » Tue Jan 14, 2014 3:27 pm
zaidpirwani wrote:
@vorrias I would LOVE to hear from you about my project and if there is anything new regarding Raspberry Pi and OpenPLC / PLC project.


Hi @zaidpirwani
Hi everybody

I am glad to see the thread I started back in 2011 (making Rpi a PLC) to become so popular. I could not imagine that so many people with so much knowledge and passion accomplished all that. Even CODESYS ported on Rpi

I sent you an email to your blog but you never replay. What is your state of the project now?
Anyway is anybody has it working BEREMIZ on the Rpi using CANOPEN or ETHERCAT ?
Did anybody run it not as a SOFT PLC but downloading the run time to Rpi so no OS is required?
Is SPI and I2C on Rpi working?
I am occupied with some Arduino DUE (because Arduino TRE is coming soon) projects now but I have to white back one of these days back to the old thread.
Posts: 51
Joined: Mon Aug 15, 2011 3:31 pm
by vorrias » Tue Jan 14, 2014 3:37 pm
higgins-demack wrote:
I am in the process of developing an input/output function block that will initially read and write the GPIOs on the RPi. When this is finished I aim to publish it through the 4DIAC project. Incidentally, 4DIAC also has function blocks for Lego Mindstorms.


Hi @higgins-demack
Do you have some more info on that ? looks that IEC 61499 standard is the next step after IEC 61131-3 in PLC or PAC programing. 4DIAC did fantastic work. I like to see it on Rpi and into the next Arduino TRE which is an TI ARM7 board.
I will watching 4DIAC site for projects and any porting about these boards
Posts: 51
Joined: Mon Aug 15, 2011 3:31 pm