Topic: DMD0422 User Data Types |
|
Selecting the User Data Types tab will display a list of the currently defined user data types, and any memory blocks or heap items that have been created with those types definitions. This tab has functions that allow you to Add additional user data types, Edit existing user data types, and Delete unused user data types (you can only delete a user data type that has NOT been used to create heap items or memory blocks).
The Show group has three radio buttons select which classes of structure definitions to show in the list. Selecting User Data Types will only show the user-created data types, selecting Built-in Structs will only show the structure definitions that were automatically built for the project, and selecting Both will display both the user-created and built-in structure definitions.
The contents of user data types can be sourced from an external CSV file. Clicking the Import button and selecting a CSV file will import the contents of that CSV file into the current list of user data types. Import and Export is the preferred way to move user data types between Do-more designer projects. Refer to the section below on the format of data in the import file. Clicking the Export button and selecting a CSV file will write the contents of the selected built-in structures or user data types to that CSV file. Exporting the contents of built-in structures is for documentation purposes only, they cannot be imported back into a project.
The center section is a list of the currently defined user data types. The list can be sorted by any of the columns by clicking on the column's header. For each user data type listed the following data is shown:
Structure Name is the name of the user data type definition.
#DW / #Bytes shows the size of the structure that will be created with this definition in both the number of DWords and the number of Bytes.
#Fields shows the total number of fields in the structure definition.
Attributes describes how the structure definition was created:
Current Block / Heap List shows the names of both memory blocks and heap items that have been created with this structure definition.
|
|
Adding a New User Data TypeStructure Name contains the name of the structure definition User data type names must follow Nickname Rules Nicknames can be 1 to 16 characters in length and consist of any combination of alphanumeric characters and underscores ('_', 'a-z', 'A-Z', 0-9), no spaces or punctuation marks are allowed, and must begin with a letter or an underscore.. Because you are creating a structure definition - not an actual structure - it is recommended that you append the letters "Struct" to whatever name you want to use. This follows the pattern of System and Built-in structure definitions already in Do-more Designer. Doing this will greatly help in keeping the user data type definitions and the actual structures made with those user data types straight.
Number of DWords shows the size of the user data type in DWords. Each user data type can be a maximum of 64 DWords in length.
Any time after a field has been added, you can click the View Memory Layout button to see a graphical depiction of how the memory will be packed into the structure.
Add will add a new field at the end of the list and open the Field Definition dialog, and Insert will add a new field immediately before the highlighted field and open the Field Definition dialog.
Duplicate will add a copy of the highlighted field at the end of the list with a new name that is typically the original name with a number appended.
Edit opens the highlighted field in the Field Definition dialog so that its definition can be changed.
Delete removes the highlighted field from the user data type.
Each click of the Move Up / Move Down moves the highlighted field one position closer to the beginning or to the end of the list respectively.
The list of Field's can be sorted by any of the columns by clicking on the column header. If you have sorted the list by any column other than Field#, clicking the Renumber button will reassign the Field#'s based on the current sort order. Doing this will cause the layout of the memory in the user data type to be shifted to match the renumbered fields.
Field Name contains the name of the field in this user data type. All field names must follow Nickname Rules Nicknames can be 1 to 16 characters in length and consist of any combination of alphanumeric characters and underscores ('_', 'a-z', 'A-Z', 0-9), no spaces or punctuation marks are allowed, and must begin with a letter or an underscore. and field names must be unique with each user data type.
Field Number contains a sequential number that uniquely identifies each in the structure. Some Built-in structures may have field numbers that are skipped. This number is automatically assigned when the field is created, and is automatically adjusted as need if the field is moved within the user data type. The can be a maximum of 255 fields in each user data type.
Data Type selects the type of data this field will contain. This can be any of the native simple, or any of the system-defined structures and existing UDTs that are marked as Nestable.
Layout shows the memory layout of the individual fields in the structure. Each field is contained within a DWord. Depending on the data of the field, it will consume either the entire DWord, or a Word, a Byte or a Bit within that DWord.
Read-Write / Read-Only specifies whether the contents of the field can be changed by the ladder logic program or by an external communication source. The Copy Memory (MEMCOPY) instruction is the only way to get values into fields marked as Read-Only.
Data View's Structure Level Status selects when this field will be displayed in Data View. This selection lets you govern the level of detail that will appear when the structure is displayed in a Data View. Critical members can be tagged for Short. Useful members can be tagged for Short and Long. One-shot bits or non-critical members could be tagged as Do Not Show.
Default Display Format selects the initial format of the data when it is displayed in a Data View. This is very useful if the field contains a numeric value that should be interpreted a certain way. For example, if the value is the Preset of a Timer which is a number of milliseconds, a better default format for this field is to display it in Timer format (hh:mm:ss.mmm).
Memory Layout selects how the memory layout process will happen:
|
|
Import File FormatThe contents of user data types can be sourced from an external CSV file. Clicking the Import button and selecting a CSV file will import the contents of that CSV file into the current list of user data types. The import process will skip any user data types that already exist in the project. The format of a CSV file is show in the following spreadsheet (rows that begin with a "//" are just documentation):
Structure Name contains the name of the structure definition User data type names must follow Nickname Rules Nicknames can be 1 to 16 characters in length and consist of any combination of alphanumeric characters and underscores ('_', 'a-z', 'A-Z', 0-9), no spaces or punctuation marks are allowed, and must begin with a letter or an underscore.. Because you are creating a structure definition - not an actual structure - it is recommended that you append the letters "Struct" to whatever name you want to use. This follows the pattern of System and Built-in structure definitions already in Do-more Designer. Doing this will greatly help in keeping the user data type definitions and the actual structures made with those user data types straight.
Data Type specifies the type of data this field will contain, specified by one of the following keywords:
Layout specifies memory layout of the individual fields in the structure. Each field is contained within a DWord. Depending on the data type of the field, it will consume either the entire DWord, or a Word, a Byte or a Bit within that DWord. The layout is specified as 2 digits separated by a colon. The first digit is the DWord offset in memory of the DWord where the data will reside, the second digit is the offset of that data within that DWord.
Read-Write / Read-Only specifies whether the contents of the field can be changed by the ladder logic program or by an external communication source. The Copy Memory (MEMCOPY) instruction is the only way to get values into fields marked as Read-Only. The valid keywords are Read-Only and Read-Write.
Display Format specifies the initial format of the data when it is displayed in a Data View. This is very useful if the field contains a numeric value that should be interpreted a certain way. For example, if the value is the accumulator of a Timer, the proper interpretation is the number of milliseconds. Any time this field is displayed in a Data View or a relational contact, the specified default display format will be used instead of the native value. These are the valid keywords:
Data View Detail specifies whether this field will be displayed in the short form or the long form when this structure is shown in a Data View. Valid keywords for this field are: Short which means the field will be displayed on both the short and long forms, Long which means the field will only be displayed in the long form, and No which means the field will not be displayed on either form.
|
|
See Also:Memory View edit and / or monitor the contents of the Memory Blocks and Strings
Memory Image Manager is used save a copy of the contents of the retentive memory locations and heap items in the offline Do-more Designer project.
|
|
Related Topics:
|
|