(Page 26 of 28 in this chapter)


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.

In MVIP-90 mode, the bus field is ignored and the stream and timeslot fields are interpreted as MVIP-90 streams and timeslots.

Refer to Section 4.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;
case MVIP95_MC1_BUS:
printf(" %s", " mc1");
break;
}

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


(Page 26 of 28 in this chapter)


tech_support@nmss.com
Copyright © 1997, Natural MicroSystems, Inc. All rights reserved.