Oc_getswitchposition, Oc_getswitchposition -34, Return value: considerations – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 94: Example, Syntax, Parameters: description

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

6-34 Library of Routines

Return Value:

Considerations:

Supported in the DOS API library and the Windows NT API library

Example:

HANDLE

Handle;

STSFILE

stsfile;

int

retcode;

retcode = OC_GetStatusFile( Handle, &stsfile );

OC_GetSwitchPosition

OC_GetSwitchPosition reads the current position of the three-position
front-panel switch from the scanner.

Syntax:

int

OC_GetSwitchPosition(HANDLE handle, BYTE

*swpos);

Parameters:

Description:

The switch position has no effect on the scanner. The application can
use this switch for any purpose.

The scanner must be initialized before you can monitor the switch
position.

Name:

Value:

Description:

SUCCESS

0

system status file was read successfully

ERR_OCACCESS

2

handle

does not have access to scanner

Parameter:

Description:

handle

Must be a valid handle returned from OC_OpenScanner

swpos

If

swpos

is:

SWITCH_TOP

switch is in the top position

SWITCH_MIDDLE

switch is in the middle position

SWITCH_BOTTOM

switch is in the bottom position

Advertising
This manual is related to the following products: