Download Single-Slot PC Interface Module (PCIM) User`s Manual

Transcript
4
GetCir – Read Input Circuit Value
Code Summary
#include <pcim.h>
int
GetCir (IMnum, Devicenum, Offset, State)
unsigned int IMnum, Devicenum;
unsigned int Offset;
char *State;
Description
A Get Circuit call allows the state of a single input circuit to be read from the specified
PCIMs Input Table and be placed into the Host memory “State” parameter.
IMnum is the PCIM number configured during initialization. The Devicenum parameter
specifies the serial bus address of the device which contains the input circuit. The
“Offset” parameter indicates which bit of Devicenum is to be read. This value ranges
from 1 through 1024 (in bits).
“State” is a character pointer in which GetCir will store the value of the circuit as
indicated by the above parameters. The contents of State will be either a ‘1’ or ‘0’ (ON or
OFF).
Parameters are summarized as follows:
Parameter Values
IMnum
Relative number of PCIM
Devicenum 0–31
Specifies I/O device from which input circuit will be read
Offset
1–1024
Input circuit offset in specified I/O device, in bits
0/1
ON or OFF condition of circuit read from PCIM
State
4-38
1–64
Function
Single-Slot PCIM User’s Manual – January 1994
GFK-0881