Build and Test a Service Interface Function Block Type
-
Start the FBDK.
-
Import library elements if and as needed.
-
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.
-
Edit the function block's elements:
-
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.
Compiled code will run but do nothing
useful.
-
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.
-
Generate a
.class
file with an appropriate compiler.
-
Test the FB type.
-
Document your work. It's not done until
it's documented!