06-28-2005 06:10 AM
06-28-2005 09:28 AM
06-28-2005 11:46 AM
06-30-2005
01:26 PM
- last edited on
07-08-2025
12:27 PM
by
Content Cleaner
I tried creating a simple (maybe too simple) stripchart app with a ring control and a timer running at full speed plotting data and calling processystemevents. I tried playing around with the ring, but didnt get any crashes. So I'm not sure what might be happening. You could try using the CVI 7.1 RTE ( avaialble here ) and see if you still have the same problem.
The only way i can get the chart to update while the menu is up is if I plot from another thread (using async timers). So Im not sure how you are ending up in that state.
Have you tried using async timers instead of a UI timer?
07-01-2005 10:52 AM
I tried to produce a much simplified application as well, in an attempt to simulate the problem without any hardware connections. The first thing I did was to eliminate the external physical network connection and generate simulated data locally, on the same computer that the suspect application runs on. This way I did not need to recompile the main app just yet. The problem disappeared.
It must be related to the timing of the CVI TCP callback mechanism - presumably every once in a while the network card/Windows TCP handler sub-system generates an interrupt at just the wrong time; maybe at some crucial point during the construction of the ring menu? Then the callbacks/threads/whatever get confused and voila - my original problem.
I am reluctant to make structural changes until I know for sure what is going wrong - the program is fine for 99% of the time and I am running out of time on the project! Any suggestions and/or advice would be welcome, but I am off on holiday now so it will be a while before I can try anything else. I'll try 7.1 when I get back.
Thanks.
JR
07-07-2005
10:49 AM
- last edited on
07-08-2025
12:27 PM
by
Content Cleaner
I posted here about the behavior of ProcessSystemEvents and GetUserEvent w.r.t tracking loops. I tried adding tcp callbacks into the equation as well, but I didnt see anything happen. I had a little server/client app running.
Let me know if 7.1 changes anything for you.
07-25-2005 06:14 AM
Just got back off holiday only to find the hardware has been shipped - it will be quite a while before I can get to try 7.1 ![]()
Thanks for your efforts.
JR
07-25-2005 07:27 AM
Are you absolutely sure you need the ProcessSystemEvents() call in the timer callback? Have you tried the code without that call?
The ProcessSystemEvents() may cause a new timer event to be generated and executed whilst you are in the callback. So if you are absolutely sure you need ProcessSystemEvents(), you should code your timer callback in such a way that it is not re-entrant. One way is to use a static variable to indicate whether you are already in the callback, e.g. your timer callback could be structured as follows:
static int inTimerCallback = FALSE;
if (!inTimerCallback)
{
inTimerCallback = TRUE;
... Do stuff here...
ProcessSystemEvents();
... Do more stuff here...
inTimerCallback = FALSE;
}
return 0;
07-25-2005 11:14 AM
07-26-2005 08:31 AM