Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: jeremyjo on June 22, 2016, 04:31:23 PM

Title: PID Memory Block vs Heap Item
Post by: jeremyjo on June 22, 2016, 04:31:23 PM
I'm working on a project that contains 11 PID loops. One of them is pretty well on on it's own, while the other 10 will be very similar with identical tuning, just different PVs, SPs, and outputs.

The question is: when would you use a PID Memory Block instead of creating individual PID Heap Items? Is this such an occasion? Does the Memory Block approach make initializing and managing the loops easier or is it just a way to make a bunch of somethings at once? I guess I'm looking for an example use case for each type.

Thanks!

-Jeremy
Title: Re: PID Memory Block vs Heap Item
Post by: franji1 on June 22, 2016, 05:18:56 PM
The benefits of creating a data-block (say MyPID)

Benefits of Heap-Item
Title: Re: PID Memory Block vs Heap Item
Post by: jeremyjo on June 23, 2016, 05:26:05 PM
Forgot to check the notify button on my post.

Thanks for that clarification! Since runtime edits aren't a big deal here and indexing will probably be more trouble than it's worth for this simple setup, I think I'll go with adding them as Heap Items to make the naming more clear for future support.

-Jeremy
Title: Re: PID Memory Block vs Heap Item
Post by: plcnut on June 24, 2016, 07:24:04 AM
You don't 'have' to use indexing to use the data-block PID's, and you can also give each of the data-block items a nickname to use in your program. I rarely use the heap-items, and always use the memory blocks. That is my personal preference.
Either method should work just fine for what you are doing.
Title: Re: PID Memory Block vs Heap Item
Post by: BobO on June 24, 2016, 09:55:53 AM
Probably bears mentioning that the purpose of the heap was to give the system a place to allocate structures associated with devices and code blocks. Once we had the heap, it made sense to allow users to allocate singletons like PID or Ramp Soak structures there, and gave the advantage of making the name something meaningful. There really is no right or wrong answer, just different benefits of each.