Raspberry Pi EtherCAT: Difference between revisions

From Axel Public Wiki
Jump to navigation Jump to search
(Created page with "Following these instructions, you can turn your Raspberry PI B or B+ into a complete IEC-61131 PLC. __TOC__ === Hardware Setup === The LLExec PLC runtime has been tested on Ra...")
 
No edit summary
Line 1: Line 1:
Following these instructions, you can turn your Raspberry PI B or B+ into a complete IEC-61131 PLC.
Following these instructions, you can turn your Raspberry PI 3 or newer into a complete IEC-61131 PLC with EtherCAT support.
The Ethernet Port will be turned into an EtherCAT port while connctivity with Logic Lab can be done via Wifi.
__TOC__
__TOC__
=== Hardware Setup ===
=== Hardware Setup ===
The LLExec PLC runtime has been tested on Raspberry PI Model B and B+, Raspberry PI 2 model B and Raspberry PI 3 model B, with I/O expansions PIFace or PIFace Digital 2, depending on the model of Raspberry PI.
For the EtherCAT version of the runtime only Raspberry PI 3 with WiFi is supported.
The runtime PLC runs even without I/O expansion, it can be used to drive standard fieldbus modules, following the Modbus TCP standard. It can be used to drive Modbus RTU devices as well, but you need an external and supported (by raspbian) RS485 to USB device.
Also the runtime is available only via a prebuilt SD card image.
It also requires an SD or uSD at least 8GB to program the modified Raspbian
It requires an SD or uSD at least 8GB.
image.


=== Software Setup ===
=== Software Setup ===
You can proceed in two alternative ways:
* Install LLExec PLC runtime on a standard Raspbian image.
* '''(3)''' Program a SD or uSD card with a full Raspbian image, already configured to run LLExec PLC runtime.
Go to section '''(5)''' Get the licence
* '''(4)''' Install LLExec PLC runtime on a standard Raspbian image.
Follow one of the two options, then go to section '''(5)''' Get the free licence


== Program a SD or uSD card with a full Raspbian image, already configured to run LLExec PLC runtime ==
== Program a SD or uSD card with a full Raspbian image, already configured to run LLExec PLC runtime ==
The image is used to program an SD card, containing:
The image is used to program an SD card, containing:
* the Raspbian distribution
* the Raspbian distribution
* a modified version of the kernel that allows more accurate timing when used with PIFace I/O expansions and only on Raspberry PI models 1.
* the LLExec PLC runtime with Wifi enabled and EtherCAT.
Note: if you are using Raspberry PI 2 or 3, this kernel is not needed.
* the LLExec PLC runtime


=== Download image ===
=== Download image ===
You can download the file '''rasppi_190613_raspbian_plc_nodered.rar''' from our site at url:
You can download the file '''rasppi_190724_raspbian_plc_nodered_ecat.rar''' from our site at url:
  http://www.axelsoftware.it/pwiki/pub/rasppi_190613_raspbian_plc_nodered.rar
  http://www.axelsoftware.it/pwiki/pub/rasppi_190724_raspbian_plc_nodered_ecat.rar
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"
| SHA-256
| SHA-256
Line 35: Line 31:
Using the preferred utility (eg. Win32DiskImager), write rasppi.img into an  
Using the preferred utility (eg. Win32DiskImager), write rasppi.img into an  
SD card or uSD.
SD card or uSD.
=== Configure the Wifi ===
Please mount the SD on a Linux PC, or boot the Raspberry PI with monitor and keyboard.
Modify the file /etc/wpa_supplicant/wpa_supplicant.conf as required by your wireless network.


=== Login into the system ===
=== Login into the system ===
Login as user '''pi''', password '''axel'''
Login as user '''pi''', password '''axel'''
== Install LLExec PLC runtime on a standard Raspbian image ==
With this procedure you can install the runtime Exec in a existing Raspberry PI Raspbian image.
With this procedure you will have less precise timings when using PIFace I/O expansions and Raspberry PI models 1.
=== Download the runtime ===
You can download the latest PLC runtime from our website '''[http://www.axelsoftware.it axelsoftware.it]''' from the Downloads section.
In the Downloads section expand the list '''Software -> Runtimes''' and please
select '''LLExec for RaspberryPI (Linux ARM)'''
=== Unzip the runtime ===
Use the preferred utility to decompress the archive (eg. WinRAR)
=== Copy the entire directory plc on Raspberry PI ===
Copy in the default path that is '''/data/plc''' , and make sure the file '''LLExec''' has execute permissions.
=== Create a standard startup script ===
As an example the included '''LLExecDaemon''' can be used, and hook it to the init sequence.
This script will change the current directory to '''/data/plc''' and launch the file '''./LLExec''', with root permissions - required.
sudo cp /data/plc/LLExecDaemon /etc/init.d
sudo ln -s /etc/init.d/LLExecDaemon /etc/rc5.d
=== Enable SPI driver (optional) ===
This step is necessary only if you use a PIFace expansion card.
Run the command
sudo raspi-config
Click the '''Advanced options'''
Choose the '''A6 SPI''' and press '''Yes''' for the SPI interface to be enabled at startup.
=== Configure the network ===
Change the file '''/etc/network/interfaces''' in order to assign your preferred IP address.
== Installation and first use of LogicLab ==
=== Downloads of LogicLab Automation Suite ===
Go to our website '''[http://www.axelsoftware.it axelsoftware.it]''',
In the '''Downloads''' section expand the list '''Software -> LogicLab Automation Suite'''
Download the file '''LogicLab Automation Suite'''
=== Install the setup ===
=== Launch LogicLab ===
Press '''New Project'''
Select target '''Raspberry Pi 1.1'''
Give the project a name and press the '''OK''' button.
* From the menu '''On-line''' select '''Setup communication'''.
Select the protocol '''GDB''', then press the '''Properties''' button.
* Change the IP address, with your Raspberry PI one and confirm.
* Choose '''Connect''' from the menu '''Online''':
If everything went correctly, you should see the green word '''Connected''' on
the status bar in the lower right corner of LogicLab


== Demo mode and licensing ==
== Demo mode and licensing ==
Line 100: Line 45:
*<b>Free licenses</b> that will be offered ONLY after presenting a detailed description of the purpose of the license.If you need it for <u>educational purpose</u> please introduce you, your school and your class project including teacher references.<br><b>PLEASE NOTE: any incomplete request will be denied</b>.
*<b>Free licenses</b> that will be offered ONLY after presenting a detailed description of the purpose of the license.If you need it for <u>educational purpose</u> please introduce you, your school and your class project including teacher references.<br><b>PLEASE NOTE: any incomplete request will be denied</b>.
*Commercial license: please ask for a quotation.<br><br>
*Commercial license: please ask for a quotation.<br><br>
<b>In any case specify that EtherCAT License is required</b><br>


To request a license you need first to retrieve your HardwareID. On LogicLab switch to the tab "Resources", then click on the root node "Raspberry PI".
To request a license you need first to retrieve your HardwareID. On LogicLab switch to the tab "Resources", then click on the root node "Raspberry PI".
Line 127: Line 73:
* then press '''q''' to quit AlTracePrint
* then press '''q''' to quit AlTracePrint
* send us the log file you saved
* send us the log file you saved
== Extend runtime ==
Please consult the page [[Raspberry Pi Dev]]


== Support ==
== Support ==

Revision as of 17:13, 24 July 2019

Following these instructions, you can turn your Raspberry PI 3 or newer into a complete IEC-61131 PLC with EtherCAT support. The Ethernet Port will be turned into an EtherCAT port while connctivity with Logic Lab can be done via Wifi.

Hardware Setup

For the EtherCAT version of the runtime only Raspberry PI 3 with WiFi is supported. Also the runtime is available only via a prebuilt SD card image. It requires an SD or uSD at least 8GB.

Software Setup

  • Install LLExec PLC runtime on a standard Raspbian image.

Go to section (5) Get the licence

Program a SD or uSD card with a full Raspbian image, already configured to run LLExec PLC runtime

The image is used to program an SD card, containing:

  • the Raspbian distribution
  • the LLExec PLC runtime with Wifi enabled and EtherCAT.

Download image

You can download the file rasppi_190724_raspbian_plc_nodered_ecat.rar from our site at url:

http://www.axelsoftware.it/pwiki/pub/rasppi_190724_raspbian_plc_nodered_ecat.rar

Unzip the image

Use the preferred utility to decompress the archive (eg. WinRAR)

Program an SD or uSB (at least 8 GB)

Using the preferred utility (eg. Win32DiskImager), write rasppi.img into an SD card or uSD.

Configure the Wifi

Please mount the SD on a Linux PC, or boot the Raspberry PI with monitor and keyboard. Modify the file /etc/wpa_supplicant/wpa_supplicant.conf as required by your wireless network.

Login into the system

Login as user pi, password axel

Demo mode and licensing

The LLExec runtime will run in demo-mode: this means that is fully operational for 30 minutes.
After this time is expired, is required to reboot the Raspberry PI.

To obtain a full license you can ask for:

  • Free licenses that will be offered ONLY after presenting a detailed description of the purpose of the license.If you need it for educational purpose please introduce you, your school and your class project including teacher references.
    PLEASE NOTE: any incomplete request will be denied.
  • Commercial license: please ask for a quotation.

In any case specify that EtherCAT License is required

To request a license you need first to retrieve your HardwareID. On LogicLab switch to the tab "Resources", then click on the root node "Raspberry PI". This will open a window, if the device is connected, you will see "Status: Not licensed". Please click '"Read"' on HardwareID field, then sent that string to support@axelsw.it.


More informations

For more information you can consult the online manual, or follow our tutorials available in the news section of the website or on YouTube by following the link below:

https://www.youtube.com/user/Axelsrl

In case of troubles: save a Log File

In the case of any trouble, you can save the log file, this file can be sent to support@axelsw.it Steps:

  • login into the Raspberry PI
  • acquire root priviledges
sudo -s
  • go to directory /data/plc
  • launch ./AlTracePrint LLExec
  • press s
  • insert the preferred filename
  • then press q to quit AlTracePrint
  • send us the log file you saved

Support

For any technical issue please send an email support@axelsw.it