4 status and control, 2 s26_boardclose(), 1 s26_resetnetwork() – Sensoray 2600 User Manual

Page 11

Advertising
background image

Sensoray 2600 Programming Guide

7

Initialization and Status Functions

char MMAdrs[] = "10.10.10.1";

u32 errflags = S26_BoardOpen( 0, 0, MMAdrs );

if ( errflags )

{

// .... Handle error ....

}

Example:

// Declare MM number 0, client is multi-homed. Note that some operating

// systems do not support more than one network card.

char ClientAdrs[] = "192.168.10.1";

char MMAdrs[] = "10.10.10.1";

u32 errflags = S26_BoardOpen( 0, ClientAdrs, MMAdrs );

if ( errflags )

{

// .... Handle error ....

}

4.3.2 S26_BoardClose()

Function:

Unregisters a MM with the middleware.

Prototype:

void S26_BoardClose( u32 hbd );

Returns:

None.

Notes:

This function unregisters a MM that has been previously registered by

S26_BoardOpen()

. Each MM that has been

registered by

S26_BoardOpen()

must be unregistered when it is no longer needed by an application. All open

MMs are automatically closed by

S26_DriverClose()

, so it is not necessary to explicitly call

S26_BoardClose()

when shutting down your application.

S26_BoardClose()

severs the middleware’s communication link between the application program and the MM,

and frees the MM’s board handle. Once freed, the board handle is available for assignment to the same MM or to
any other MM.

All IOMs that have been registered for the target MM are unregistered. This can be useful if you will be
connecting IOMs to or disconnecting IOMs from the MM while the application is running.

S26_BoardClose()

does not alter the state of the MM. The MM’s communication watchdog interval remains in

effect, and the gateway and comports continue any autonomous operations that are already in progress. Since all
communications will be severed between the client and the MM, the application should ensure that no gateway or
comport transactions are in progress when

S26_BoardClose()

is called.

Example:

// Close MM number 0.

S26_BoardClose( 0 );

4.4 Status and Control

4.4.1 S26_ResetNetwork()

Function:

Resets a MM and all connected IOMs and synchronizes communications between the client and the MM.

Prototype:

u32 S26_ResetNetwork( u32 hbd );

Parameter

Type

Description

hbd

u32

MM handle.

Parameter

Type

Description

hbd

u32

MM handle.

Advertising