|
This section outlines key procedures that are often used with DTI.
This documents the procedure for obtaining a connection handle to a server, which is a first step for many DTI functions.
To obtain a Connection handle to a server
// initialize status code return BTI_LONG status = 0; // Call PvStart function with its reserved // parameter status = PvStart(0);
// initialize variables BTI_LONG status = 0; BTI_CHAR_PTR uName = "jsmith"; BTI_CHAR_PTR pword = "123"; BTI_CHAR_PTR svrName = "myserver"; BTI_LONG hConn = 0xFFFFFFFF; // after execution, hConn contains connection // handle to pass to other functions status = PvConnectServer(svrName, uName, pword, &hConn); // if status != 0, handle errors now
Connection handles are required by many DTI functions. You can have multiple connections open at a time. For each connection or handle, however, you should call the PvDisconnect() function to release the handle.
Many of the configuration functions take a setting ID as a parameter. This procedure describes the prerequisite functions for obtaining a setting ID.
To obtain the ID for a Specific Setting
Many functions require that you pass a DTI structure when making the functional call. The following code segment shows an example of a function call including a structure. See Structures in DTI for more information about DTI structures.
WORD rValue = P_OK; TABLEMAP* tableList; WORD tableCount; rValue = PvGetTableNames(m_DictHandle, &tableList, &tableCount);
|
Chapter contents
Prev topic: Sample Programs For the Distributed Tuning Interface
|