Build and Test a Service Interface Function Block Type

  1. Start the FBDK.
  2. Import library elements if and as needed.
  3. Create a new Service Interface FB (SIFB) type in the editor by double-clicking on the ServiceInterface FB type of the template folder in the Library Navigator.
  4. Edit the function block's elements:
  5. 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!
  6. Generate and compile a Java® source file with the Save As... button.
    Compiled code will run but do nothing useful.
  7. Use a text editor or Integrated Development Environment (IDE) such as Eclipse to fill in the skeleton service_XXX(...) methods in the generated .java file, including any additional instance variables, supporting methods, etc., as required.
    Don't forget to set the QO.value field as appropriate and invoke the serviceEvent(this) method on the appropriate event output, e.g., INITO.serviceEvent(this) when leaving the service_INIT(...) method.
  8. Generate a .class file with an appropriate compiler.
  9. Test the FB type.
  10. Document your work. It's not done until it's documented!