简体   繁体   English

LabVIEW中的多线程

[英]Multithreading in LabVIEW

I have a dll which has following functions: "initializing", "reset", "start recording", "cancel" etc,. 我有一个具有以下功能的dll:“初始化”,“重置”,“开始录制”,“取消”等。 Rarely the function "start recording" get's stuck and doesn't come out. 很少有功能“开始录制”被卡住并且不出来。 In this case I need to activate the function "cancel" and the dll provider asked to run in separate thread to avoid this situation. 在这种情况下,我需要激活“取消”功能,并且dll提供程序要求在单独的线程中运行以避免这种情况。 I tried running two while loops in parallel but this didn't work. 我尝试并行运行两个while循环,但这没有用。 Any suggestion, references etc,. 任何建议,参考资料等。

This is a classic notifier approach. 这是一种经典的通知程序方法。 There are several options (the most basic one using an occurance): 有几种选择(使用事件的最基本选择): NotifierExample
In the init block you add your Initializing call. 在init块中,添加初始化调用。 In the Start Recording you add the 'Start Recording' DLL call, use the error out to feed into the 'Wait on Notification' function, this makes sure the time-out start at the correct moment. 在“开始记录”中添加“开始记录” DLL调用,使用错误输出输入“等待通知”功能,以确保超时在正确的时间开始。 If you detect that the measurement call is done you can use 'sent notification'. 如果您检测到测量呼叫已完成,则可以使用“已发送通知”。
If the 'Wait on Notification function times out you can use the output boolean timed out to instruct the case structure to send the 'Cancel' function. 如果“等待通知”功能超时,则可以使用输出布尔超时来指示案例结构发送“取消”功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM