연락처

텍트로닉스 담당자와 실시간 상담 6:00am-4:30pm PST에 이용 가능

전화

전화 문의

9:00am-6:00PM KST에 이용 가능

다운로드

매뉴얼, 데이터 시트, 소프트웨어 등을 다운로드할 수 있습니다.

다운로드 유형
모델 또는 키워드

피드백

Why does my C/C++ program require a Window Handle to call the OpenDriverLINX function?

질문:

Why does my C/C++ program require a Window Handle to call the OpenDriverLINX function?

답변:

Why does my C/C++ program require a Window Handle to call the OpenDriverLINX function?

DriverLINX anticipates that you will, in most cases, use Windows' messaging to coordinate program execution with the status of the board's acquisition. This is important for background tasks (IRQ or DMA mode). The window handle tells DriverLINX which window (application) should be sent these message notifications (ServiceDone, BufferFilled, DataLost, StopEvent, etc.) from the driver.


But for polled mode tasks common to the use of digital I/O boards especially, use of messages is not necessary. In that case, you could pass the handle of the desktop window to the OpenDriverLINX function. This is often the case if the application is a console (DOS box) or is LabWindows/CVI with no panel. Do this:


HWND window; // window handle
HINSTANCE hInstance; // instance handle for the driver session

window = GetDesktopWindow(); // our messages will be sent to desktop (not processed)
hInstance = OpenDriverLINX(window,"driverName");

If the driver does not successfully open with the "driverName" string provided, then the OpenDriverLINX dialog (popup) will appear.

If you have an ISA digital I/O board, the name of your driver is kmbpio

If you have a PCI digital I/O board, the name of your driver is kpcipio


A final note on the messages: if your polled mode application will not process messages to know the state of the task, you can tell DriverLINX not to send any by use of the taskFlags member:

pSR->taskFlags = NO_SERVICESTART | NO_SERVICEDONE

Polled mode tasks can send two messages: one when the service starts, and one when it is finished. This line tells DriverLINX not to send them.


이 FAQ는 다음에 적용 됩니다:

제품 시리즈 없음

제품:

FAQ ID 72051

모든 FAQ 보기 »