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.

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

Return Value Name Code<br />

(Hex)<br />

SIOMM_BRAIN_ERROR_RESERVED E007 Reserved<br />

SIOMM_BRAIN_ERROR_BUSY E008 The brain is busy.<br />

SIOMM_BRAIN_ERROR_CANT_ERASE_FLASH E009 Flash memory cannot be erased.<br />

SIOMM_BRAIN_ERROR_CANT_PROG_FLASH E00A Flash memory cannot be<br />

programmed.<br />

SIOMM_BRAIN_ERROR_IMAGE_TOO_SMALL E00B Downloaded image is too small.<br />

SIOMM_BRAIN_ERROR_IMAGE_CRC_MISMATCH E00C Image CRC mismatch<br />

SIOMM_BRAIN_ERROR_IMAGE_LEN_MISMATCH E00D Image length mismatch<br />

SIOMM_BRAIN_ERROR_FEATURE_NOT_IMPL E00E Feature not implemented<br />

SIOMM_BRAIN_ERROR_WATCHDOG_TIMEOUT E00F Communications watchdog<br />

timeout<br />

OptoSnapIoMemMap Interface<br />

Connection Methods<br />

Use the following methods to connect to a brain.<br />

Method Description<br />

OpenEnet V<br />

[in] string strIpAddressArg<br />

[in] long nPort<br />

[in] long nOpenTimeOutMS<br />

[in] long nAutoPUC<br />

OpenEnet2<br />

[in] string strIpAddressArg<br />

[in] long nPort<br />

[in] long nOpenTimeOutMS<br />

[in] long nAutoPUC<br />

[in] long nConnectionType<br />

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

Indicates<br />

Starts the connection process to a brain via TCP/IP. Use the<br />

IsOpenDone() method to check whether the open process is<br />

completed.<br />

bstrIpAddressArg is a string representing the IP address of the<br />

Ethernet-<strong>based</strong> brain, such as 10.192.54.1. The format of the string<br />

is not verified.<br />

nPort is the IP port used to connect to the brain. The default is 2001.<br />

nOpenTimeOutMS is the timeout period in milliseconds for the open<br />

process. A different timeout is used for normal communications. See<br />

SetCommOptions below.<br />

If nAutoPUC is a non-zero value, the Powerup Clear flag on the<br />

brain is automatically set. If zero, you must send a Powerup Clear by<br />

using the SetStatusOperation(1) method. (See the Status Write<br />

Methods table on page 71.)<br />

Same as OpenEnet() above, except it allows TCP or UDP to be<br />

specified.<br />

nConnectionType is 1 for TCP <strong>and</strong> 2 for UDP.

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

Saved successfully!

Ooh no, something went wrong!