DWomack
Posts: 20
Joined: Thu Jan 30, 2014 11:55 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sun Aug 03, 2014 12:19 pm

Took a image of my running demo version.

Formatted the SD.

Wrote the new image to the SD.

Started the Pi up on the new image. Expanded the image to use all of the SD.

I am running the CoDeSys development software in a Virtual machine. The Development software didn't like some of the libraries in the example WebVisu project I tried to use.

I went and checked the CoDeSys download site, and found there was a new version of the development software. I installed that in the VM and now everything is fine. No complaints about library versions.

I sent the example project to the Pi and it runs as it should in demo mode. After two hours it stops and CPU usage is really high. 80%+

I rebooted the Pi and set about to apply the license Ticket I received when I paid the license fee.

I applied the license Ticket as the pdf said, and then rebooted the Pi.

Still following the supplied instructions, I backed up the applied license file. It is about 180 KB file!

This license only works on this particular Pi.

It is important to go through this backup procedure, as the Pi SD can be corrupted by a power loss at the wrong time.

CPU usage on the WebVisu example project is about 17%, this is higher that the original demo, but the demo didn't have some features implemented yet.

Connecting to the Pi with a browser increases CPU usage by about 6%. The second browser connection adds another couple of percent.

More testing to follow.


Dennis

DWomack
Posts: 20
Joined: Thu Jan 30, 2014 11:55 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sat Aug 09, 2014 3:00 pm

I was pointed to a couple of really good YouTube videos regarding CoDeSys.

This one goes through step by step how to install on the Pi and setup ModbusTCP...

https://www.youtube.com/watch?v=_MeQBfQObgk

This one shows how to use EtherCat...

https://www.youtube.com/watch?nnotation ... 4ePFqxqTfY

They both are worth watching. Turn the sound on and go full screen.

The author of both YouTube posts must work for Wago. He has a lot of CoDeSys tutorial videos.

Enjoy!


Dennis

jciesla
Posts: 1
Joined: Fri May 31, 2013 8:58 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue Aug 19, 2014 1:54 am

Hi guys,

We worked hard this last year for you! Just for your info, we just released an update of IPC platform, compatible for Pi B and Pi B+ with some new fun features like OPC-UA server (Data Access & Historical Data Access), Broadcom SoC watchdog support , Linux scripter (launch linux script from your PLC appli.), and a first draft of a future web HMI. You can visit http://ipc.resologis.com. Have a good fun!

Resologis Team

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue Aug 19, 2014 1:36 pm

Hi everybody

Shame to everyone that looks so greedy to that little miracle!

This is not a Siemens or other Industrial PLC module. Is a free spirit design full of the energy and excitement of so many people.

CODESYS is very very good, maybe IPC by Resologis is good too, but guys what happened to that free spirit and open design of RaPi ?
A lot of people work very hard to bring many goodies around this little thing and you selling 100 and 1000 dollars worth of software on that little miracle just to convert it into a PLC?.

What happened to that open miracle called Beremiz? Is anybody port it yet? I mean not in Linux environment but the run time only module.

When I first started this thread I had "open givings" mostly in my mind and not some "free dirty" demo solutions and the 1000 dollars for the package!

And 3S charges 30 Euros for CODESYS but it is attached only to one particular module.
No! People from 3S. Charge 10 Euros and not tight license with the hardware and be sure that if I use 3 of them I will pay you 30 Euros!. You forget how you started 12 years ago? (I visit you back then in an exhibition). So give to people a chance...
Bus this is just my opinion..

And a better idea!
Not money money money... (because not always funny) but offer the CODESYS, IPC other software FREE for RaPi ( like Beremiz ) or at least with a donation to the RaPI institute.

This type of charge is for commercial companies like WAGO, BERGOF, ABB, SCHNEIDER, BECKHOFF, and many more.. not for this little open miracle which is not an industrial grade product!

That is what I have to say.
I am listening...
Vasilis

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue Aug 19, 2014 8:37 pm

The Raspberry Pi Foundation has made it clear from the get go that it is okay with and encourages commercial applications using the Pi. It would certainly be very cool if someone came along and continued working on creating an open source PLC program for the pi, but the two pieces of software recently mentioned here (ISAGraph and CODESYS) are offering a product at a price that students can actually afford. If you use the ISAGraph option you can use it for free for two hour stretches, combine that with being able to use HMI software like Ignition for 2 hour stretches and for the cost of a couple of pis, you have a distributed, fully operational HMI and programming environment to learn PLCs on. That phenomenal! (Though it looks like ISAGraph is only for windows? So I guess you can't directly program the pi as a PLC from the PI, but these are still steps in the right direction and not really a big deal)
Dear forum: Play nice ;-)

DWomack
Posts: 20
Joined: Thu Jan 30, 2014 11:55 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Thu Sep 04, 2014 10:19 pm

Take a look at this...

http://www.businessinsider.com/momentum ... bot-2014-8

A few RaspberryPi with CoDeSys could control the whole thing.

Ten seconds per burger. Pretty slow process.


Dennis

r12477
Posts: 2
Joined: Sun Nov 23, 2014 9:17 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sun Nov 23, 2014 9:27 am

For what it is worth, I have started working on an open source IEC 61131-3 virtual machine (http://iec61131.wordpress.com) - This project is intended to implement a compiler for IEC 61131-3 textual languages, the output of which is a byte code intended to be run in a small virtual machine also under development as part of this project. As it stands presently, this project has progressed beyond mere aspirations and pie-in-the-sky idealism such that working source code has been developed and committed to source control. Indeed, source code for both the IEC 61131-3 compiler – supporting Instruction List (IL) only – and the corresponding virtual machine has been written, providing a very tangible proof-of-development concept.

Moreover, a Raspberry Pi single board computer and PiFace Digital I/O board has been employed as a test suite for hardware I/O operations - I have just posted a video where an Instruction List (IL) application is running that performs a bit shift of a value through each of the eight output channels on the PiFace Digital I/O board. See https://www.youtube.com/watch?v=a_vYcMlqOW0.

burr13
Posts: 1
Joined: Sun Feb 22, 2015 8:20 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sun Feb 22, 2015 8:39 pm

Has just tested the raspberry with codesys runtime and have a question, does anyone know how to change tcp port number "8080" for the web visualization, can't find anything in the codesys project.

ranpitime
Posts: 73
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sat Feb 28, 2015 5:43 pm

Hi,

you need to add in

/etc/CODESYSControl.cfg

[CmpWebServer]
WebServerPortNr=8081

for example if you want to change it to 8081

BR
ranpitime

ranpitime
Posts: 73
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sat Feb 28, 2015 7:26 pm

There is a new CODESYS plc version for Raspberry Pi available,
What's new?
•Raspberry Pi 2 is supported
•Profinet Master
•OPC UA Server included
•Piface LCD is supported

What is coming next?
CODESYS PI P.L.C as Ethernet IP Adapter (July with 3.5SP7 release)

BR
ranpitime

jascur
Posts: 1
Joined: Wed May 13, 2015 8:04 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Wed May 13, 2015 8:10 pm

Hi everybody I start my adventure with raspberry and codesys and I have some questions.
Do I need license for codesys to create a project for raspbery or can I use trial version with only license for raspberyy image.
If I have license for raspberyy image how many project can I do, many or only one.

ranpitime
Posts: 73
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sun May 17, 2015 8:37 am

Hi,
The CODESYS Developmentsystem is always free of charge, only addons like SVN Integration or UML Integration Static Analysis and Profiler need a license but this is not a must have, for programming in IEC-61131 language like ladder, stuctured text... there is no limitation in the developmentsystem

For the Pi plc, no license is needed, you could use it without license, it runs for 2h (the plc runtime on the pi) then it stops.
You could restart the plc as often you want.
If you want to get rid of this 2h limitation you could buy the license for the CODESYS Pi plc.


BR
ranpitime

ranpitime
Posts: 73
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Wed Jul 29, 2015 7:24 pm

Hi,
There is an update for the CODESYS Raspberry Pi plc is now available:
What is new?
Update of the plc rutime to V3.5.7.0
The package contain Raspberry Pi Update Plugin menu command in CODESYS for easy updating an existing or a new Image
(http://downloads.raspberrypi.org/raspbian_latest) and - scan the Pi and install/Update the plc via CODESYS developmentsystem

How to update?
1. Update the CODESYS development System to Version 3.5SP7
2. If you have an existing Pi and installed Package in an older version update the Version by CODESYS Package Manager
3. Execute 'Update Pi' command under Tools - scan the pi and update the plc runtime

New Features:
-'SysProcessExecuteCommand2' to retrieve output from executed shell command

Which fieldbus are now possible with the CODESYS Raspberry Pi plc:

- CODESYS EtherCAT Master
- CODESYS Profinet Master
- CODESYS Modbus TCP Master / Slave
- CODESYS Modbus RTU Master / Slave
- CANopen via EL6751 Gateway
- CODESYS EtherNet/IP Scanner
- CODESYS EtherNet/IP Adapter
- Profibus Master possible by EL6731 Gateway
- Profibus Slave possible by EL6731 Gateway
- CODESYS OPC/UA Server

BR
ranpitime

MaDeDo
Posts: 4
Joined: Mon Oct 26, 2015 8:59 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Fri Oct 30, 2015 10:04 am

Hello at all,

I'm new in programming my Raspberry Pi with CoDeSys, but unfortunately i have to program it in my internship.
I have the latest versions of CoDeSys-IDE and the CoDeSys Runtime for Raspberry Pi. I'm using the RasPi 2 and jessy-kernel.

In my programm the RasPi runs as EtherCAT-Master. So my question:
I also have to configure Raspbian to use it as EtherCAT-Master or is it sufficient to copy the CoDeSys-Runtime on it?

Thanking you in anticipation


P.S.: Sry for my bad englisch

rotemse
Posts: 1
Joined: Sun Nov 08, 2015 10:32 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sun Nov 08, 2015 10:38 am

Hello,
I use the latest Codesys IDE on Windows (V3.5 SP7).
I downloaded the RPI package from the Codesys-RPI product page.
But there is no image or debian file to install on the RPI. How do I setup the Codesys on the RPI?
When I just scan the network I find nothing...


Thanks in advance.

ranpitime
Posts: 73
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sun Nov 08, 2015 11:50 am

Hi,
there is nothing to configure in Raspbian.
Only install the Debian package which contains the CODESYS runtime to the Raspbian,
that's all.
You have the choice on using the ethercat master on an separate Network (for example usb-nic)
or use the onboard. both is possible.

BR
ranpitime

ranpitime
Posts: 73
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Mon Nov 09, 2015 7:08 pm

Hi rotemse,
you find the Debian package here:
"c:\Users\<yourwindowsUserName>\CODESYS Control for Raspberry PI\codesyscontrol_arm_raspberry_V3.5.7.x.deb"
You could deploy this to the Pi via CODESYS 'Update Pi Command'

or manual install by dpkg....

Regards
ranpitime

cocollective
Posts: 5
Joined: Fri Jul 26, 2013 9:44 pm
Location: Stockholm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue Nov 10, 2015 9:41 am

Hi!

I successfully ran Codesys on my Raspberry Pi with several examples. I wonder though if it is possible to run the application without Codesys running on the PC?

Thanks in advance!

VikTan
Posts: 11
Joined: Wed Nov 11, 2015 2:36 pm
Location: Bratislava

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Wed Nov 11, 2015 7:49 pm

Hi,
Does anyone have experience with making drivers for CodeSys? We develop hardware for LinuxCNC/Machinekit and we are looking for other field of use for this hardware. This system consist of RasPi2 and of control boards connected by SPI port. We are done with board for 4 stepper motors, IO board for 16in/16out binaries, and board for 4 analog servomotors with encoders is in development. All this boards is based on FPGA and can be used with CodeSys. Little bit more info: https://youtu.be/ZJOIYXu7SeI

If someone can help me to make spi driver for this boards, I would be very grateful for any help
Regards,
Viktor

ranpitime
Posts: 73
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sat Nov 14, 2015 5:46 pm

cocollective wrote:Hi!

I successfully ran Codesys on my Raspberry Pi with several examples. I wonder though if it is possible to run the application without Codesys running on the PC?

Thanks in advance!
Hi,
hm hope I understand you, do you mean run these applications without Pi or do you mean run them on the pi without Login
in and download them from CODESYS?
yes this is possible, you need to change the plc's in the projcet to Control WIn(this is the plc which come with the CODESYS Developmentsystem and could be started in the TaskTray)

BR
ranpitime

ranpitime
Posts: 73
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sat Nov 14, 2015 5:55 pm

VikTan wrote:Hi,
Does anyone have experience with making drivers for CodeSys? We develop hardware for LinuxCNC/Machinekit and we are looking for other field of use for this hardware. This system consist of RasPi2 and of control boards connected by SPI port. We are done with board for 4 stepper motors, IO board for 16in/16out binaries, and board for 4 analog servomotors with encoders is in development. All this boards is based on FPGA and can be used with CodeSys. Little bit more info: https://youtu.be/ZJOIYXu7SeI

If someone can help me to make spi driver for this boards, I would be very grateful for any help
Regards,
Viktor


Hi,

I try to explain how to start;
A good startpoint are the "open" library examples which came with the package.
'c:\Users\<YourWindowsUserName>\CODESYS Control for Raspberry PI\2.2.0.2\Libraries\SPI_MCP3008.library'
'c:\Users\<YourWindowsUserName>\CODESYS Control for Raspberry PI\2.2.0.2\Libraries\SPI_PiFace.library'
the devices which you need to adapt for your device:
'c:\Users\<YourWindowsUserName>\CODESYS Control for Raspberry PI\2.2.0.2\Devices\MCP3008.devdesc.xml'

How to develop your library?
You open two Instances of the CODESYS IDE.
One with the library the other one should open the project to test your device.
Then make changes in the library - install it and check then in the other insctance if it works (you could step into the library code)
by setting brakepoints to the library etc.
See the faq's in the CODESYS Forum. Library development best practice:
(http://forum.codesys.com/viewtopic.php? ... 677#p10677)
Hope this helps. (See the pdf here 'c:\Users\<YourWindowsUserName>\CODESYS Control for Raspberry PI\2.2.0.2\DataSheet\RaspberryPI_en.pdf'
BR

VikTan
Posts: 11
Joined: Wed Nov 11, 2015 2:36 pm
Location: Bratislava

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sat Nov 14, 2015 9:30 pm

I done with all these demos, I can change what to send over SPI port, set message length, etc.
But the real problem is make connection between library and project. In demo PiFace on IO Mapping tab is one byte input and one output. I can't change it. I need to add some bytes more, maybe some different types.

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Mon Nov 23, 2015 5:19 pm

VikTan wrote:Hi,
Does anyone have experience with making drivers for CodeSys?........Little bit more info: https://youtu.be/ZJOIYXu7SeI
r
Hi Viktor
Your work is excellent!

I use CODESYS for living. If you managed to bind your project with CODESYS, many opportunities will come up.
First of all your design looks professional with industrial robustness (in software and hardware). So think the possibilities:
1 - Use it as stand alone EtherCAT Master PLC for CNC controller running PLCOPEN or CODESYS Motion libraries.
Community will love it and can build fantastic PCB milling, CNC, or even 3D prnting and many more.

2 - Use it as EtherCAT slave under a bigger system.
In my work we are using ABB PLCs and ABB drives running CODESYS for powerfull servo control in our machinerry.
Cases arising that in many places we need less powerful servo and step motors (in the range of your design ). It will be nice for us to use an EtherCAT slave package that do the job. Yours fit the specs (if works under CODESYS)

If looks good for us I am sure it will be for others

I can not help you making the drivers because my programming skills in C is not on that level, but I promise to follow you and if in any point have the knowledge to help you I will be glad to do it.

Do not hesitate to send my an email if you like, or to talk about it in Skype

If this go along with a nice price and wrapped with CODESYS you then have a killer product!
Do you have a price tag for your design so far?
Vasilis

VikTan
Posts: 11
Joined: Wed Nov 11, 2015 2:36 pm
Location: Bratislava

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Thu Nov 26, 2015 9:39 am

Thanks for reply, sometimes people need to hear any good feedback to their work. This ethercat is good idea, we can do it like board, where can be option to be master or slave.
We are looking for opportunity for use of same hardware on some different field of use eg. LinuxCNC for controlling CNC machines, CODESYS for automation, it works also like Real Time system with Matlab/Simulink, it could be used like Smart Home Controller. If you have any other idea, let me now about it.
In this time we inquiring Chinese manufacturers and we planning to start with crowdfunding on Indiegogo

We are done with new board, its binary IO with:
- 16 binary inputs ( 0 - 24 Volt ). Inputs are optical isolated
grouped in foursome, every foursome is possible to switch in both polarities 0V or 24V.
- 16 binary outputs( 0 - 24 Volt ). Outputs are optical isolated
grouped in foursome, every foursome is possible to switch in both polarities 0V or 24V. Load up to 2.0 Amp.

Regards
Viktor
Attachments
pidi_3809_02.jpg
pidi_3809_02.jpg (52.52 KiB) Viewed 31676 times
pidi_3809_01.jpg
pidi_3809_01.jpg (41.5 KiB) Viewed 31676 times

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Thu Nov 26, 2015 8:32 pm

VikTan wrote: .......We are done with new board, its binary IO with:
- 16 binary inputs ( 0 - 24 Volt ). Inputs are optical isolated
grouped in foursome, every foursome is possible to switch in both polarities 0V or 24V.
- 16 binary outputs( 0 - 24 Volt ). Outputs are optical isolated......
Oh I could not imagine back in 20 Aug 2011 17:39 when i started this thread "Turn Raspberry Pi into a P.L.C" that today people like VikTan and his company could come up with such a nice product packed with Raspberry.
Congratulations!
I will work close to you if you like just to see you growing and that will be my "payment".
we soon will be in touch and transfer to you my 40 years experience in electronics but mostly inspiring you to produce a really innovative product

When can I have the I/O boards? Are they Codesys driven?
Vasilis

Return to “Other projects”