From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



在LabWindows/CVI中如何处理中断?



主要软件: LabWindows/CVI Development Systems
主要软件版本: N/A
主要软件修正版本: N/A
次要软件:

问题: 我希望能够侦测到我硬件产生的中断,并在LabWindows/CVI中处理,我该怎么办?

解答: 由于LabWindows/CVI并不提供中断处理函数,LabWindows/CVI应用响应中断请求的唯一方法就是通过Windows 16-bit DLL (for Win 3.1) 或者 32-bit DLL (for Win NT/9x/2000/XP)。你需要开发一个设备驱动来处理该设备产生的中断。通过支持中断处理的编译器,比如Borland C++ 或者 Visual C++注册中断,使用 Windows API 函数PostMessage()传递消息到CVI窗体。在CVI中,是用函数RegisterWinMsgCallback() 建立一个callback 函数响应该消息。

相关链接: 很重要的一点是Windows 9x/2000/XP和NT的驱动是不一样的。这是因为操作系统的中断处理函数是不一样的。

附件:





报告日期: 12/20/1995
最近更新: 03/31/2004
文档编号: 0GJ7T7ZL