Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » E_CYCLE don't generate events on every DT?(I can't get E_CYCLE to generate events every 10 ms)
E_CYCLE don't generate events on every DT? [message #1810861] Tue, 20 August 2019 19:09 Go to next message
Adi Wasturaka is currently offline Adi WasturakaFriend
Messages: 3
Registered: August 2019
Junior Member
Greetings

I am currently working on a project about building a monitoring system based on 4DIAC using raspberry pi.

The system I am trying to monitor is actually only an anemometer sensor which generates pulsing 1s and 0s which its pulse rate depends on how fast the wind blows.

What i tried is I connected an E_CYCLE block to an IX block, connect the sensor's output physically to a GPIO pin and tried to read the IN count (in IX block). Since the IN only updates whenever the REQ got input event, the E_CYCLE will do the job to continuously trigger the REQ in IX for every short period of time.

I tried to dial in 500ms to DT and the system runs (the IN updates). But DT=500ms is not enough for my device since anemometer spins quite fast and reading the data every half a second won't do the job accurately.

I tried to dial 10 ms. But instead of updating the IN, the EO stopped generating events at count 10, therefore the IX block is not started and the IN count stopped.

Is there any solution for this? Did I do the correct approach for my needs?

Thanks!
Re: E_CYCLE don't generate events on every DT? [message #1810963 is a reply to message #1810861] Thu, 22 August 2019 17:01 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 908
Registered: January 2014
Senior Member
This is rather strange. I could only imagine that the IN implementation has an issue taking longer then 10ms, which is also bad. Do you get any output on the console?

We should really bring the sysfs io system to the new IO system design. There the IO scanning would run in a seperate thread and the IX would send IND on each state change/scan cycle. However we haven't found time yet. If there is someone out there who would like to do that let me know.

Alois
Re: E_CYCLE don't generate events on every DT? [message #1811001 is a reply to message #1810963] Fri, 23 August 2019 11:43 Go to previous messageGo to next message
Adi Wasturaka is currently offline Adi WasturakaFriend
Messages: 3
Registered: August 2019
Junior Member
the deployment console shows only this:

<!-- 192.168.1.13:61499 -->
<Request Action="QUERY" ID="0">
  <FB Name="*" Type="*"/>
</Request>

<Response ID="0">
    
  <FBList>
        
    <FB name="tesledkeground" type="EMB_RES"/>
      
  </FBList>
  
</Response>


<!-- 192.168.1.13:61499 -->
<Request Action="KILL" ID="1">
  <FB Name="tesledkeground" Type=""/>
</Request>

<Response ID="1"/>


<!-- 192.168.1.13:61499 -->
<Request Action="DELETE" ID="2">
  <FB Name="tesledkeground" Type=""/>
</Request>

<Response ID="2"/>


<!-- 192.168.1.13:61499 -->
<Request Action="CREATE" ID="3">
  <FB Name="tesledkeground" Type="EMB_RES"/>
</Request>

<Response ID="3"/>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="CREATE" ID="4">
  <FB Name="IX" Type="IX"/>
</Request>

<Response ID="4"/>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="WRITE" ID="5">
  <Connection Destination="IX.QI" Source="true"/>
</Request>

<Response ID="5">
  
</Response>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="WRITE" ID="6">
  <Connection Destination="IX.PARAMS" Source="26"/>
</Request>

<Response ID="6">
  
</Response>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="CREATE" ID="7">
  <FB Name="E_CYCLE_0" Type="E_CYCLE"/>
</Request>

<Response ID="7"/>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="WRITE" ID="8">
  <Connection Destination="E_CYCLE_0.DT" Source="t#250ms"/>
</Request>

<Response ID="8">
  
</Response>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="CREATE" ID="9">
  <Connection Destination="E_CYCLE_0.START" Source="START.COLD"/>
</Request>

<Response ID="9"/>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="CREATE" ID="10">
  <Connection Destination="E_CYCLE_0.START" Source="START.WARM"/>
</Request>

<Response ID="10"/>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="CREATE" ID="11">
  <Connection Destination="E_CYCLE_0.STOP" Source="START.STOP"/>
</Request>

<Response ID="11"/>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="CREATE" ID="12">
  <Connection Destination="IX.REQ" Source="E_CYCLE_0.EO"/>
</Request>

<Response ID="12"/>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="CREATE" ID="13">
  <Connection Destination="IX.INIT" Source="START.COLD"/>
</Request>

<Response ID="13"/>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="CREATE" ID="14">
  <Connection Destination="IX.INIT" Source="START.WARM"/>
</Request>

<Response ID="14"/>


<!-- 192.168.1.13:61499: tesledkeground -->
<Request Action="START" ID="15"/>

<Response ID="15"/>


if the DT is 250ms, monitored system showed something like this and the IN changes state as my anemometer spins:

https://ibb.co/6H6rB5n

when DT is as fast as 100ms the E_CYCLE stopped generating, let alone achieving 10ms:

https://ibb.co/pdY0bNR


is there any alternative approach you guys recommend to accomplish my task? any help would be very much appreciated!

[Updated on: Fri, 23 August 2019 11:59]

Report message to a moderator

Re: E_CYCLE don't generate events on every DT? [message #1811003 is a reply to message #1811001] Fri, 23 August 2019 12:41 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 908
Registered: January 2014
Senior Member
Hi,

I meant if you get any output on the console of your raspi. Not on the deployment console. I would do it the same way as you have implemented. The only thing what I see is that you start the E_CYCLE the same time as you initilize the IX block. On the rapsberry PI the initialization of the IX takes quite some time. so it would be better to connect the START of your E_CYCLE with the INITO of your IX block.

I hope this helps.

Alois
Re: E_CYCLE don't generate events on every DT? [message #1811039 is a reply to message #1811003] Sun, 25 August 2019 08:43 Go to previous messageGo to next message
Adi Wasturaka is currently offline Adi WasturakaFriend
Messages: 3
Registered: August 2019
Junior Member
Hi Zoitl,

Your advice worked beautifully! I connected the START of the E_CYCLE block to the INITO of the IX, played around with WARM, and COLD of the START block and the E_CYCLE keeps generating events to DT as low as 10ms. Do you mind explaining why connecting to INITO solve the problem about the slow initialization time of IX on raspi? By the way, here is the snap of the working diagram:

https://ibb.co/mB1tXp3

In addition, I successfully exported the data to a txt file using a CSV_WRITER block without hassle. The next challenge would be processing the data for my purpose (and probably throwing questions again to this forum). Thanks a lot!


-Adi Wasturaka
Department of Engineering Physics
Universitas Gadjah Mada, Indonesia

[Updated on: Sun, 25 August 2019 08:46]

Report message to a moderator

Re: E_CYCLE don't generate events on every DT? [message #1811042 is a reply to message #1811039] Sun, 25 August 2019 11:42 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 908
Registered: January 2014
Senior Member
HI,

great to hear that. Looking on your figure I see that there is still an event going from WARM - > E_CYCLE.START. For clearity I would remove that. All the best with your further experiments.

Cheers,
Alois
Previous Topic:build a forte in PLC not in list of already supported PLCS
Next Topic:lua51.dll not found!
Goto Forum:
  


Current Time: Thu Nov 21 10:42:58 GMT 2019

Powered by FUDForum. Page generated in 0.02125 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top