39
Checking for Errors
Section 3-4
Once event notification has been received by the user application, execute
the corresponding event processing. For example, when an explicit client
response is received, prepare a data buffer to hold the received service data
and read the response.
Checking Events by
Polling
The event queue can be checked from a user application with the
SCAN_PeekIrqEvent(), SCAN_PeekClientEvent(), and
SCAN_PeekServerEvent() functions.
If the check shows an event in the event queue, execute the corresponding
event processing. For example, for an explicit client response event, check
the received data size using the SCAN_ClientEventLength() function, prepare
a data buffer to hold the received service data, and read the response.
3-4
Checking for Errors
The value returned by the function shows whether an error occurred. The
Scanner SDK’s API functions are all bool type functions and the result of the
function’s execution is returned as one of the following boolean values:
FALSE: The function was completed with an error.
TRUE: The function was completed normally.
If an error occurred, detailed error information can be obtained with the Get-
LastError() function. Refer to
7-2 Identifying Errors Detected by Functions
for
the meaning of the error codes obtained with the GetLastError() function and
appropriate error processing.
Note
GetLastError is a Windows API function. Detailed error information can be
obtained by calling GetLastError immediately after executing the DeviceNet
PCI Board API function, as shown below.
Example: Using GetLastError() Function with Board Open API Call
DWORD dwErrCode;
//DeviceNet PCI Board Open API function call
if(SCAN_Open(DeviceNo,Handle)==false){
//Gets the detailed error code
//when the function returns an error.
dwErrCode=GetLastError();
}
3-5
Parameters
Parameter Types
The PCI Board has the parameters listed in the following table.
Name
Meaning
Initial Value
Message Monitoring
Timer List
A list of message monitoring tim-
ers for all node addresses. The
monitoring time is from when the
explicit request message is sent
until the response is received.
0 (2 s) is set for all node
addresses as the default.
Communications
Cycle Time
Used with the Master function.
The communications cycle time is
the cycle for I/O communications.
0 (automatic) is set as the
default.
Summary of Contents for DeviceNet 3G8F7-DRM21-E
Page 1: ...OPERATION MANUAL Cat No W381 E1 02 3G8F7 DRM21 E DeviceNet PCI Board ...
Page 2: ...3G8F7 DRM21 E DeviceNet PCI Board Operation Manual Revised July 2005 ...
Page 3: ...iv ...
Page 5: ...vi ...
Page 29: ...12 Preparation for Operation Section 1 8 ...
Page 67: ...50 PC Watchdog Timer Management Function Section 3 11 ...
Page 115: ...98 Maintenance API Functions Section 4 7 ...
Page 131: ...114 Remote I O Communications Characteristics Section 6 1 ...
Page 145: ...Index 128 ...
Page 147: ...130 Revision History ...