12-17-2009 04:52 AM
Hi all,
I created a .Net dll in which a function takes in a string input and does nothing(Its name is DoNothing).
This dll has been invoked in my Labview 2009. The Application works in the following manner.
"The length of the string that is inputted to the dll gets increased by one for each iteration in the loop. This loop goes on forever as long as the user wishes"
The application throws an error which is attached when the length of the string which is passed to dll is 69556. When it is allowed to run further the same error occurs at 73652,77748 etc. That is exactly at an interval of 4096. I am not very sure about whether it follows a regular pattern but the error occurred is always frequent after the first error.
When we tried the same running in Labview 8.2.1, it throws an invoke node error(a .Net Exception). The labview 2009 error was atleast specific and detail.
When we did some more research on it, we found that it has nothing to do with any operation in the dll. When the length of string passed attains a limit as specified above the error gets thrown automatically. And also the outputted string from the dll can be of any length. It does not get affected by it so.Also the dll gets executed with out any discomfort when the error occurs.
Why does labview behaves in such a way on those scenarios ? Please answer it.We really need to solve this problem to proceed further development.
Please download the attachment and unzip it and run the vi.
Thanks,
Kandy.
12-17-2009 05:06 AM
12-17-2009 05:33 AM
Hi Guru,
Please find the attached 8.2 version vi.
Thanks,
Vaira Muthu & Kandy.
------------------------------------
12-17-2009 09:46 AM - edited 12-17-2009 09:48 AM
12-20-2009 10:33 PM
Hi smercurio,
The values that I specified seems to be changing to one my colleagues PC. Infact at 69564 it caused him an error. That is why we sent the vi starting from the first value. I think the number of times that we call a particular function could also be one criterion for the error to occur.
Did n't you encounter the error when running the vi that we sent? Please acknowledge for us to better understand it.
Thanks
Kandy
12-21-2009 10:48 AM
04-23-2010 02:19 AM
I know it's quite a while since this problem occurred and I'm not sure if you fixed it already. I got the same problem in a similar application. My error occurred not all the time and not really reproducible.
With your VI I could finally reproduce and invoke the error and try to fix it. During my own investigations I found the following information on the MSDN site:
Although it is not required that such source strings be terminated with a null character (as in native C/C++), the address is tested for startIndex+length+1 bytes to allow for a null terminator (http://support.microsoft.com/kb/971990) So why not terminate it with an empty string? I did this and it worked (see screenshot) The strings are the same but terminated with an empty string. So I stopped your StringPlay.vi at about 90000 characters without any error...
If you already switched to .NET Version 4.0 this error should be fixed (it's only a few weeks old, but who knows ;-))
br,
Christian