News:

  • May 02, 2026, 05:41:21 PM

Login with username, password and session length

Author Topic: Deeper nesting for indirect addressing  (Read 47050 times)

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Deeper nesting for indirect addressing
« Reply #15 on: December 20, 2012, 11:54:53 AM »
Controls Guy, Are you speaking of a Multidimensional Array? I have been told that what I am currently working on would be much simpler if the software supported multidimensional arrays, but, the whole concept is pushing the edge of my understanding...
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6154
  • Yes Pinky, Do-more will control the world!
Re: Deeper nesting for indirect addressing
« Reply #16 on: December 20, 2012, 07:32:40 PM »
No.  Our data structures will just allow simple data types (e.g. BIT, UNSIGNED BYTE, REAL, etc.)

In that case let me put in a strong request for that capability in some future revision.  I definitely use arrays inside user defined types.

I also frequently create fundamental low level UDT's and nest them inside higher level ones, sometimes up to three levels deep, which sounds like it's out of bounds for the current concept as well.  It's a very useful ability to have, if you guys would be willing to do it.

We well understand the power and value of complex data types...a product like Do-more could never be created without them. So our reluctance to attack it is not a lack of willingness or understanding, it is the bounds of the design. Do-more is a conventional PLC borne of a conventional 'Type:ID' view of memory. To extend memory types beyond what we currently have would require a significant re-architecting of memory addressing...something that is not likely for the immediate future. We are intimately aware of the current limitations, and it is something that we will eventually be forced to address...but...right now we are working on features that will be far more significant than this to our current customer base. As rudimentary as our current data types are, they are still well ahead of where the bulk of ADC's customer base is right now.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Deeper nesting for indirect addressing
« Reply #17 on: December 20, 2012, 08:46:15 PM »
Controls Guy, Are you speaking of a Multidimensional Array? I have been told that what I am currently working on would be much simpler if the software supported multidimensional arrays, but, the whole concept is pushing the edge of my understanding...

You could liken a multidimensional array to a spreadsheet, in that it takes more than one index to specify the location of a given piece of data in the array, like cell B9 say in a spreadsheet that has only one page.  A 3-dimensional array takes 3 indices to locate a point, like a spreadsheet with multiple pages, but arrays can have more than three dimensions, it's just hard to come up with an analogy.

What the last few posts have been about are user-defined data types (UDT's), which unlike arrays, aren't necessarily lists of data points of the same type, like 100 integers or 1200 floating points or whatever, although there's no reason they can't be.  For instance, say you want to write a program to control an electric heater in a chemical bath.  You might define a type modeled on the data needed to control that heater, such as current tank temperature, setpoint, which are floating point values, as well as safety thermostat boolean status, liquid level boolean status (also for safety), and heater boolean on/off status or output percent, whether the loop can also cool, etc.

Now when you program, all the data necessary for controlling that heater stays together in a compact bundle, and your ladder will reference it as Activator.CurrentTemp or Activator.Setpoint, etc., all of which makes for cleaner, more readable, more reusable programming, so this is helpful mostly if you have objects that occur more than once in your program, or if you expect them to recur in future programs, because you can typically cut and paste these type definitions from one program to another.

Now imagine that in addition to a heater, your tank has a pump.  You could just add the pump variables to the heater type and change the name to something more generic like "Tank", but maybe all the tanks don't have pumps, or maybe some of them have two.  So by making pumps and heaters separate types, you're more flexible; you can then easily assemble types to fit whatever situation you run into.  That was where I was talking about nesting UDT's.  You could create a type called "Tank" that includes as members one or an array of the Heater type, one or an array of the Pump type and so on.

Real life example:  I needed to maintain a fault history database in the PLC, which would include the fault code, time stamps for the initial acquisition of the fault as well as the acknowledge time, and some other data.  AND the time stamps had to be stored in a format different than the time format standard for that PLC.  So I created a custom UDT for recording a time in the desired format, then defined a type that would hold an entire fault record, including two instances of that custom time UDT as well as the other stuff.  Then I created an array (so this is a specific data block, not a type) named FaultLog, which was an array of 1000 elements of type FaultRecord.
« Last Edit: December 20, 2012, 09:05:21 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Deeper nesting for indirect addressing
« Reply #18 on: December 20, 2012, 08:50:46 PM »
We well understand the power and value of complex data types...a product like Do-more could never be created without them. So our reluctance to attack it is not a lack of willingness or understanding, it is the bounds of the design. Do-more is a conventional PLC borne of a conventional 'Type:ID' view of memory. To extend memory types beyond what we currently have would require a significant re-architecting of memory addressing...something that is not likely for the immediate future. We are intimately aware of the current limitations, and it is something that we will eventually be forced to address...but...right now we are working on features that will be far more significant than this to our current customer base. As rudimentary as our current data types are, they are still well ahead of where the bulk of ADC's customer base is right now.

Understood -- you guys are doing a great job despite having a lot on your plate.  That's why I assumed this would have to be an addition to some possibly distant future release.  Just wanted to put in a word so that when the manpower IS available you might consider doing it.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.