//identifies the model type of the card being opened
long BaseAddr
//address the card is configured to use
);
Summary
The we_OpenCard function is used to open and initialize a Portal I/O card.
It returns a handle that identifies the card to the other Portal API functions.
This function checks for errors and conflicts when it opens the card.
Parameters
ModelID:
Identifies which model type of card is being opened. The API
reference page contains a list of valid IDs.
BaseAddr:
Identifies the base address that the card has been set up to use.
Return Values
If the card has been opened successfully, the function will return a new
handle for that card. Valid handles are always greater than zero. If an
error has occured, a errorr code will be returned instead of a new handle.
Error codes are less than zero. Error codes are defined in the header file
WeCrdError.h Errors that may be returned include:
WECRD_INVALID_MODEL - ModelID that you specified was unrecognized
WECRD_INVALID_ADDRESS - BaseAddr parameter is invalid. This means that
it is impossible for the card to be configured for the base address that
you specified.
WECRD_ADDRESS_CONFLICT - BaseAddr that you specified conflicts with a card
that has already been opened by we_OpenCard. This probably means that the
card was previously opened and never closed with we_CloseCard.
WECRD_CARD_NOTFOUND - (Only on some models) On some card models, it is
possible to test if the card is present or not. If the function doesn't detect
a card, this error is returned.
WECRD_GENERAL_ERROR - If any other error occurs, this error code is returned.