14.08.2013 Views

snap ethernet-based i/o units protocols and programming guide

snap ethernet-based i/o units protocols and programming guide

snap ethernet-based i/o units protocols and programming guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Return Values<br />

CHAPTER 3: USING THE SNAP ETHERNET I/O DRIVER TOOLKIT<br />

All methods return a long integer value. The following table lists possible return values.<br />

Return Value Name Code Indicates<br />

SIOMM_OK 1 The method succeeded.<br />

SIOMM_ERROR -1 A general error occurred.<br />

SIOMM_TIME_OUT -2 The method call timed out.<br />

SIOMM_ERROR_NO_SOCKETS -3 Sockets interface (wsock32.dll) could not<br />

be found.<br />

SIOMM_ERROR_CREATING_SOCKET -4 A socket could not be created.<br />

SIOMM_ERROR_CONNECTING_SOCKET -5 A socket connection could not be made.<br />

Not used at this time.<br />

SIOMM_ERROR_RESPONSE_BAD -6 The response from the SNAP brain was<br />

bad. The most likely reason is that<br />

communication responses are out of<br />

sync. This may indicatef a problem with<br />

the network<br />

SIOMM_ERROR_NOT_CONNECTED_YET -7 Returned by IsOpenDone() to indicate the<br />

open process isn't done yet but has not<br />

timed out.<br />

SIOMM_ERROR_OUT_OF_MEMORY -8 Out of memory.<br />

SIOMM_ERROR_NOT_CONNECTED -9 No succesfull connection exists to a brain<br />

via the OptoEnet() or OptoEnet2()<br />

methods.<br />

The SNAP brain itself may also generate errors. If a comm<strong>and</strong> to the SNAP brain is unsuccessful,<br />

the method attempts to read the error generated by the SNAP brain.<br />

The return values in the following table correspond with the error codes shown on page 98.<br />

Return Value Name Code<br />

(Hex)<br />

Indicates<br />

SIOMM_BRAIN_ERROR_UNDEFINED_CMD E001 Undefined comm<strong>and</strong><br />

SIOMM_BRAIN_ERROR_INVALID_PT_TYPE E002 Invalid point type<br />

SIOMM_BRAIN_ERROR_INVALID_FLOAT E003 Invalid float<br />

SIOMM_BRAIN_ERROR_PUC_EXPECTED E004 A Powerup Clear is expected.<br />

SIOMM_BRAIN_ERROR_INVALID_ADDRESS E005 A comm<strong>and</strong> attempted to<br />

read/write an invalid memory<br />

address.<br />

SIOMM_BRAIN_ERROR_INVALID_CMD_LENGTH E006 Invalid comm<strong>and</strong> length<br />

SNAP Ethernet-Based I/O Units Protocols <strong>and</strong> Programming Guide 61

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!