beautypg.com

Return value, Portability, Example – Rockwell Automation 6182 SDK User Manual

Page 43: See also

background image

RAC6182-Specific Extensions to the CE API

4–3

Publication 6182-UM002B-EN-P

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 can 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 write operation was successful, else FALSE.

Portability
This function is specific to the RAC6182 hardware.

Example

#include
#include

int main(void)

{
UCHAR ucData = 0xff;

if (do_WritePort(MASK_RELAY_PIN, ucData))

printf(“Relay %s\n”, (MASK_RELAY_PIN & ucData) ? “closed” : “opened”);

else printf(“Error changing relay state\n”);

return(0);
}

See Also
do_SetBits, do_ClearBits, do_ToggleBits

This manual is related to the following products: