<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/</id><updated>2022-07-04T10:22:49.096000Z</updated><subtitle>Recent posts to Codesys - cpu load </subtitle><entry><title>Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/?limit=25#4ee9" rel="alternate"/><published>2022-07-04T10:22:49.096000Z</published><updated>2022-07-04T10:22:49.096000Z</updated><author><name>damian177</name><uri>https://forge.codesys.com/u/damian177/</uri></author><id>https://forge.codesys.com038a4b6bce5e141140f5b68593d7505159697b0c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Problem probably was in UINT_TO_BYTE(SIZEOF(dataImageLogoP1inv) -1) because oryginally I use :&lt;br/&gt;
UINT_TO_BYTE(SIZEOF(dataImageLogoP1inv)).&lt;/p&gt;
&lt;p&gt;Thanks for help.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/?limit=25#1db9/f417/7f35" rel="alternate"/><published>2022-07-04T10:08:46.500000Z</published><updated>2022-07-04T10:08:46.500000Z</updated><author><name>fajean</name><uri>https://forge.codesys.com/u/fajean/</uri></author><id>https://forge.codesys.comae0429de653ea06aeeb4da176cf13489e0a71c4c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I am not saying for sure that it is reinitialized to TRUE, but it could be if, say, the declaration of "firstScan" is located in a method rather than in the function block's body. I do not see the whole code, so it is hard to tell where your problem comes from.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/?limit=25#1db9/f417" rel="alternate"/><published>2022-07-04T05:10:23.553000Z</published><updated>2022-07-04T05:10:23.553000Z</updated><author><name>damian177</name><uri>https://forge.codesys.com/u/damian177/</uri></author><id>https://forge.codesys.com93e80403daf4a87dccdf47a14ba2f4627cf1f8ca</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In my project in one of program block it was declared this variable : VAR firstScan:BOOL:=TRUE;  END_VAR  Is not a global variable. &lt;/p&gt;
&lt;p&gt;I don't understand why  variable "fisrtScan" would be reinitialize to TRUE every time ?    &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/?limit=25#1db9" rel="alternate"/><published>2022-07-03T11:10:35.147000Z</published><updated>2022-07-03T11:10:35.147000Z</updated><author><name>fajean</name><uri>https://forge.codesys.com/u/fajean/</uri></author><id>https://forge.codesys.com2fc71c05eb3574e5e5f859c2dd19156f96010fca</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Looking at your code snippet, and assuming the arrays point to valid memory areas (not overlapping other variables), it seems off the top of my mind three things may be wrong :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the loop is infinite&lt;/li&gt;
&lt;li&gt;MERGE_ARRAY is being passed arguments that cause a very long processing time or memory corruption.&lt;/li&gt;
&lt;li&gt;Your code block is being called during every scan cycle, and the"firstScan" variable is local to the code block and being reinitialized to TRUE every time.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It should be possible to rule of some of these easily with a few tests.&lt;/p&gt;
&lt;p&gt;Also, one quick note. You use this :&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;UINT_TO_BYTE(SIZEOF(dataImageLogoP1inv) -1)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If SIZEOF returns 0, then UINT_TO_BYTE will yield 255 (BYTE is unsigned), which is probably not what you want. It is hard to tell because we do not have all of the code, but I am not sure you should be using UINT_TO_BYTE, and iCount maybe should be a UINT (or something with a larger range).&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/?limit=25#b7fa" rel="alternate"/><published>2022-07-02T18:13:54.478000Z</published><updated>2022-07-02T18:13:54.478000Z</updated><author><name>damian177</name><uri>https://forge.codesys.com/u/damian177/</uri></author><id>https://forge.codesys.com43aa7834b3ccc57a405bf4f86a5830edc0ffd695</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;How is possible that my first solution worked time to time ?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/?limit=25#cd20" rel="alternate"/><published>2022-07-01T10:30:44.044000Z</published><updated>2022-07-01T10:30:44.044000Z</updated><author><name>damian177</name><uri>https://forge.codesys.com/u/damian177/</uri></author><id>https://forge.codesys.com881586f3278e43246a0ee72d88957fec579b57aa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Size like below :&lt;br/&gt;
dataImageLogoP1inv : ARRAY&lt;span&gt;[0..203]&lt;/span&gt; OF BYTE;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/?limit=25#6119" rel="alternate"/><published>2022-07-01T10:06:34.134000Z</published><updated>2022-07-01T10:06:34.134000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.coma56b74e8a77b5e9a9797c1bfda316ad71031b2aa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;what is the sizeof dataimagelogoP1inv equal to? if it is 255, your for loop will be an infinite loop..&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/?limit=25#f635" rel="alternate"/><published>2022-07-01T09:39:04.036000Z</published><updated>2022-07-01T09:39:04.036000Z</updated><author><name>damian177</name><uri>https://forge.codesys.com/u/damian177/</uri></author><id>https://forge.codesys.com7b982bdf5ef3e7cce9d294e0e3d3c363fd33c909</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Codesys proces eating all the CPU during running my project. The problem is in the loop - please find in attachement . I do not what can be wrong...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/?limit=25#1e77/e155" rel="alternate"/><published>2022-07-01T07:31:27.075000Z</published><updated>2022-07-01T07:31:27.075000Z</updated><author><name>paulpotat</name><uri>https://forge.codesys.com/u/paulpotat/</uri></author><id>https://forge.codesys.com2630a5e0ead8bf4732b9e38222042d39c4a845fb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Try to run the following command in a terminal :&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;htop
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Then you can monitor CPU usage and identify which process is eating all the CPU.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys - cpu load </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/497d0c65f6/?limit=25#1e77" rel="alternate"/><published>2022-07-01T07:26:28.675000Z</published><updated>2022-07-01T07:26:28.675000Z</updated><author><name>damian177</name><uri>https://forge.codesys.com/u/damian177/</uri></author><id>https://forge.codesys.com07bfddfff4f070168e95ae69cd346d156dc05ea2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;This one:&lt;br/&gt;
&lt;a href="https://comfiletech.com/linux-panel-pc-comfilepi/cpi-a102wr-10-2-industrial-raspberry-pi-touch-panel-pc/" rel="nofollow"&gt;https://comfiletech.com/linux-panel-pc-comfilepi/cpi-a102wr-10-2-industrial-raspberry-pi-touch-panel-pc/&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>