LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help! PDA un-defined error 120168006 and 134429006. Bad input argument to function.

Hi JLS,

I have uploaded my code there, named "Code from Kris.rar", I also attached the compiled program.

The following is some information that I sent NI Australia:

"

What this program does is to acquire some bit of
sound by using the onboard microphone of the PDA and work out the
fundamental frequency of the soundwave. So after compiling, you need to
enter a value under density (make it 600), length (make it 3.5), and then
make some noise around the microphone. (You can use a pencil, simply hit
around the mic hole or table, the program will then tell you a fundamental
frequency and MoE after a few seconds.

The crash happens when you do a few tests, especially when the frequency is
very high. You need to do a few tests until the program crashes. That's why
it's confusing me, it's not crashing all the time but sometimes.

I'm afraid you can't use emulator as the emulator doesn't have a microphone.
I have changed the code a bit, hope it will help you understand it. Also I
have attached the compiled program, and the yellow key it mean is key 239.

"

Regards,

Kris

0 Kudos
Message 11 of 26
(2,795 Views)
Hello,
 
I took a look at your code and read the new information you provided in the thread.  I don't see a reason for the crash explicitly, but in general there is a more elegant way to handle the clicking of your button.  I won't post a modified version of your code here since you don't want others to see it, but I recommend using an event structure to handle the clicking of your buttons.  This allows you to remove the sequence structure, the local variable used in the last frame, and also the case structure, so that you'll only have an event structure in your loop.  This may just clean up the code enough to avoid the crash, although precisely why the crash is occuring would remain a mystery.  I would like to reproduce this, but I could not actually try your code here because a subVI was missing named "Convert to Waveform.vi."  I will send you the modified version with only the event structure if you post your email address.
 
Hopefully this will help!
 
Best Regards,
 
JLS
 
Best,
JLS
Sixclear
0 Kudos
Message 12 of 26
(2,786 Views)
Hi JLS,
 
The code I uploaded was actually a very simplied version. My one is much more complicated than that. And I had used event control on all my buttons. (Looks I'm getting better in Labview : )   )
 
Sorry that I forgot the   Convert to Waveform.vi , I have attached below.
 
Please pay attention to the vi under Calculate Stiffness from Waveform (Handheld).vi --> Calculate Stiffness.vi --> Find f0 from ft peaks v4.vi, that's where I ended up the problem was in. But it was out of my ability to find out what's wrong as the Calculate Stiffness from Waveform (Handheld).vi  was written by an acoustic scientist. So you can do whatever change you want outside that vi as long as you give it some data from the microphone.
 
P.S.  Did you try compiled program on any PDA?
 
Was great that you receive the code, and thank you for your reply.
 
Kris
0 Kudos
Message 13 of 26
(2,784 Views)
Hello,
 
I can reproduce the problem (always error 120168006 for me) with the attached EXTREMELY simplified VI.  This appears to be a bug - I cannot explain the behavior.  The error is also evident with this VI when targeting the emulator.  Your code uses this tiny snippet which is causing the error - as you'll see, posting this code reveals absolutely nothing about your code - it's literally just the array sort and reverse array VIs.  Now for the VERY INTERESTING part - the error will NOT occur if I remove the indicator (literally the only front panel item in the code).  I have filed a corrective action request on this matter so that R&D can address it formally.  Unfortunately, simply removing the indicator in your code (leaving everything else untouched) doesn't solve the problem.  I noticed that in the code you noted was developed by another engineer, there are unnecessary instances of local variables, as well as sequence structures.  Perhaps you can have your engineer refactor his code to be cleaner and if possible be a minimal code implementation.  I spent a lot of time and did quite a bit of playing around with the code, reducing it to find out where the error was, and got it all the way down to the small attached code.  Why your larger application continues to fail after deleting the corresponding indicator I am not sure.  I have a feeling that if you or the other engineer can reduce the code in Find f0 from ft peaks v4.vi to something cleaner (but functionally the same) the error might go away.  It will probably R&D who can eventually tell us why it's occuring with the smaller VI attached, and will likely be the same reason it's occuring in your larger application.
 
We're on the right track - sorry we don't have a workaround quite yet.
 
Best Regards,
 
JLS

Message Edited by JLS on 06-30-2006 07:58 PM

Message Edited by JLS on 06-30-2006 08:00 PM

Best,
JLS
Sixclear
Message 14 of 26
(2,776 Views)

Hi JLS,

That was great to hear from you, I appreciate for your help.

I downloaded the code you attached and found the error only occurs when the array constant is empty. And when I removed the indicator, the app crashed at 121667006. Then I had a look at my original code and tried to replace the sort and reverse array VIs; as the program attempts to find the max value from a 2D cluster, I simply replace them with "Array Max & Min VI", and the error seems disappeared! SO either sort or reverse array VI has bugs when they are targeted on PDA, running fine on desktop.

I will keep an eye on that do a few more tests. Thanks a million for your help again.

Best regards,

Kris Zhu

0 Kudos
Message 15 of 26
(2,749 Views)

Hello,

Wow, that's very interesting!  I also tried it without an empty array and it didn't change the outcome on the PDA here or in the emulator.  Do you see this behavior with your emulator as well?  I hope we can see consistent behavior with our emulators - if there are small differences in error messages on different PDAs in this case I wouldn't be totally surprised - I have yet to see error 121667006.  In any event, we do seem to have correlated this with the sort and reverse array functions (although if I remove one of them the error disappears), in a variety of ways.  The seemingly sporadic behavior across our different PDAs could be due to memory mismanagment, which may cause slightly different problems on different devices, although this is purely speculation at this point.

With that said, I am very glad to hear that another function can serve the purpose without the error!  As a workaround which I didn't mention in the previous post (it didn't hit me at the time), if necessary, we can implement those functions (sorting and reversing arrays) in LabVIEW as subVIs (and not use the primitives).  So if you need that functionality specifically, we should be able to program it pretty easily.  On the other hand, if you were really only looking for the max of an array, the min/max function is slicker.

Definitely repost with whatever else you find - it sounds like we'll definitely get you to a working, stable solution with a little more effort.  On the other hand, it'll be very interesting to learn what's really going on so we know what our efforts were really over 😉

Best Regards,

JLS

Best,
JLS
Sixclear
0 Kudos
Message 16 of 26
(2,699 Views)
Hi JLS,
 
When I ran my program on the emulator, it told me the program is not a valid pocket PC application. Actually I don't believe simulation programs, so can't tell u anything about the behavior in emulator.
 
Thanks you for offering me subVIs to replace the troublemakers, but I think I will be alright. What I'm interested is what you have found out with the sort and reverse vis when they are targeted on PDAs. Why did it happen?
 
The management is now happy with the result anyway, but as a programmer, I will be curious to know what's really happening. Would you let me know?
 
Thanks.
 
Kris
0 Kudos
Message 17 of 26
(2,692 Views)

Hello,

I would love to tell you what's going on with those functions, but I don't know quite yet.  I filed the corrective action request to R&D, and I know it has been assigned for review and exploration, but there hasn't been any relevant technical information posted in the investigation section yet.  It is possible that they have later development builds of PDA which don't show the problem, and as a result may not fully explore what was wrong, since it would then be technically "fixed in the next version."  Unfortunately, I don't have much influence on that process, but I have specifically requested that the problem be explored in detail to determine the cause, particularly because we are seeing slightly different, although similarly erroneous behavior.  This leads me to believe that the problem could be rooted in how memory is handled, and the fact that it doesn't occur on a given system at a given time could only be luck.

If and when I learn more (and I do receive all updates on all such actions I file), I will post more information here if I am authorized to do so!

Thank you, and I am very glad to hear that we could work around the problem at least for your current application!

Best Regards,

JLS

Best,
JLS
Sixclear
0 Kudos
Message 18 of 26
(2,676 Views)

Hi Folks:

I wish I found this thread 2 weeks ago because I've been pulling my hair out on this one problem.  Instead of starting a new thread, I believe this problem is somewhat related.

I'm using LV Pocket PC 8.01f1 with the PDA Controls memory leak fix patch and low and behold, one of my subVIs uses the sort array and reverse array primitive in sucession.  I am downloading my app to a Windows Mobile 5.0 phone and when I try to use both those primitives, I don't get an error but my program just hangs.

I am using 2 parallel loops with the upper loop using an event structure to perform actions such as load, exit etc.  The bottom while loop has the this attached subVI which uses these primitives.  This subVI parses messages and sorts them accordingly.  I initialze an array of clusters, replace an element in the array then perform the sort.  My element in the array is a cluster with the first cluster element as a string type in which I use as a timestamp.  Lets say, the first message with a timestamp (string type) is already sorted in the array.  If the second incoming message is older than the first message, the subVI crashes.

The attached VI is used as a subVI in my main program and my program hang.  Since this is not in the event loop, my program just hangs until I press the exit button in my main program.  (I have to press the exit button a number of times though).  Whats baffling is this subVI, if run standalone crashes my Window Mobile 5.0 device.

The attached VI is used as a subVI in my main app (with some front panel modifications).  In order to see what I'm doing, first select 15:20 timestamp and press GO.  One element is put into my array.  Now select 15:35 timestamp and press GO.  My array of clusters is sorted correctly (press the digital display to view the elements).

Now exit the VI and do the reverse.  Select 15:35 timestamp, press GO.  Then select 15:20 time stamp and press GO.  CRASH, CRACKLE, POP!!!

I placed a Sort option however, it seems to not matter.  I will look into this option a bit further.

Can anybody else confirm?!!!!

 

Thank you

Robert

 

0 Kudos
Message 19 of 26
(2,505 Views)
Hi, finally I find somebody is encountering my problem after such a long time.
 
rberger  has reminded me that in my program I did have an array of clusters with a time stamp at the beginning of every cluster. Don't know if JLS found out that or not. Have you got any response from NI yet, JLS?
 
And my program did hang up many times before I talked to JLS, but PDA didn't crash (just been responding very slowly), I had to terminate the program from program list.
 
Sorry rberger but I can't help you as I was using LV8 evaluation with a limited local license, and now it's expired! What kind of programmer am I !!! Hope JLS will see your post and give you a hand. Good Luck!!!
 
Regards,
 
 

Message Edited by Kris_worm on 08-29-2006 10:42 PM

0 Kudos
Message 20 of 26
(2,502 Views)