Oc_setforces, Oc_setforces -55, Syntax – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual
Page 115: Parameters: description

Publication 1747-UM002A-US-P - June 2000
Library of Routines 6-55
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.