- Start the
FBEditor.
- Create a new data type in the editor by double-clicking on
the Array, Direct, Enumerated, Structured or Subrange
element in the
template
folder of the Library Navigator panel.
- These elements are marked with the
icon.
- Edit the data type's elements:
- Edit the data type's common
properties.
- Edit additional subtype-specific properties:
- You can edit elements of a Structured data type
graphically in the same manner as input
variables of a function block type.
- You can edit the elements of other subtypes by using the
subtype node (the last node on the Element
Navigator tree):
- Double-clicking on the subtype node will bring up a
dialog for editing an Array, Direct, or Subrange
subtype.
- You can add, delete, edit and rearrange elements of an
Enumerated subtype by using appropriate popup menus, double-click and Drag and Drop operations on the
subtype node and its children.
- When your editing is complete, save your work with the Save As... button.
It is a good idea to save your
work from time to time while editing, too!
- Generate and compile a Java® source file with the Save As... button.
- For Subrange data types, the Java code includes a
limitValue()
method, which can be used to ensure that the variable's value is
limited to stay within the subrange after performing a math
operation.
- Since data types are not event-triggered elements like
function blocks, they cannot be tested directly with the Run item of the popup menu for the
root node of the Element Navigator.
See Testing Data Types for test strategies
for the various kinds of data types.