Search

Home

Home

DLL CALL FUNCTION

DLL CALL FUNCTION

The DLL CALL FUNCTION operator allows external functions from DLL libraries to be invoked during data processing in the GRAVITY system.

For each record of the input bus, the operator executes the specified function from the DLL library, passing parameters taken directly from the bits of the data bus. This enables dynamic data processing using logic implemented outside the system—native code (for example, C/C++ or .NET).

Thanks to this functionality, it is possible to integrate with:

  • existing third-party libraries,
  • the user’s own algorithms,
  • functions that perform complex operations which are difficult to implement using GRAVITY’s built-in operators.

The operator also allows the function result to be received and written to specified bus bits, as well as the use of reference parameters, which enables further processing of the data returned by the function in subsequent stages of the data flow.

An example of a GRAVITY project using the DLL CALL FUNCTION operator:

image

OPERATOR CONFIGURATION

In the first step, you must determine whether the function is static or requires object instantiation.

image
  • For a static function, you must specify the path to the DLL file in the DLL path field.
image
  • For a non-static function, specify the instance of the class you will use in the Instance name field.
image
icon
Refer to the DLL OBJECT CREATIONDLL OBJECT CREATION operator to create instances of classes contained in the given library.

In the next step, select the function that will be invoked by the operator in the Function name field (as you start typing, the system will suggest available function names).

image

In the Method signature field, you will be able to select the appropriate function signature if the function is overloaded. The signature indicates the function structure, the return type, and the types of the invocation arguments.

image

You can use the Auto set argument type button; the system will then automatically populate the arguments and their types (on the Arguments tab) based on the function signature and associate them with bus bits of the appropriate type.

image

You can change the bits used as function arguments by clicking the appropriate row in the list.

icon
Remember to select the Ref checkbox if the parameter is passed by reference.

If you want the value returned by the function to be written to the appropriate bus bit, fill in the Result column field. The Custom result type field specifies the type of data returned by the function. To correctly use an external function, you need to know the data type returned by that external function. When editing this field, a list of available data type options will be suggested automatically.

icon
The Result column field must have the same type as the value returned by the function, as defined in the Result column field.

If everything has been configured correctly, after clicking the Test button you will see the function result on the Test result tab.

image