Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

VbCallOpen Function

  • Last UpdatedJul 18, 2023
  • 1 minute read

The VbCallOpen function is a Cicode function used to call a VBA function or subroutine from Cicode. It is used to initiate a call to the VBA function or subroutine and returns a handle (of OBJECT data type) to that opened function call.

VbCallOpen is used in conjunction with VbCallRun and VbCallReturn functions, which can all be nested to implement the entire function set with a single line of Cicode. For further information, see the section "Calling VBA from Cicode".

Syntax

ReturnValue = VbCallOpen(FunctName, ArgList)

ReturnValue:

The handle to the opened VBA function.

FunctName:

The name of the VBA function or subroutine being called.

ArgList:

A comma separated list of arguments to pass to the function or subroutine being called.

Return Value

VbCallOpen returns an Object data type containing a handle to the VBA function being called. If the function cannot open the VBA function or subroutine the return value is zero.

VbCallRun Function | VbCallReturn Function

Example

FUNCTION
TestCitectVBA()
INT iRet;
STRING sMsg = "Hello";
INT iVal = 123;

iRet = VbCallReturn(VbCallRun(VbCallOpen("CiVBATest",
iVal)));
Message("TestCitectVBA Function", "CiVBATest = " +
IntToStr(iRet), 0);
END

Example

Function CiVBATest(Value As Integer) As Integer
CiVBATest = Value * 2
End Function

In This Topic
TitleResults for “How to create a CRG?”Also Available in