// ACCES I/O Products header file // Must be included to access functions in individual card object file /* Header file for A/D card access. */ #include "ACCES.H" #ifndef __card_defined__ #define __card_defined__ #ifdef __cplusplus // This is an internally used variable which is equal to the current channel // if channel setting was accomplished by calls to SETCHANNEL extern "C" far pascal int CURCH = 0; // This is an internally used variable that is equivalent to the A/D card's // base address extern "C" far pascal int BADDR = 0; // Returns card number, no parameter extern "C" far pascal uint AD_NAME(void); // Returns maximum number of channels available on the card, no parameter extern "C" far pascal uint MAXCH(void); // Returns maximum selectable IRQ level, no parameter extern "C" far pascal uint MAXIRQ(void); // Returns bitmap of valid IRQ's, a 1 signifying valid, a 0 signifying invalid extern "C" far pascal uint VALIDIRQ(void); // Start A/D conversion at selected base address extern "C" far pascal void STARTCONVERSION(uint BASE); // Retrieve conversion at base address, returns counts extern "C" far pascal uint RETRIEVEANALOGCONVERSION(uint BASE); // Retrieve conversion at base address, returns raw bits extern "C" far pascal uint RETRIEVEANALOGDATA(uint BASE); // Acquires data from FIRSTCH to LASTCH for SCANS number of times. extern "C" far pascal uint GETADDATA(uint BASE, uint FIRSTCH, uint LASTCH, uint SCANS, uint *BUFFER); // Check to see if EOC active, TRUE if not in middle of conversion extern "C" far pascal uint CHECKFOREOC(uint BASE); // Set only the channel for A/D card at selected base address extern "C" far pascal void SETCHANNEL(uint BASE, uint CH); // Set the gain for A/D card at selected base address extern "C" far pascal void SETGAIN(uint BASE, uint GAIN, uint MASK); // Wait for end of conversion on A/D card, zero if EOC did not occur // Base address is only parameter extern "C" far pascal uint WAITFOREOC(uint base); // Check for existence of card, nonzero if card is found at base address // This is a passive test, may not be accurate. extern "C" far pascal uint CARDEXISTS(uint base); // Check for existence of card, active test. This is a pretty accurate test. extern "C" far pascal uint TESTCARD(uint base); // Program desired counter at base address with desired mode // and load value extern "C" far pascal int PROGRAMCOUNTER(uint base, uint counter, uint mode, uint loadvalue); // Program desired counter at base address with mode, but does not load a // value into the counter extern "C" far pascal int COUNTERMODE(uint base, uint counter, uint mode); #else extern far pascal int CURCH = 0; extern far pascal int BADDR = 0; extern far pascal uint AD_NAME(void); extern far pascal uint MAXCH(void); extern far pascal uint MAXIRQ(void); extern far pascal uint VALIDIRQ(void); extern far pascal void STARTCONVERSION(uint BASE); extern far pascal uint RETRIEVEANALOGCONVERSION(uint BASE); extern far pascal uint RETRIEVEANALOGDATA(uint BASE); extern far pascal uint GETADDATA(uint BASE, uint FIRSTCH, uint LASTCH, uint SCANS, uint *BUFFER); extern far pascal uint CHECKFOREOC(uint BASE); extern far pascal void SETCHANNEL(uint BASE, uint CH); extern far pascal void SETGAIN(uint BASE, uint GAIN, uint MASK); extern far pascal uint WAITFOREOC(uint base); extern far pascal uint CARDEXISTS(uint base); extern far pascal uint TESTCARD(uint base); extern far pascal int PROGRAMCOUNTER(uint base, uint counter, uint mode, uint loadvalue); extern far pascal int COUNTERMODE(uint base, uint counter, uint mode); #endif #endif