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):
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 { } } -*/ }
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):
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. }
/*- 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]} } } -*/
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.
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 { } } -*/ }
NOTE: Like the device folder, the point folder is practically a formality in the Niagara AX framework.
Copyright © 2000-2014 Tridium Inc. All rights reserved.