The first item is defined as follows:
#ifdef COMMANDCLIENTDLL_EXPORTS
#define COMMANDCLIENTDLL_API __declspec(dllexport)
#else
#define COMMANDCLIENTDLL_API __declspec(dllimport)
#endif
The "COMMANDCLIENTDLL_EXPORTS" define is used within the DLL to make sure that the functions get exported.
When the DLL is used in an external program, it is not defined and the functions are then imported from the DLL.
All functions return an integer providing an error code to the calling layer.
The "__stdcall" specifier is used to indicate that the calling convention to be used is the standard one.
Special care has been taken so that the function names exported by the DLL are the same as the ones defined
above.
WARNING: in the rest of this chapter, "COMMANDCLIENTDLL_EXPORTS" and "__stdcall" have been removed from
the documentation to ease the reading. They are naturally always present in the header file.
6.2.2.
Opening and Closing
6.2.2.1. CommandClient_Init
This function opens the connection to the RVT.
It has the following prototype:
int CommandClient_Init(char *RVTAddress,
The RVTAddress parameter is an IP address in the case of a TCP/IP connection e.g. "192.168.1.40" or a COM port in
the case of a serial connection e.g. "COM11".
The ConnectionType can take two values:
0 or CONNECTION_TYPE_TCPIP for a TCP/IP connection
1 or CONNECTION_TYPE_SERIAL for a serial connection
The Callback_ConnectionReset is a pointer to a function that will be called if a loss of connection with the RVT is de-
tected.
If one does not wish to use the callback mechanism, this parameter can be set to NULL. Unwanted disconnections
can then be detected when any of the DLL function call returns the "RVT_SYS_SOCKET_DISCONNECTED" error
code.
When a disconnection is happening, it is necessary to call the clean function to free the PC resources used and try to
connect to the RVT again.
6.2.2.2. CommandClient_Clean
This function closes the connection to the RVT.
It has the following prototype:
STATUS
Approved
int
ConnectionType,
void ( __stdcall *Callback_ConnectionReset)(void));
SECURITY LEVEL
Public
DOCUMENT ID
9AKK106713A9758
RVT CO MM UNI CATI O N
REV.
LANG.
PAGE
K
en
58/71
© 2022 Hitachi Energy. All rights reserved.