Defining Data Types
For better readability and programming, we will define data types that correspond to our assembly structures. First we will define a new String type that has space for 28 characters, the same as we defined in our assemblies. Right click on Data Types -> Strings in the tree and select New String Type....
FIGURE F-26.
Name the string and set the Maximum Characters to 28. Including the 4 bytes of string length data, this will result in a total data size of 32 bytes.
FIGURE F-27.
Next, we will create a data structure to represent the results we will be receiving from the VS-1 Smart Camera in the input assembly.
First, define the structure of a Point that is composed of 3 floating point numbers. Right click on Data Types -> User-Defined to create the Point type. Add three Members of type REAL to hold the X, Y and angle values of the point. The total structure size should be 12 bytes.
FIGURE F-28.
Next, create the structure representing the input assembly contents. Again, right click on Data Types -> User Defined and select New Data Type. Add the data types in the same order as we previously defined the assemblies to be.
Once completed, the full input assembly data type should total 52 bytes and appear as shown in (Figure F-29).
FIGURE F-29.