Topic: DMD0209

Help File Version: 2.9.4.37

User Created Memory


In addition to the Built-in memory blocks and structures, the programmer can create as many additional memory blocks and structures as memory allows.

Creating Data Blocks

Using the Add Memory Block dialog found on the Memory Configuration tab of the System configuration utility, the programmer can create a memory block and give it a name, select the type of data the block will contain, specify the number of elements the block will have, and specify what portion that block will be retentive.

 

 

The programmer can create blocks of simple data types such as Bits, Unsigned Bytes, Signed Bytes, Unsigned Words, Signed Words, Signed DWords, and Reals.

 

The programmer can also create blocks of structures such as Timer Structures, Counter Structures, Strings, PID Structures, Date/Time Structures, Task Structures, Ramp/Soak Structures, Program Structures, Device Reference Structures, and Drum Structures.

 


Creating Heap Items

Heap Items are created automatically when an instruction that requires one is added to the Do-more Designer project, For example, when a PID instruction is added the instruction editor prompts the programmer for the PID Struct.

 

 

After entering a valid name for the PID Struct notice that the "dot" in the Struct field is yellow, not green. This indicates that the PID Struct name is valid but the structure does not yet exist, but will be created when the editor is closed. This method gives the programmer the ability to create instructions that use large data structures one-at-a-time, as needed.

 

 

Creating new heap items causes changes to the system configuration, which can only be downloaded to the controller when it is in STOP mode. This situation can be avoided by creating the heap items ahead of time. There are two ways to do this:
 

1. Use the Add Heap Item dialog found on the Memory Configuration tab of the System Configuration utility to create single ”Heap Items” where there is only one item of that data-type with the given name.

 

 

For example, the programmer could create PID_0, PID_1 and PID_2, download the new system configuration to the controller, and when they are added to the project the editor "dot" would be green instead of yellow indicating that the controller already has that element in it's memory.
 

 

2. Use the Add Memory Block dialog found on the Memory Configuration tab of the System Configuration utility to create a block of the needed Struct type.

 

 

For example, the programmer could create block of three PID Structures named MyPID, and download that to the controller. These PID Structures can now be referenced as MyPID0, MyPID1 and MyPID2 in the project.

Another advantage to creating a block of the structures is their fields can be indirectly referenced like all of the Built-in data blocks, for example MyPID[V0].SP.

 


See Also:

Built-in Data Blocks

 

Structures and their Fields

 

User-Created Data Blocks and Structures

 

Arrays, Pointers and Tables

 

Cast Operations

 

Assignment Operations and Instructions

 

Using Constant Values

 

System Nicknamed Locations

 


Related Topics:

Element Browser

 

Element Picker