Applies To:
  • CitectSCADA 5.xx

Summary:
I'm trying to pass multiple arguments that are held in local Cicode variables to a DLL but I can't seem to get the formatting correct. What am I doing wrong? 

Solution:
To pass multiple arguments to a DLL where the values are stored in Cicode variables you must surround the Cicode variable with plus sign (+), then with quote ("), then with carat quote (^"), and finally the whole string of arguments with quotes (").

For Example:

I have a DLL called Example.DLL that returns a string and it requires three string arguments to be passed to it. The string argument will be held within Cicode variables sHigh, sMid, and sLow.

Function
ExampleDLLCall(String sHigh, String sMid, String sLow)

Int hDLL;
String sResult;

    hDLL = DLLOpen("C:\CITECT\Bin\Example.dll",
  "GetTimeStr", "CCCC");
        If hDll <> -1 Then
            sResult=DLLCall(hDLL, "^""+sHigh+"^",
            ^""+sMid+"^", ^""+sLow+"^"");
            DLLClose(hDLL);
        End
End

 

Keywords:
 

Attachments