LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is causing error 50202

Raven,

 

The only probes I've used is in the development environment.  I am getting this error on a deployment machine; it does not have labview development software.  Please clarify your suggestion.  Are you advising probes that I can compile into my executable?  If so, how do I do that?

0 Kudos
Message 11 of 32
(2,480 Views)

I didn't realize you were using an executable on a PC without the development environment.

 

You can create a debuggable executable.  Then you use a PC with the development environment and use the Connect to a Remot Panel under the Operate menu to get to it.  But I'd be just as inclined to put some various error indicators on the different panels that you can view on the front panel, build a new executable and deploy that.

 

I did an explain error on -50202 on my PC and got this message.

 

"Error -50202 occurred at an unidentified location

Possible reason(s):

NI Platform Services:  A system call returned an error. The operation could not be completed as specified."

 

Not a lot more information, but a bit more.  The runtime system probably doesn't have the error code defined in it the way the development environment does.  So now we know we are looking at NI Platform services.  I still don't know what in your code could possibly cause this error, but being able to pinpoint it to a function or subVI with some probes or error indicators would help.  Perhaps there is something else such as a driver that needs to be installed on your deployment PC that wasn't.  But if that was the case, then I wouldn't expect it to be able to run as long as it has before causing an error.

 

That earlier KB article that Christian posted has a link to this one AMD Multi-Core/CPU Systems Can Cause Unexpected Behavior in NI Driver Software.  Did you go into that one and see anything relevelant?

 

It points to Time clock issues.  I see your Write Data to Text File uses timestamps.  If you tried a version that doesn't use timestamps, does that change anything?  I know that won't be the ultimate fix, and I might be reaching for things here, but if we can get an idea where the error is coming from, then maybe we can figure out how to truly fix it.

 

Is there a completely different type of PC you can try to run your program on to see if it does the same thing?

0 Kudos
Message 12 of 32
(2,477 Views)

Well, I have now tried a different pc since the one I was using when this post began crashed over the weekend.  The 2nd PC has already generated the NI Platform Services error.

 

I looked over the article and nothing immediately jumped out.  It refers to multcore systems, which I'm not using.  However, the timestamp in my data log is something I can remove.  I'll do that next.

0 Kudos
Message 13 of 32
(2,466 Views)

I have been working with NI tech support and have changed my code somewhat (the newest code is attached).  I did not remove the time stamp as discussed in the previous post.

 

The latest failure revealed itself as an error 6 at Format Into String and it occurred in my Write Data to Text File.vi.  I tried to open the data file and received a Windows error message "insufficient system resources exist to complete the requested service."

 

So we are trying to determine what is using the system resources, and which resource is too low.  Task Manager was running when the error occurred and the available memory had dropped from 558M when I started the program to 475M.  This drop occurred over a 12-18 hour period.

 

I would appreciate any advice on how my program may be using up system resources.

 

Thanks for all of your help so far.

 

 

0 Kudos
Message 14 of 32
(2,442 Views)

attach

Write Data to Text File.vi please

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 15 of 32
(2,428 Views)
0 Kudos
Message 16 of 32
(2,421 Views)

One thing I noticed in that subVI.  Your format string for the Format into File has a \n in it.  But your string is in normal display and not \code display which means you will be literally writing out a slash and an "n" rather than the new line character.

0 Kudos
Message 17 of 32
(2,418 Views)

I've attached a small example of the results file.  There is no literal "/n".  But there is a new line for each record.

0 Kudos
Message 18 of 32
(2,415 Views)

Using PoolMon.exe, I have found one tag that appears to increase its allocation over time.  That tag is called pal.  In an internet search for this tag, I found one link to nipalsm.exe.  Does anyone know what this file does and why it may be increasing its resource usage?

0 Kudos
Message 19 of 32
(2,408 Views)

Hi Rick,

 

Most kernel-mode memory allocations for NI-DAQmx and some other NI drivers go through the nipalk.sys driver, which uses the pool tag 'pal '. A gradual increase in allocations for this pool tag could be for a variety of causes:

  • An application that creates many DAQmx tasks and never clears them, as others have suggested. However, your application does not do this: it creates two tasks up front and uses them for a long time. (Note that it does fail to clear one of the tasks, so if you were to run Low Cost Keypad Test.vi as a subVI, it would leak memory until the top-level VI stops running.)
  • A memory leak in a DAQmx kernel driver.
  • Memory fragmentation. nipalk.sys obtains memory from the Windows pool allocator and further subdivides it, so memory fragmentation may gradually lead to chunks of memory not getting returned to the pool allocator. However, this is likely to be more subtle.

 

I noticed that your program doesn't use the DAQmx Start VI. Instead, it relies on DAQmx Read and DAQmx Write automatically starting the tasks, which causes your program to constantly start and stop the tasks every time through the loop. Calling DAQmx Start for both of your tasks outside the loop would reduce memory fragmentation and significantly improve performance. If this turns out to be a memory leak in DAQmx, starting the tasks outside the loop might help work around it. Please try this.

 

What version of NI-DAQmx are you using? It can't be terribly old, considering you're using LV 2010, but there may have been memory leaks fixed in the last year.

 

Also, you mentioned "available memory". In operating systems that have virtual memory, available memory is wasted memory, so this isn't a reliable indicator of a memory leak. Instead, I recommend periodically writing down the following statistics (or using PerfMon to record them) so that you can trend them over time:

  • System commit charge
  • Paged kernel memory
  • Nonpaged kernel memory
  • Process commit charge for your application process
  • System handles/threads (probably less important for this situation)

 

The fact that poolmon says that the number of 'pal ' allocations is increasing makes me think you should see an increase in paged kernel memory, but I'm curious whether the process commit charge is also growing over time.

 

One more thing: it would also be worth checking the system event log to see if there are any errors from NIPALK reported there.

 

Brad

 

---
Brad Keryan
NI R&D
Message 20 of 32
(2,403 Views)