Table of Contents Index NMS Glossary Previous Page Next Page (Page 27 of 29 in this chapter) Version


swiSampleInput

Description

Retrieves the current datum values present on specified switch block inputs.

Prototype

DWORD swiSampleInput ( SWIHD swihd,
SWI_TERMINUS input[],
BYTE data[],
unsigned count)

swihd Handle returned by swiOpenSwitch.

input Array of terminus structures for the input of the switch block. The terminus structure is:

typedef struct
{
DWORD bus;
DWORD stream;
DWORD timeslot;
} SWI_TERMINUS;
See swiMakeConnection for a description of these fields.

data Array that receives values present on the specified switch block inputs.

count Number of elements in the input and data arrays.

Return Values

Events

Details

This function reads the data available on one or more inputs of a switch block. Calling this function does not affect the switch block inputs or connections.

Note: Under Solaris, the upper limit for the number of terminuses that can be batched in one call is 32.

Refer to Section 5.5, Sampling Data for more information.

If CTAERR_DRIVER_ERROR is returned, call swiGetLastError to retrieve the MVIP device error code.

See Also

swiGetLastError, swiGetOutputState, swiMakeConnection, swiMakeFramedConnection, swiOpenSwitch, swiSendPattern

Example


void myPrintInput(SWIHD hd, SWI_TERMINUS input)
{
BYTE data;

swiSampleInput(hd, &input, &data, 1);

switch (input.bus)
{
case MVIP95_MVIP_BUS:
printf(" %s", " mvip");
break;
case MVIP95_LOCAL_BUS:
printf(" %s", "local");
break;
}

printf(":%2d:%02d=%02X\n", input.stream, input.timeslot, data);
}


Table of Contents Index NMS Glossary Previous Page Next Page (Page 27 of 29 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.