Cicode Programming Reference > Cicode Function Categories > DLL Functions Introduction > DLLCall

DLLCall

Calls a DLL function, and passes a string of arguments to that function. CitectSCADA converts these arguments (where required) into the type specified in the DLLOpen() call. If an argument cannot be converted, it is set to zero (0) or an empty string "".

You need to first open the DLL with the DLLOpen() function.

Only one call to the DLLCall() function can be made at a time, which means runtime will wait for the called function to return before doing anything else. If the called function takes too long to return, it won't let other tasks execute. Therefore, care needs to be taken so that one call returns before the next is made.

Good programming practice requires that functions which are not expected to complete in a short time are run as separate Windows threads and return a value immediately to CitectSCADA.

Syntax

DLLCall(hFunction, sArgs)

hFunction:

The DLL function handle, returned from DLLOpen().

sArgs:

The string of arguments to pass to the DLL function. The argument string contains all the arguments for the function, separated by commas (,). Enclose string arguments in quote marks "", and use the string escape character (^) to put a string delimiter within a string. This syntax is the same as the syntax for the TaskNew() function

Return Value

The result of the function, as a string.

Related Functions

DLLOpen, DLLClose

Example

See DLLOpen

See Also

DLL Functions