Hitachi

JP1 Version 12 JP1/Base Function Reference


JevGetEvent

Organization of this page

Description

This function acquires a JP1 event that matches the condition specified in the JevGetOpen() function. You can call this function any number of times to acquire the JP1 events that satisfy the filter condition specified in the JevGetOpen() function in the order in which the events were registered with the event database.

Definition header

JevApi.h

Format

JP1EVENT JevGetEvent(long* lplStatus,
                     JEVGETKEY key,
                     JEVACCESSTYPE access);

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‒11: Status code and meaning (JevGetEvent)

Status code

Meaning

JEV_S_CONNECT_ERROR

Failed to connect the event server.

JEV_S_INVALID_SERVER

The event server name is invalid.

JEV_S_PARAM_ERROR

An invalid parameter is specified.

JEV_S_NO_EVENT

No JP1 events satisfy the filter condition.

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.

key

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

access

In access, specify either of the following values for specifying the action to be taken if no JP1 events satisfy the condition specified for acquiring JP1 events.

JEVGET_WAIT

Does not return the control until the corresponding JP1 event occurs.

JEVGET_NOWAIT

Returns an error immediately if the corresponding JP1 event is not found.

Return values

Situation

Explanation

Normal termination

The function returns the handle for accessing the JP1 event.

Abnormal termination

The function returns a null pointer. Also, in the area specified in lplStatus, the function stores the detailed error code.