Getting Start with Codesys Control for Linux SL

Runtime
johnlee
2018-07-12
2019-09-10
  • johnlee

    johnlee - 2018-07-12

    This just serve as documentation how to get start with Codesys Control for Linux SL :-
    Things are needed before start:-
    a. 4GB thumb drive
    b. Internet access(for Debian install)

    1. Download Debian from Debian website
      https://www.debian.org/distrib/netinst

      • I'm using amd64 and version 9 (12/7/2018)
    2. After Download the image then using Win32DiskImager(For Windows User, other os user you may find your own way to do this) burn the Debian ISO file into USB thumb drive
      -Win32DiskImager can download from https://sourceforge.net/projects/win32diskimager/

    3. After success create the Debian USB thumb drive, plug into any pc that you wish to install. Make sure the pc have set boot from USB. Start the PC and wait for the Debian boot up, then choice GUI install.

    4. Follow the step by step and make sure you select SSH enable, set the password for the root account, create a user account and please remember the password cause it very important and you need it later.

    5. Wait for 20 minutes or longer to complete the Debian installation.

    6. Now you have to login your user account where created just now.
      -The interested part is here now, most beginner user on linux always get use with the command "sudo", unlikely the installation I prepare just now is without the "sudo" preinstall , so you have manual to install it and set the right correctly.

      • So click on the "Activities" on the top left corner, on the search bar enter "Terminal", the "Terminal" app will show and click on it
    7. In the terminal step do below thing :-

      • su -
      • enter the root password
      • apt-get install sudo -y <-- Here to get the sudo app from internet and start the installation
      • After apt-get install done we have to set the right for the root and user
      • usermod -aG sudo yourusername
      • repeat above command to add root and your user name
      • Done then exit terminal and restart the Debian
    8. Now your good to using Codesys V3 IDE to install the Codesys Control Linux runtime into the Debian 9

    9. For those have not try raspberry pi codesys, Wago PFC200/PFC100, Siemens IOT before, below are the step to show you how to install the codesys control for linux SL RunTime into Debian.

    10. Download the Codesys Control for Linux SL package files.

    11. Start the Codesys IDE, Go to Tools->Package Manager..-> Install -> Select the Codesys Control for Linux SL package files -> Click open-> click Next and Next until the package is finish install.

    12. Restart the Codesys IDE again( This step is very important). After Restart then go to Tools-> Update Linux..

      • under Login credentials enter yourdebianusername into user name, password into password
      • Under select target - enter the Debian PC ip or you can scan for it(make sure the Debian pc are connect into the same network)
      • Under the Package select Install
      • Just make sure the message windows are show the Codesys Control for Linux SL are complete install.
      • under Runtime click start.
      • under system info click system info to check does the Codesys Runtime is running.
    13. Now you are good to go to have fun on the Codesys Control for Linux SL.

    PS: Edwin please correct me if the sudo are not important? Cause without the sudo I can't get codesys runtime to install on Debian.

     
  • eschwellinger

    eschwellinger - 2018-08-15

    Hi John,

    many thanks for this instructions.
    I appreciate your effort and assistance to make this for many user easier.

    Yes I agree, to have the update tool running, you need sudo/root access.
    BR
    Edwin

     
  • yannickasselin1

    yannickasselin1 - 2018-10-29

    Hi,

    I am trying to install the runtime on Linux Lite (Ubuntu) but I always get the error: No connection to target: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.10.10.91:22.

    I am able to ping the IP Address. Am I missing something?

    Should it be able to run on Ubuntu?

    Maybe it is this part that I don't understand correctly:

    1. In the terminal step do below thing :-
    2. su -
    3. enter the root password
    4. apt-get install sudo -y <-- Here to get the sudo app from internet and start the installation
    5. After apt-get install done we have to set the right for the root and user
    6. usermod -aG sudo yourusername
      - repeat above command to add root and your user name
    7. Done then exit terminal and restart the Debian

    Thank you.

     
  • eschwellinger

    eschwellinger - 2018-10-29

    Hi,
    I have installed Linux SL on an CX2020 with Debian this combination works like charm.

    Could you Login by shh & root? This is needed to use the update tool in CODESYS.
    Most of the Linux distributions do not have a enabled root / ssh login

    How to enable this ( temp- for the install)?

    Root ssh login enable:

    /etc/ssh/sshd_config
    

    PermitRootLogin yes

    /etc/init.d/ssh restart

    Sure you could copy the deb package by scp to the Linux System from
    "c:\Users\<windowsusername>\CODESYS Control for Linux SL\Delivery\codesyscontrol_x64_linux_V3.5.13.0.deb"
    and install it by</windowsusername>

    sudo dpkg -i codesyscontrol_x64_linux_V3.5.13.0.deb

    If you do not want to enable it and use the CODESYS update tool.

    BR
    Edwin

     
  • yannickasselin1

    yannickasselin1 - 2018-10-29

    I fixed part of the problem. I did not have SSH enabled.

    But now I have these errors:

    Maybe I will try to copy it manually.

    IMG: CodesysLinux.png

     
  • yannickasselin1

    yannickasselin1 - 2018-10-29

    I copied it manually and it works.

    I am surprised that the jitter is bigger than on a Raspberry Pi 3!

    I will maybe try to run it on straight Debian.

    It is now running on Linux Lite on a 1 Core Atom processor.

     
  • eschwellinger

    eschwellinger - 2018-10-30

    Hi,
    sure with a standard Linux kernel I would agree,
    you need to apply a rt_preempt patched kernel.
    Even a precompiled for example should do it.

    BR
    Edwin

     
  • yannickasselin1

    yannickasselin1 - 2018-10-30

    Do you know of any pre-compiled rt_preempt linux distro?

     
  • eschwellinger

    eschwellinger - 2018-10-30

    Hi,
    based on Debian (think many other distributions have this too) these precompiled kernels are available.
    Will add some instructions... but some time.
    BR
    Edwin

     
  • yannickasselin1

    yannickasselin1 - 2018-10-30

    Did you forget to write down which precompiled versions are available?

     
  • yannickasselin1

    yannickasselin1 - 2018-11-01

    I finally tried using Straight Debian and I also build a RT Kernel using this great guide:

    https://medium.com/@patdhlk/realtime-linux-e97628b51d5d

    Without the RT patch, the max jitter is around 2 ms.
    With the RT patch, the max jitter is around 1 ms.

    So it does help but it is still not great in my opinion. Maybe because I am using a 1 Core Intel Atom. Maybe I will try with other hardware later.

    It would be nice to have a guide on how to get best performance out of Linux SL:
    - What is the best Linux Distro to use?
    - Are there any configuration to do in order to get the most out of the RT patch?

    It is still a lot of fun to play with and very promising.
    Keep up the good work!

    You know what else would be great? Maybe a little too much to ask but I will anyway... -> A Linux Codesys IDE !!!!!

     
  • eschwellinger

    eschwellinger - 2018-11-01

    Hi,

    I think it should be possible to have <100us Jitter.
    Sure you need to setup a stable cpu clock - check if cpu clock is floating on your device by
    cat  /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    and google it how to set it for performance/stable

    Linux IDE - I know that some users want to see this, but I fear this will not be realized. ( At least not in the near future)

    Zitat:
    It would be nice to have a guide on how to get best performance out of Linux SL:
    - What is the best Linux Distro to use?
    - Are there any configuration to do in order to get the most out of the RT patch?

    I will try to make some advices or faqs (but give me some time)
    Distro - we use Debian and Ubuntu sure you could customize to have them small
    RT_Preempt:
    preompiled kernel is only the first step to get in.
    If you want to have it customized for your machine, just put in what is really needed. (Then test the latency with the cylictest etc)

    BR
    Edwin

     
  • Omar Ampyx

    Omar Ampyx - 2018-11-27

    Edwin Schwellinger hat geschrieben:
    Hi,
    I have installed Linux SL on an CX2020 with Debian this combination works like charm.
    Could you Login by shh & root? This is needed to use the update tool in CODESYS.
    Most of the Linux distributions do not have a enabled root / ssh login
    How to enable this ( temp- for the install)?
    Root ssh login enable:
    /etc/ssh/sshd_config

    /etc/init.d/ssh restart
    Sure you could copy the deb package by scp to the Linux System from
    "c:\Users\<windowsusername>\CODESYS Control for Linux SL\Delivery\codesyscontrol_x64_linux_V3.5.13.0.deb"
    and install it by
    sudo dpkg -i codesyscontrol_x64_linux_V3.5.13.0.deb
    If you do not want to enable it and use the CODESYS update tool.
    BR
    Edwin</windowsusername>

    Hi guys,

    We got also the Linux SL on an CX5120 running Ubuntu after enabling SSH following these instructions:

    https://thishosting.rocks/how-to-enable-ssh-on-ubuntu/

    However, is there a driver for the FPGA running the K-/E-bus?

    Thank you in advance, Omar

     
  • serwatora

    serwatora - 2019-04-24

    Hi, I've installed Codesys linux v3.5.14 runtime on debian (Linux version 4.9.0-8-rt-amd64 PREEMPT RT Debian 4.9.144-3.1).
    There is no problem with runtime or installation. We have written code to test that drives a motor . It worked, motor had been driven normal. But we have seen jitter value very high in IDE monitor. We haven't feel any problem with motor rotation altough we had high jitter value
    Also I have tested same code on linux and windows
    *.
    There was high difference between linux and windows. I couldnt figure out the problem. Do you have some advice to solve this problem.

    PS : I've checked and changed cpu governor, power save mode. It reduced cycle value but jitter value did not fall at the expected rate

    • Servotronix cdhd servo
      ** Linux on left, windows on right

    IMG: Bild

     
  • johnlee

    johnlee - 2019-09-10

    Hi All,

    Just do a little bit update here, recently had done a project using this Linux Codesys.

    So as other user we hope to see Linux version IDE but seem codesys will not make us happy(we always demand more).

    So here have a little bit trick that we can do. Vmware do have version for debian, so you can install vmware on debian, then run win7 vmware image inside the debian. Now you can have the IDE. But it only can use for those quad core processes and need more ram.

    Thank you
    John Lee

     

Log in to post a comment.