
Description of the DP Functions, Data, and Error Codes
DP Base Programming Interface for CP 5613/CP 5614
72
C79000-G8976-C108-01
4.1.4 DP_open
Purpose
This function logs on a DP user program for communication. If successful, the
function returns a user handle. The user handle must be included in all further
function calls.
Syntax
DPR_DWORD DP_open (
DPR_STRING *cp_name, // in
DPR_DWORD *user_handle, // out
DP_ERROR_T *error ); // out
Parameters
Name Description
cp_name Configured name of the CP 5613/CP 5614, (for example,
"CP5613_5614_1" for the first inserted CP).
user_handle Pointer to the user handle variable - if successful, the user
handle assigned to the user program is entered here.
error
Address of a structure provided by the user program of the
type DP_ERROR_T - If an error occurred, the structure
contains details for troubleshooting (see Section 4.4).
Return Value
Name Description
DP_OK Successful completion of the function.
otherwise if error->error_code ==
CI_RET_OPEN_CP_NOT_
STARTED
CP not started.
otherwise if error->error_code ==
DP_RET_TOO_MANY_USR
No further instances can log on at the
dp_base.dll.
other
Unsuccessful completion of the
function.
Komentáře k této Příručce