Download 78M6618 M-API Library User Guide

Transcript
UG_6618_029
4.5.2
78M6618 M-API Library User Guide
MAPI_RelayControl ()
Purpose
Turning Relay ON/OFF (close/open circuit) on all eight channels.
Synopsis
void
Parameters
Channels
MAPI_RelayControl( IN unsigned char Channels);
Input parameter.
Each bit indicates turning ON(1) or OFF(0). The bit’s position
represents the specific channel/outlet number. For example:
0x01h – Turn relay ON on channel 1/A. Turn relays OFF all other channels.
0x02h – Turn relay ON on channel 2/B. Turn relays OFF all other channels.
0x04h – Turn relay ON on channel 3/C. Turn relays OFF all other channels.
0x08h – Turn relay ON on channel 4/D. Turn relays OFF all other channels.
0x10h – Turn relay ON on channel 5/E. Turn relays OFF all other channels.
0x20h – Turn relay ON on channel 6/F. Turn relays OFF all other channels.
0x40h – Turn relay ON on channel 7/G. Turn relays OFF all other channels.
0x80h – Turn relay ON on channel 8/H. Turn relays OFF all other channels.
Multiple channels can be turned ON with a single call to this API by setting 1 at
the bits representing the channels. For example:
0x81h – Turn relay ON on channels 1&8/A&H. Turn relays OFF all others.
0xFFh – Turn relay ON on all channels.
0x00h – Turn relay off of all channels.
0x0Fh – Turn relay ON on all 4 lower channels and OFF of all 4 higher channels
0xF0h – Turn relay ON on all 4 higher channels and OFF of all 4 lower channels
Return Codes
4.5.3
None.
MAPI_CloseCircuit_0X()
Purpose
Get zero-crossing status when positioning from open circuit to close circuit. The
value returned TRUE/FALSE indicates whether Voltage zero-crossing has
occurred. The usage of this API is intended to be for when the circuit is
transitioning from open to close. This API uses the hardware Timer 1 in the case
when zero crossing does not take place. A delay of 20ms is set for such break.
Synopsis
bool
Parameters
None.
Return Codes
TRUE – Zero crossing occurs.
FALSE – Zero crossing does not occur.
Rev. 1.00
MAPI_CloseCircuit_0X( void );
41