03-06-2008 04:30 PM
03-10-2008 07:55 AM
Hi John,
I am using TestStand 3.5 (3.5.0.725), LabVIEW 8.0 and the Office Toolkit for Office 2003.
I believe now that the Run-TIme error is not caused by the Excel - Set Cell Color step. That just where the program stops and generates the error.
I made a version of the program that skips over the steps where it reads data from the UUT and it did not work like the program that reads data from the UUT.
The error seems to be generated after it executes this step, Locals.Active_Faults_Before= Locals.Active_Faults_Now
This is where I move the current active faults read from the UUT into an array that stores them for comparison to the next set of active fault read from the UUT.
The code is attached to message 12 if you would like to look at it.
B.W.
03-11-2008 12:17 PM
Hi John,
I ran a version of the code that does not get any data from the UUT last night, and it did not generate the Run-Time error.
I am thinking when the program tries to read the fault codes from the ECM, it may get some bad data sometimes and maybe this is what is causing the error.
It does not seem to be triggered until the step when the array that has the current fault data is copied into another array for comparison later to new data read into the current fault data array.
The error also does not happpen on this step, it happens in a later step, one that calls code from another support sequence (ex. Excel support sequence).
I am trying some things today, like changing the arrays to have upper and lower bounds of 0 during the operation of the program.
I was watching the program run one time when the Run-Time error occurred and 2 of the arrays had bounds of 0 (See the picture in message 19).
Any suggestions based on what you have seen so far.
B.W.
03-13-2008 09:50 AM
Will,
Unfortunately I cannot run the code completely since I don't have all the subsequences and VIs but from your information and from some work with the code it seems like everything is conceptually sound but as you mention something goes wrong during the execution. Since it works without the UUT information we might want to try running checks on the information we get back form it to prevent bad fault reports. A simple test might be to put known data (simple strings/doubles) into the fault codes at the expected steps and run the program with that data to see if the problem occurs. This should prove whether its the data or the arrays that are causing this problem. I will continue to look into this on my end and let you know if I come up with anything more concrete.
03-13-2008 02:07 PM
Hi John,
Yesterday, I ran a version of the program that does not get data from the UUT with some added arrays that simulate reading fault codes from the UUT and the program ran fine. No Run-Time error was generated.
I am now adding code to try and catch the problem with reading the faults in the original program. If I find a problem with the Active_Faults_Now array, I will not copy it into the Active_Faults_Before array.
This will hopefully keep the Run-Time error from occurring. I'll let you know if it works.
Thanks for the advice.
Will
03-18-2008 12:56 PM
03-24-2008 03:49 PM
03-25-2008 03:26 PM
06-25-2008 10:10 AM
Hello All,
After months of testing to find the cause of the Array index out of bounds error, we found the cause to be the use of the For Each loop!
The For Each loop went to access an element in the array that did not exist and caused the Run-Time error. The error did not occur on that step in the sequence, it would occur on some other step in the sequence. In the original version of the program it would always crash on the Excel -Set Cell Color step, which originally was thought as the cause of the error.
Later it was thought that the Get Active Fault Code step, created within my company, was the cause. The For Each loop that compared the previous fault codes to the current fault codes was found to be the cause. The For Each loops were changed to For loops, and the sequence now runs without generating a Run-Time error.
Beware of the For Each loop! (see attachment)
Big_Will
06-26-2008 09:38 AM - edited 06-26-2008 09:40 AM
Big_Will,
Good to finally know what the source of the problem was! To think we pegged the For Each loop as the problem, and then went back on that idea. Oops!
I am glad to hear that everything is cleared up and now we have a record of this on the forums for future reference. Thanks Will.