Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Bolt on September 18, 2019, 03:15:51 PM

Title: Finding Memory Block Size
Post by: Bolt on September 18, 2019, 03:15:51 PM
Is there a way in ladder logic to determine the size of a memory block?  Say I want to know what the block size is on a string memory.  SS.Max or something like that.
Title: Re: Finding Memory Block Size
Post by: franji1 on September 18, 2019, 03:24:12 PM
DATAINFO instruction.  You can query the number of elements, the size in bytes of the block, the data type, et. al.
Title: Re: Finding Memory Block Size
Post by: Bolt on September 18, 2019, 03:30:49 PM
Thanks!  You guys thought of everything!
Title: Re: Finding Memory Block Size
Post by: franji1 on September 18, 2019, 03:36:41 PM
Thanks!  You guys thought of everything!

I try to utilize that in some of my FOR/NEXT code-blocks, whenever I know there's a good chance I will be tweaking the block size.  I don't want to have to remember to change CODE if I change the size of a data block from 100 elements to 200 elements.
Title: Re: Finding Memory Block Size
Post by: Bolt on September 18, 2019, 03:39:58 PM
Exactly what I'm trying to do, anticipating a future memory block size adjustment, and building a queue system that will "never" get full.