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 detected.
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:
int CommandClient_Clean();
The closing allows to free resources allocated both on the PC side and on the RVT side.
6.2.3
Authentication
Please note that the user account covered here are applicative user account handled by
the RVT.
Once the TCP/IP, USB or Modbus connection has been established to the server, the
client must authenticate itself.
As the system can be accessed remotely, some basic authentication is put in place. This
allows distinguishing users and granting them certain rights to do things.
This authentication is mentioned as the first point of the command layer for the very
important reason that no command will be accepted before an authentication is
performed. The only exception is for the local administrator user that is automatically
detected based on its local connection to the server.
6.2.3.1 CommandClient_Authenticate
This function allows authenticating as a given user on the RVT.
68 – Windows communication DLL for PQ-Link protocol ç RVT communication
int
ConnectionType,
void ( __stdcall *Callback_ConnectionReset)(void));