+5
Under review

Setting cycle time for individual function groups

John Baldwin 4 years ago in IQANdesign updated by mdaigneault 2 months ago 10 1 duplicate

Our Company has been using IQAN for several years now and continually run into issues of not enough RAM or too high of CPU ussage, causing us to increase loop time, and not use other handy features such as QCoding in order to reduce resource usage. I think we could save a lot of time and head aches if we could set the cycle time of certain function groups. Not everything we code needs to be evaluated every cycle, some stuff maybe needs to be checked once a second. Therefore it would be good to be able to set a function group priority and cycle time.


Example: One function group is set to "High Priority" and must be evaluated within its defined loop time, say 50ms. and another function group, that is not critical to any machine control, is set to "lowest priority" and assigned a loop time of 1000ms. Because it is low priority the controller would try to updated it within 1 second of the previous update but it could take a bit longer (bumped due to priority) if the cpu is busy with a time critical function group.


I just believe we waste too much time updating non critical functions/systems and it would be nice to have a little more control over where the cpu spends and prioritizes most of its time.


Thanks.

Duplicates 1

I'm no Computer Engineer, but a simpler way to implement might be to have a check box on the functional group to evaluate every 1,4,or 16 cycles (2 and 8 would also work), then have the software automatically stagger the evaluation cycles on compilation to even things out and make sure 2 big groups don't land on the same cycle.

example:

If cycle count = 8 (1000) evaluate FG - W

If cycle count = 2,6,10,14 (**10) evaluate FG - X

If cycle count = 3,7,11,15 (**11) evaluate FG - y

If cycle count = 0 (0000) evaluate FG - Z


FGs within FGs would have the boxes for more frequent cycling than the parent not availiable.


Bumping a functional when busy requires the computer to determine how busy it is and what functional groups would need to be skipped this time around while keeping track of how many times they have been skipped, so something doesn't get completely left out.


My way would just need a 4 bit cycle counter that loops


I think that could work quite well, it would also keep it fairly simple to understand what order channels/function groups get evaluated.

Is there an update on this idea?

Under review

No updates, but this might be something to consider for future versions

All the handling of the different processes that run on an IQAN module is done by the lower level embedded SW, and is not available on the application layer. 

All application functionality is executed once every cycle (with the exception of TSC1 and fast JFOUT, that may run faster)


I believe the question is about achieving something like this other topic?  

http://forum.iqan.se/topics/610-setting-cycle-time-for-individual-function-groups/

Yes, The "setting cycle time for individual function groups" topic would certainly help.  When will that capability be available?

Also, Is there a way to have a cycle utilization channel per function group?  This would help optimize each function group.
Chuck

I agree, knowing which function groups are consuming the cpu time would be a nice optimization tool to have

Gustav, any updates on this feature?

Could you not achieve this by having a function group that is disabled by a channel?

Enable this group once every second and let it run for a few cycles until it signals that it's finished and all the outputs have been copied to outside channels.

You could also have a counter that counts from 0-3 for example. When the counter is 0 enable function group 0. When it is finished copy it's output, increase counter to 1 and enable function group 1.

This would be a great feature. We have some fairly large groups that we do not need to run at each cycle. A task scheduler within IQAN would be great!