beautypg.com

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

Page 42: See also, Do_writeport, Syntax, Remarks

background image

4–2

RAC6182-Specific Extensions to the CE API

Publication 6182-UM002B-EN-P

Macro

Digital Output

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.

Example

#include
#include

int main(void)

{
UCHAR pucData;

char buffer[256];

if (do_ReadPort(&pucData))

printf(“Relay is %s\n”, (pucData &

MASK_RELAY_PIN) ? “open” : “closed”);

else printf(“Error reading digital outputs\n”);

return(0);

}

See Also
do_WritePort

do_WritePort

This function writes digital output. It is prototyped in
DiagnosticOutputAPI.h.

Syntax

#include
#include

BOOL do_WritePort(UCHAR ucMask, UCHAR ucData)

Remarks
ucMask is a bit mask that determines which outputs are modified. If the
mask bit for a given output is set to 1, that output will be modified to
reflect the corresponding bit in ucData; otherwise the output will not be
modified, regardless of the setting of the corresponding bit in ucData.

This manual is related to the following products: