Chapter 14 - Create Your Point Id and Point Folder Class

In the previous chapter of today's lesson you coded the parseReadValue method of your read response. In the parseReadValue method, you identified whatever information that you needed in order to retrieve the value for any particular point from the bytes of the response's data frame. Now that you have identified this information, creating the point id should be straight-forward!

While following the examples in this chapter, please replace the text jarFileName, yourDriver and yourCompany as previously described in the Preparation section):

Create Your Point Id Structure For Your Driver

  1. Make a Java class that extends BDdfIdParams. Name it BYourDriverPointId. Create this in a package named com.yourCompany.yourDriver.identify. Also add an empty slotomatic comment, with an empty properties section immediately after the opening brace for the class declaration.

    To do this, create a text file named BYourDriverPointId.java in the jarFileName/src/com/yourCompany/yourDriver/identify folder. Inside the text file, start with the following text:

    package com.yourCompany.yourDriver.identify;
    
    import javax.baja.sys.*;
    
    import com.tridium.ddf.identify.*;
    
    public class BYourDriverPointId
      extends BDdfIdParams
    {
      /*-
      class BYourDriverPointId
      {
        properties
        {
        }
      }
      -*/
    }
    

  2. In the properties section of the slotomatic header, declare properties for any information that you needed in order to complete the parseReadValue method (function) in your read response (the previous chapter covers this lesson).

    In our hypothetical example, we required an integer offset between 0 and 29. In the example parseReadValue method, we accessed this by calling the getOffset method. We coded the parseReadValue method like this because we knew that in this chapter, we would add a property named offset to our hypothetical point id structure. We knew that by naming this property offset that the Niagara AX slotomatic utility would automatically generate a getOffset method (function).

    Please make the slotomatic statement on your point id structure look something like this (instead of adding a property named offset add one or more properties named appropriately to accommodate your version of the parseReadValue method in the previous chapter):

      /*-
      class BYourDriverPointId
      {
        properties
        {
          offset : int
            -- This property has nothing to do with the dev
            -- driver framework itself. Instead, we need to
            -- know the location of a point's value when in
            -- the parseReadValue method of yourDriver's
            -- read response
            default{[0]}
            slotfacets{[MGR_INCLUDE]}
        }
      }
      -*/
    

    NOTE: Providing the slotfacet of MGR_INCLUDE on each of these properties will cause them to automatically appear in your point manager for your driver. }
  3. Run slotomatic and perform a full build on your driver (as described in Chapter 2).
  4. Now that your driver's point id has been defined, the rest of the classes that you created in today's lesson should now be ready to compile.

Create a Point Folder Component For Your Driver

  1. Create a class named BYourDriverPointFolder in package com.yourCompany.yourDriver.point

    To do this, create a text file named BYourDriverPointFolder.java in the jarFileName/src/com/yourCompany/yourDriver/point folder. Inside the text file, start with the following text:

    package com.yourCompany.yourDriver.point;
    
    import com.tridium.ddf.*;
    
    import javax.baja.sys.*;
    
    public class BYourDriverPointFolder
      extends BDdfPointFolder
    {
      /*-
      class BYourDriverPointFolder
      {
        properties
        {
        }
      }
      -*/
    }
    

  2. Run slotomatic and perform a full build on your driver (as described in Chapter 2).
  3. NOTE: Like the device folder, the point folder is practically a formality in the Niagara AX framework.