(Page 4 of 7 in this chapter)


4.3 Sending a Pattern

swiSendPattern allows you to send a fixed eight-bit pattern out of an output terminus of the switch block.

For example, to provide battery to the operator stations on an S-Connect board, you would send the pattern SWI_A_BIT_ON to the operator stations on local bus stream 3.

Figure 8 illustrates the state of the switch block before the pattern is sent.

Figure 8. MVIP Switches Before the Pattern is Sent


The following code shows how to provide battery to the operator stations on an
S-Connect board by sending the pattern SWI_A_BIT_ON to the operator stations on local bus stream 3:

/* Provide battery to the S-Connect operator stations */
void mySendOffhook(SWIHD cxhd)
{
SWI_TERMINUS outputs[24];
BYTE patterns[24];
unsigned count;

/* SendPattern out to operator interfaces via local:3:timeslot */
for (count = 0; count < 24; count++)
{
outputs[count].bus = MVIP95_LOCAL_BUS;
outputs[count].stream = 3;
outputs[count].timeslot = (DWORD)count;
patterns[count] = SWI_A_BIT_ON;
}
swiSendPattern(cxhd, patterns, outputs, count);
}

Figure 9 illustrates the state of the switch block after the pattern is sent:

Figure 9. MVIP Switches After the Pattern is Sent


The demonstration program prt2prt demonstrates sending patterns. Refer to Section 10.3, Port to Port Program: prt2prt.



(Page 4 of 7 in this chapter)


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