RB pi2 - Ethernet adapter

black0609
2016-04-08
2016-04-08
  • black0609 - 2016-04-08

    Hello

    I noticed one "problem" with adding Ethernet adapter to RB - I'm using RB PI 2 - latest PLC and Codesys devlopment.

    If I add Ethernet adapter and I create task with cyclie - 10 ms. At exactly every 1 s interval I have one task in 14ms and after this one it is one with 6 ms. And then it repeat it self - it is a bit dificult to have some acurate calculation or to run PID...

    On this Ethernet adapter I'm running Modbus TCP master and I connected one slave.

    Then I managed to add another task with same settings but higher priority and make IO exchange of my Modbus tcp slave to do it by this task - (task deployment was set on second task) This task did not have this "1s" problem.

    It is visible that first task has every 1s 4ms long task execution. I also did some trace where is clearly visible that every second I have cycles with different cycle lengths.

    Interesting is that this problem is present imediatly when you add Ethernet adapter and attach it to eth0.

    I 'll attach project and pictures later today.

    Is there some explenation?

    Thank You.

     
  • black0609 - 2016-04-08

    Hello

    In attachment there are files (pictures and project). In this example I'm rotating and encoder. Lover graph is reading encoder value and upper graph is recalculated difference between encoder value saved in previous cycle and current encoder value (visible from program).

    In "non_working" pictures it is clearly visible that every 1s there is spike. In enlarged picture it is visible that selected task of 10 ms is not executed in 10, but in on is 14 ms and next one is 6 ms. I tried to put watchdog to 11 ms but nothing happened.

    Any explanation about his behavior?

    Thank You

    problem.zip [483.62 KiB]

     

Log in to post a comment.