(Page 6 of 7 in this chapter)


4.5 Sampling Data

If you want to know what data is present on a switch block input terminus, use swiSampleInput.

For example, if you wanted to read the bits on an incoming analog line on an
AG-8 board, you would sample the data on the AG-8's incoming line's timeslot.

The following example code reads the bits on an incoming analog line on an
AG-8 board:

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

input.bus = MVIP95_MVIP_BUS;
input.stream = stream;
input.timeslot = timeslot;

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 6 of 7 in this chapter)


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