05-28-2008 05:06 PM
05-28-2008 06:40 PM
05-29-2008 05:54 PM
Hi San Jose,
I sent you an email regarding this as well, but I thought I'd post here in case other people had a similar question.
Pretty much the same thing as Mert said,
From what you describe, it really sounds like all that's happening is the UI doesn't respond because the XModem function calls are blocking calls, ie they run synchronously, and don't get to the next line of code until it finishes execution.
Using a ProcessSystemEvents would work except for the fact that you don't actually get to the ProcessSystemEvents function call because the code is waiting for the XModem call to finish execution.
What you would probably want to do in this situation is run the XModem functions in a separate thread. That way, your UI and XModem code run 'simultaneously' on separate threads.
Spawning off separate threads is made fairly easy in CVI through the Multithreading class in the Utility Library. There are also several examples available in the CVI Example Finder. To get to these:
Click Help»Find Examples...»Optimizing Applications»Multithreading.
Here are a couple of good resources as well:
Developer Zone Tutorial: Multithreading in LabWindows/CVI
http://zone.ni.com/devzone/cda/tut/p/id/3663
Developer Zone Tutorial: Building Multithreading Applications with LabWindows/CVI
http://zone.ni.com/devzone/cda/tut/p/id/3066
Developer Zone Tutorial: Easy Multithreading Programming in LabWindows/CVI
http://zone.ni.com/devzone/cda/tut/p/id/5153
Hope this helps!
05-29-2008 06:49 PM
Hello Jervin,
So... how about someone at NI update the Xmodem functions so that after every few packets the function would yield to system processes (i.e. include the ProcessSystemEvents call in the Xmodem function) .... this would make a lot more sense to me as to spawn threads is just treating the symptom of the problem and not the root... we buy CVI because it is supposed to make things easier for us and our clients, not harder and more complex ...
I do appreciate your answer, but it seems that every time I have a problem with CVI, it boils back to some very obvious issue within the CVI library that no one at NI wants to actually go back and fix (the root cause) as opposed to me and my team having to do more work on our end ..... we've already paid for what is supposed to be a developer suite and support for the same... and not to diminish your quick response or your knowledge of CVI (which is highly appreciated), but we only seem to get recommendations that say we (our company in San Jose) need to do more work to resolve the issue and never that NI will resolve the issue and hand us a corrected library function.....
In fact, if you actually handed me the source code for the functions, I could resolve the issue in about 10 minutes... not in days and trials of threaded functions we have never implemented...
So, I guess I'll just let my support subscriptions lapse.... and rather than me having to spend hours and hours learning how to do something I don't want to do (i.e. threading with CVI) I'll just go out and buy a third party DLL that actually works and that comes with simple, well documented, and easy to understand instructions... Of course this does not make me happy at all, but it's sure more cost effective than having to re-train myself and my engineers every time we find a problem in CVI.... (hint... I've used LabView and CVI since inception, I make very, very (and I mean really) complex software solutions, and never once have I ever needed to do multi-threading... there is something to be said for simplicity and well planned code ....
BTW... I already looked at the multi-threading examples you suggested ... and as I mentioned I'm not a "new-bee" to programming (I hold six different engineering degrees - one of which is in computer science and I've 20+ years of solid engineering experience), however, the NI examples are seldom clear, seldom concise, marginally documented, and they do not convey any amount of simplicity as far as I can tell ......
In short, I, a well trained and well informed user of CVI for many years, spent about 2 hours looking at the threaded examples last night and I still have no idea how to implement it for my intended use.... (although I have to say the example with the number guessing game sure looks pretty neat)...
Where do we go from here? I am sorry to make a one-man-rant.... I'm just continually frustrated by these issues and really hate to hear that I have to do more work for an obvious problem with a CVI library....
Many Regards in frustration 😉
05-29-2008 07:41 PM - edited 05-29-2008 07:43 PM
05-29-2008 07:54 PM
05-29-2008 09:42 PM - edited 05-29-2008 09:47 PM
Please ignore this post, my son (a budding 3 year old Engineer) was playing with my keyboard !
Message Edited by San Jose Test Engineering on 05-29-2008 09:45 PM
05-29-2008 09:42 PM - edited 05-29-2008 09:47 PM
Please ignore this post, my son (a budding 3 year old Engineer) was playing with my keyboard !
05-29-2008 09:42 PM - edited 05-29-2008 09:48 PM
Please ignore this post, my son (a budding 3 year old Engineer) was playing with my keyboard !
05-29-2008 09:42 PM - edited 05-29-2008 09:45 PM
Need to make a correction in one of my above posts ---
BTW... I already looked at the multi-threading examples you suggested ...
Actually, I did not at the time of the original post... .... I had actually looked at the examples that came with the CVi developer and those examples were not easy to follow ...
However, I found one of the links very useful ...... http://zone.ni.com/devzone/cda/tut/p/id/3663#toc2
The other links, not so much 😉
...Cheers...