Canopendriver(), Canclosedriver(), Canopendriver() canclosedriver() – ADLINK PCI-7841/cPCI-7841 User Manual
Page 29
![background image](/manuals/733498/29/background.png)
Function Reference
21
Remarks
Call this function to retrieve the version of
current using driver. This function is for your
program to get the version of library and
dynamic-linked library.
See Also
none
Usage
C/C++
#include “pci7841.h”
WORD version = GetDriverVersion();
majorVersion = version >> 8;
minorVersion = version & 0x00FF;
CanOpenDriver()
Purpose
Open a specific port, and initialize driver.
Prototype
C/C++
int CanOpenDriver(int card, int port))
Parameters
card:
index of card
port:
index of port
Return Value
Return a handle for open port
-1 if error occurs
Remarks
Call this function to open a port
Under DOS operation system, you will
receive –1 if there is not enough memory. If
writing program for the Windows system. It
will return -1, if you want to open a port had
been opened. And you must use Can-
CloseDriver() to close the port after using.
See Also
CanCloseDriver()
Usage
C/C++
#include “pci7841.h”
int handle = CanOpenDriver();
CanSendMsg(handle, &msg);
CanCloseDriver(handle);
CanCloseDriver()
Purpose
Close an opened port, and release driver.
Prototype
C/C++
int CanCloseDriver(int handle)