Oc_setforces -64 – Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual
Page 118
![background image](/manuals/579094/118/background.png)
6–64
Library of Routines
OC_SetForces
Publication 1747-6.5.3 June 1998
OC_SetForces
OC_SetForces installs and removes input and output forces to the scanner.
Syntax:
int
OC_SetForces(HANDLE handle, FORCEDATA *forcedata)
Parameters:
Description:
If the result of OC_SetForces removes all I/O forces, the scanner disables forces. If any I/O forces are later
installed, OC_EnableForces must be called to re-enable forces.
The
FORCEDATA
structure is defined as:
typedef struct tagFORCEDATA {
BYTE
SlotNum;
/* Slot Number of local I/O or 1747-SN module (1-30)*/
WORD
WordOffset;
/* Word Offset in I/O image */
BYTE
IOType;
/* Selects Input or Output Image */
WORD
ForceMask;
/* Install/Remove bitmask */
WORD
ForceVal;
/* Install value bitmask */
} FORCEDATA;
Parameter:
Description:
handle
Must be a valid handle returned from OC_OpenScanner
forcedata
Defines the inputs and outputs to force.
This value:
Means:
SlotNum
WordOffset
SlotNum
and
WordOffset
select the word of I/O that contains the bits
to be forced
IOType
IOType
must be FORCE_INPUTS or FORCE_OUTPUTS
ForceMask
ForceVal
All 16 bits of the word are installed/removed according to
ForceMask
and
ForceVal
Each bit in
ForceMask
that is set to 0 will have its force removed. Each
bit in
ForceMask
that is set to 1 will have its force installed. For each bit
that has its force installed, the corresponding bit in
ForceVal
determines
the state of the force. For bits that have their force removed, the
corresponding bit in
ForceVal
is ignored.