2 s26_resetiom(), 3 s26_registerallioms() – Sensoray 2600 User Manual

Page 12

Advertising
background image

Sensoray 2600 Programming Guide

8

Initialization and Status Functions

Returns:

u32 value that indicates whether the reset operation was successful. Returns a non-zero value if successful, or zero
if the reset operation failed.

Notes:

This function attempts to reset the specified MM and all of its connected IOMs, then it verifies that the MM has
undergone a reset by checking to see if the MM’s HRST flag is set. When the MM reset is confirmed, the HRST
flag is cleared and the function returns a non-zero value to indicate that the MM is ready to communicate with the
Ethernet client. If the MM does not respond, or it fails any part of the synchronization sequence, a zero value is
returned to indicate the problem.

S26_ResetNetwork()

should be called after opening the MM and before calling any of the gateway or comport

transaction functions. In addition, this function should be called to resynchronize the client to the MM if the MM
experiences an unexpected reset operation resulting from a communication watchdog time-out.

Assuming operation on a private LAN, a delay of up to seven seconds can elapse before this function returns,
although the typical delay is much shorter. A delay of up to four seconds can occur if

S26_ResetNetwork()

is

called while the MM is already undergoing a reset in response to a network communication watchdog time-out.
The maximum delay will result if the MM is not reachable.

Example:

See section 4.4.4.

4.4.2 S26_ResetIom()

Function:

Executes an IOM module reset.

Prototype:

u32 S26_ResetIom( u32 hbd, IOMPORT IomPort, u32 msec, u32 retries );

Returns:

Error code as described in section 5.5. Zero is returned if the operation was successful.

Notes:

The target IOM will immediately undergo a reboot and it is unregistered with the middleware. The calling thread is
blocked while the reboot is in progress, and while communication is being established with the target module
following the module reset. If communication with the target module is successfully restored, the target module is
re-registered with the MM and the target’s RST flag is cleared.

It is strongly recommended that no other transactions be in progress for the target IOM’s MM while this call is
active. Other threads may resume transaction processing after the reset operation is finished and communication
has been restored with the target module.

Use

S26_ResetNetwork()

instead of

S26_Sched2600_Reset()

in cases where more than one module is to be

reset or the MM must be reset.

Example:

// Reset the IOM connected to MM number 0, IOM port 6.

S26_ResetIom( 0, 6, 1 );

4.4.3 S26_RegisterAllIoms()

Function:

Detects and registers all IOMs connected to a MM.

Parameter

Type

Description

hbd

u32

MM handle.

IomPort

u8

The IOM port number (on the MM) to which the target IOM is connected.

msec

u32

Maximum time, in milliseconds, to allow for the MM to reply.

retries

u32

Maximum number of transaction retry attempts.

Advertising