beautypg.com

Do_togglebits, Syntax, Remarks – Rockwell Automation 6182 SDK User Manual

Page 46: Return value, Portability, See also

background image

4–6

RAC6182-Specific Extensions to the CE API

Publication 6182-UM002B-EN-P

do_ToggleBits

This function toggles digital outputs. It is prototyped in
DiagnosticOutputAPI.h.

Syntax

#include
#include

BOOL do_ToggleBits(UCHAR ucMask)

Remarks
Outputs corresponding to bits in ucMask that are set to 1 are toggled.
For any output whose bit is 1 in ucMask, if its previous output was
TRUE (closed or high) it will be set FALSE (open or low) and vice-
versa. All pins whose bit is 0 in ucMask are left unchanged.

Note that the relay contacts are normally closed (i.e., closed when the
relay is not energized). Thus, when the relay output is set to 1 or TRUE,
the contacts will be open and vice versa.

The following macros may be used (separately or bitwise ORed together)
to evaluate ucMask:

Macro

Digital Output

MASK_DIAG_PIN_A

J10, pin A (no external access)

MASK_DIAG_PIN_B

J10, pin B (no external access)

MASK_DIAG_PIN_C

J10, pin C (no external access)

MASK_DIAG_PIN_D

J10, pin D (no external access)

MASK_RELAY_PIN

J16 (Relay – contacts NC)

Return Value
TRUE if read operation was successful, else FALSE.

Portability
This function is specific to the RAC6182 hardware.

See Also
do_SetBits, do_ClearBits, do_WritePort

This manual is related to the following products: