Hitachi

JP1 Version 12 JP1/Base Function Reference


JevGetClose

Organization of this page

Description

This function disconnects the program from the event server and closes the JP1-event acquisition handle returned by the JevGetOpen() function.

The JP1-event acquisition handle returned by the JevGetOpen() function must be closed by using the JevGetClose() function. In Windows, if the process terminates without calling this function, a system-resource leak error occurs.

Definition header

JevApi.h

Format

int JevGetClose(long* lplStatus,
               JEVGETKEY key);

Arguments

lplStatus

In lplStatus, specify the pointer to the area for containing the status code that this function returns if the function abnormally terminates. The following explains the status codes that may be returned.

Table 3‒6: Status codes and meanings (JevGetClose)

Status code

Meaning

JEV_S_CONNECT_ERROR

Failed to connect the event server.

JEV_S_PARAM_ERROR

An invalid parameter is specified.

JEV_S_MAXOPEN

The number of opened files reached the maximum.

JEV_S_NOMEMORY

Memory is insufficient.

JEV_S_IO_ERR

An I/O error occurred.

JEV_S_SYSTEM_ERROR

A system error occurred (the system resource became insufficient).

key

In key, specify the handle for acquiring the target JP1 event (returned by the JevGetOpen() function).

Return values

Situation

Explanation

Normal termination

The function returns 0.

Abnormal termination

The function returns -1. Also, in the area specified in lplStatus, the function stores the detailed error code.