Justin Goeres Posted June 22, 2007 Report Share Posted June 22, 2007 I am developing an application (on Windows) that communicates with an industrial I/O network. The driver for the interface to this network allows me to poll the network for new messages, but I can also create an event (using the Windows API CreateEvent function) and register to have that event signalled when new data is available. This thread at the NI forums led me to use the WaitForSingleObject function to wait for the event to be set. Everything seemed to be on the way to success, until I ran some test code. It turns out that WaitForSingleObject blocks the entire LabVIEW process (menus/mouseclicks/rest of block diagram/etc.). I can't even, for instance, start one top-level VI running, then start another top-level one that calls WaitForSingleObject, because the WaitForSingleObject blocks everything! Switching the top-level VIs to different execution systems didn't alleviate the problem, either. Since the entire point of using these events is to enable parallel execution (which LabVIEW is normally pretty good at ), I'm kind of exasperated. Basically, I just need the WaitForSingleObject to not block the rest of my code. Does anyone here have any advice/experience with this? I can think of some rather complicated things to try (involving the application builder), but wanted to ask here before (or while) I go plunging wildly ahead with those. Quote Link to comment
PJM_labview Posted June 22, 2007 Report Share Posted June 22, 2007 Justin, Is your call to WaitForSinglObject reentrant? http://forums.lavag.org/index.php?act=attach&type=post&id=6179 PJM Quote Link to comment
Justin Goeres Posted June 22, 2007 Author Report Share Posted June 22, 2007 QUOTE(PJM_labview @ Jun 21 2007, 06:50 AM) Is your call to http://msdn2.microsoft.com/en-us/library/ms687032.aspx' target="_blank">WaitForSingleObject reentrant? It is now! That fixed it. Thanks! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.