[Beremiz-devel] [MatIEC][PATCH] fix wrong common_ticktime if task interval is greater than 4.3 seconds

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Beremiz-devel] [MatIEC][PATCH] fix wrong common_ticktime if task interval is greater than 4.3 seconds

Beremiz-Devel mailing list
Hi Mario,

On Windows if periodic task has interval greater that 4.3 seconds
(more than 2^32 nanosedonds), incorrect initialize common_ticktime for
resources and as result task runs much much slower.

For example, iec2c generates this code

void RESOURCE1_run__(unsigned long tick) {
  TESTTASK = !(tick % 7);
  if (TESTTASK) {
    PROGRAM0_body__(&TEST);
  }
}

instead of

void RESOURCE1_run__(unsigned long tick) {
  TESTTASK = !(tick % 1);
  if (TESTTASK) {
    PROGRAM0_body__(&TEST);
  }
}


This problem doesn't exist on GNU/Linux on amd64, because sizeof(unsigned long)
on amd64 is 8 and on Windows amd64 sizeof(unsigned long) is 4.

I've attached patch to fix this problem.

--
Best regards,
Andrey Skvortsov

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel

fix_task_cycle.patch (699 bytes) Download Attachment
signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Beremiz-devel] [MatIEC][PATCH] fix wrong common_ticktime if task interval is greater than 4.3 seconds

Beremiz-Devel mailing list


  Hi Andrey


   Thanks for the patch. I have pushed it onto my repo.


    Cheers,

         Mario.





On 11.04.2017 12:23, [hidden email] wrote:

> Hi Mario,
>
> On Windows if periodic task has interval greater that 4.3 seconds
> (more than 2^32 nanosedonds), incorrect initialize common_ticktime for
> resources and as result task runs much much slower.
>
> For example, iec2c generates this code
>
> void RESOURCE1_run__(unsigned long tick) {
>   TESTTASK = !(tick % 7);
>   if (TESTTASK) {
>     PROGRAM0_body__(&TEST);
>   }
> }
>
> instead of
>
> void RESOURCE1_run__(unsigned long tick) {
>   TESTTASK = !(tick % 1);
>   if (TESTTASK) {
>     PROGRAM0_body__(&TEST);
>   }
> }
>
>
> This problem doesn't exist on GNU/Linux on amd64, because
> sizeof(unsigned long)
> on amd64 is 8 and on Windows amd64 sizeof(unsigned long) is 4.
>
> I've attached patch to fix this problem.
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
> _______________________________________________
> Beremiz-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/beremiz-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Beremiz-devel] [MatIEC][PATCH] add debug option for flex

Beremiz-Devel mailing list
On 17-04-12 08:46, [hidden email] wrote:
>
>
>   Hi Andrey
>
>
>    Thanks for the patch. I have pushed it onto my repo.

Thanks. Here is another small patch.
It just adds by default commented out option to enable flex debug
output (like it's already done in bison).
This would be easy to find for newcommers and easy to enable.

>
> On 11.04.2017 12:23, [hidden email] wrote:
> > Hi Mario,
> >
> > On Windows if periodic task has interval greater that 4.3 seconds
> > (more than 2^32 nanosedonds), incorrect initialize common_ticktime for
> > resources and as result task runs much much slower.
> >
> > For example, iec2c generates this code
> >
> > void RESOURCE1_run__(unsigned long tick) {
> >   TESTTASK = !(tick % 7);
> >   if (TESTTASK) {
> >     PROGRAM0_body__(&TEST);
> >   }
> > }
> >
> > instead of
> >
> > void RESOURCE1_run__(unsigned long tick) {
> >   TESTTASK = !(tick % 1);
> >   if (TESTTASK) {
> >     PROGRAM0_body__(&TEST);
> >   }
> > }
> >
> >
> > This problem doesn't exist on GNU/Linux on amd64, because
> > sizeof(unsigned long)
> > on amd64 is 8 and on Windows amd64 sizeof(unsigned long) is 4.
> >
> > I've attached patch to fix this problem.
--
Best regards,
Andrey Skvortsov

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel

enable_flex_debug.patch (573 bytes) Download Attachment
signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Beremiz-devel] [MatIEC][PATCH] add debug option for flex

Beremiz-Devel mailing list

   Thanks!  Pushed to me repo.


    Mario.





On 12.04.2017 09:32, [hidden email] wrote:

> On 17-04-12 08:46, [hidden email] wrote:
>>
>>
>>   Hi Andrey
>>
>>
>>    Thanks for the patch. I have pushed it onto my repo.
>
> Thanks. Here is another small patch.
> It just adds by default commented out option to enable flex debug
> output (like it's already done in bison).
> This would be easy to find for newcommers and easy to enable.
>
>>
>> On 11.04.2017 12:23, [hidden email] wrote:
>> > Hi Mario,
>> >
>> > On Windows if periodic task has interval greater that 4.3 seconds
>> > (more than 2^32 nanosedonds), incorrect initialize common_ticktime for
>> > resources and as result task runs much much slower.
>> >
>> > For example, iec2c generates this code
>> >
>> > void RESOURCE1_run__(unsigned long tick) {
>> >   TESTTASK = !(tick % 7);
>> >   if (TESTTASK) {
>> >     PROGRAM0_body__(&TEST);
>> >   }
>> > }
>> >
>> > instead of
>> >
>> > void RESOURCE1_run__(unsigned long tick) {
>> >   TESTTASK = !(tick % 1);
>> >   if (TESTTASK) {
>> >     PROGRAM0_body__(&TEST);
>> >   }
>> > }
>> >
>> >
>> > This problem doesn't exist on GNU/Linux on amd64, because
>> > sizeof(unsigned long)
>> > on amd64 is 8 and on Windows amd64 sizeof(unsigned long) is 4.
>> >
>> > I've attached patch to fix this problem.
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
> _______________________________________________
> Beremiz-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/beremiz-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel
Loading...