D2000 VBApi - VBApi module

The VBApi module contains the support for:

Reading data from archive



Declaration
Sub ReadArchData(ByRef objName As String, ByRef bt As Date, ByRef et As Date,ByRef step As Long, ByRef writeMethod As Long, ByRef a_data() As VBApi_TUniVal, ByRef ok As Long)
Parameters
objNameName of object of the Historical value type.
btBegin time.
etEnd time.
stepTime step used for oversampling values in the archive (given in seconds). If it is 0, there will be read all values within the given time interval.
writeMethodReturns the archiving method of for writing into archive.
Return values:
  • 1 - periodically
  • 2 - on value change (Filter)
a_dataArray of the result values got from the archive after the successful calling.

Warning:
The array must not be dimensioned and must be empty before calling the procedure !
okReturn value - call success.
Return value
Value of the parameter ok.
 
Return valueDescription
0Call successful.
1Incorrect object name (also in case, that the object is not opened).
22No logged on user.
3Unexpected internal error.
4Incorrect parameters.

User's logon


User's logon and establishing a communication route is provided by the procedure Connect. It is appropriate for interactive work with the report (workbook).

It checks the status of the VBApi interface and executes required initialization operations, including getting the user name and password using the logon dialog box, if logon has not been performed. The logon dialog box is implemented as the LogOnDlg form.


Declaration
Sub Connect(ByRef server As String, ByRef procDesc As String, ByRef wdFreq As Long)
Parameters
serverName of the computer with running D2000 Server (/S).
procDescDescription of the client process, that will be stored in the log database - process start record.
wdFreqInterval for sending watch dog messages used for verifying the communication route functionality. The parameter substitutes the parameter /F from the command line.
Note
User can change the parameters server and procDesc in the logon dialog box.


Logon without the user presence is allowed by the procedure D2KernelLogon.


Declaration
Public Property Get D2KernelLogon(name As String, pass As String, server As String, procDesc As String, ByRef wdFreq As Long)
Parameters
nameUser's name.
passUser's password.
serverName of the computer with running D2000 Server.
procDescDescription of the client process, that will be stored in the log database - process start record.
wdFreqInterval for sending watch dog messages used for verifying the communication route functionality. The parameter substitutes the parameter /F from the command line.


Call success can be checked by calling the function IsConnectOK.


Declaration
Function IsConnectOK() As Boolean

Related pages:

Napíšte komentár