LLExec Ubuntu x64

From Axel Public Wiki
Revision as of 10:58, 30 August 2021 by Axelpwiki (talk | contribs) (→‎Ethercat Configuration)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Premises

This wiki page expalains how to download, install and execute LLExec virtual device for Ubuntu x64. With the same installer, 3 different installation are possible, which are:

- Solution A: install LLExec for Ubuntu x64 base (NOT OSADL)
- Solution B: install LLExec for Ubuntu x64 OSADL
- Solution C: install a kernel OSADL and LLExec for Ubuntu x64 OSADL

If some information are not explicitly related to a specific solution, it means that information is valid for all solutions.

Supported Features

  • Generation of immediately executable code upon compiling
  • Hot swap download: allowing you to download the new application without halting the current execution
  • Floating point support: for optimized floating point operations
  • Extended string support: for optimized string operations
  • Extended math support: for optimized math operations
  • Relocatable code: for optimized memory usage
  • Source code download and upload: allowing you to download the project source code on the target and to retrieve it in a second moment
  • Can use SoftScope trace tool
  • On-line debug: advanced debug instrument which allow you to see current symbols value directly inside the editor
  • Triggers and graphic triggers debugging instruments
  • Breakpoints and step debug
  • Synchronous I/O forcing
  • Dynamic check of stack integrity
  • Dynamic check of array validity
  • Dynamic check of pointers validity
  • Object-oriented programming mode


LLExec for Ubuntu x64

Prerequisites

  • If ethercat is needed, an ethercat capable ethernet card is required in addition to the normal network device used for TCP/IP communication. This is tipically done by using the integrated LAN device on your PC motherboard for Ethercat and other network cards (eg. external Pci-X network card device) for TCP/IP network connection (needed by LogicLab GDB connection).

Ethercat tested on:

  "Intel(R) PRO/1000 Network Connection" integrated card, using "e1000e" Linux Kernel driver module
  • To check which card is present and which driver is used on your system, use "dmesg" command and look for device names (eg: "dmesg | eth0")


Solution A (LLExec for Ubuntu x64 NOT OSADL)

  • Configure an Ubuntu x64 base machine

Tested on:

  Ubuntu x64 16.04.5 LTS (4.15.0-66-generic)
  Ubuntu x64 18.04.3 LTS (5.0.0-23-generic)


Solution B (LLExec for Ubuntu x64 OSADL)

  • Configure an Ubuntu x64 machine with OSADL (PREEMPT RT) patch already applied. (See official OSADL documentation at https://www.osadl.org/ for further informations)

Tested on:

  Ubuntu x64 16.04.5 LTS + OSADL Patch 4.13.13-rt5 (Recommended)
  Ubuntu x64 18.04.3 LTS + OSADL Patch 5.0.21-rt16


Solution C (OSADL kernel installation + LLExec for Ubuntu x64 OSADL)

  • Configure an Ubuntu x64 base machine installing OSADL kernel to make it work as an Ubuntu x64 machine with OSADL

Tested on:

  Ubuntu x64 18.04.3 LTS (Recommended)

Installation

  • Download LLExecUbuntuInstaller from Axel website: www.axelsoftware.it/download
  • If you want to use Ethercat, be sure to select a valid ethernet device (to be used as Ethercat master) when asked during the installation.


Solution A (LLExec for Ubuntu x64 NOT OSADL)

  • Launch the installer with the following parameters:
   ./LLExecUbuntuInstaller.sh BASE [destination_dir]

BASE: specifies base Ubuntu x64 version (not OSADL).

[destination dir] is optional, if not used, LLExec will be installed into default path /data/plc.


Solution B (LLExec for Ubuntu x64 OSADL)

  • Launch the installer with the following parameters:
   ./LLExecUbuntuInstaller.sh OSADL [destination_dir]

OSADL: specifies OSADL Ubuntu x64 version (kernel must be already patched).

[destination dir] is optional, if not used, LLExec will be installed into default path /data/plc.


Solution C (OSADL kernel installation + LLExec for Ubuntu x64 OSADL)

  • Launch the installer with the following parameters:
   ./LLExecUbuntuInstaller.sh OSADL_FULL [destination_dir]

OSADL_FULL: specifies that a new kernel with OSADL Patch 5.0.21-rt16 will be installed along with LLExec for OSADL

[destination dir] is optional, if not used, LLExec will be installed into default path /data/plc.

(A system reboot is required after successful installation, at system start up make sure that the correct kernel is executing going to grub menu and selecting kernel version 5.0.21-rt16)

Execution

  • Launch PLC with the command "./runLLExec.sh" executed with root privileges from /data/plc folder to start LLExec with root privileges.
  • Without license, LogicLab will start in DEMO mode: you will have a full working PLC environment for 120 minutes; after that the PLC executions is halted.
    You can restart the demo by restarting your system. If you wish to remove the time limit, ask Axel for license.
  • By default LLExec loads the configuration stored in "LLExecLinux.conf". If you need to load a different configuration file use "LLExec -f <filename.conf>"


LogicLab usage

  • Execute LogicLab from a Windows machine connected to the same network of the LLExec Ubuntu machine.
  • Create a new project using the LLExec PLC runtime (x64_Ubuntu) target
  • Configure the GDB connection using the IP address of the Ubuntu machine (eg. 192.168.1.10), port 5000.
  • Connect to target selecting On-line -> Connect


Ethercat Configuration

  • The network interface that will be used with ethercat needs to be clean from every protocols. Tipically this is done disabling every checkbox from "Edit Connections" in Ubuntu (thus disabling DCHP/IPv6/WoL etc..)
  • After installation, you also have to set up a dummy static IP address (for example 1.2.3.4) for the Ethernet device selected to work as EtherCAT master.

StaticIPSetting.png


  • Ethernet device to be used as ethercat master must be selected during installation; if for any reason you have to change the ehternet device without reinstalling, you must change .conf and .sh files; if that's the case, read the following optional instructions, else skip them:
  • [OPTIONAL] - File "LLExecLinux.conf" needs to be edited with the network card that will be used for Ethercat:
<plugin filename="./LLXPlugin_EtherCAT.so">
     <EtherCAT port=[eth device name]
</plugin></nowiki>

Use the following image as example
EthercatConfig confFile.png


  • [OPTIONAL] - File "runLLExec.sh" needs to be edited with the name of the network card that will be used for Ethercat:
#ECAT_INTF is the name of the network interface dedicated to ETHERCAT
export ECAT_INTF=[eth device name]

Use the following image as example
EthercatConfig shFile.png


In place of [eth device name] you must specify eth interface as seen by Linux OS (Eg: port="enp0s2" will use enp0s2 device for ethercat)

  • you can use "ifconfig" command to know the current names of your network interfaces

Ethercat Master example

  • Import an .esi file with the command "Tools->Import ESI".
  • Click on resources tab of LogicLab, then select the "Ethercat" node and enable it with the checkbox.
  • Right click on the "main network" ethercat node and select "add" to add your imported ethercat device.
  • A new node for the ethercat device will appear, configure it as you like.
  • Save, compile and download the project to the target.