05-08-2007 10:43 AM
In my VI, I am trying to read data from a INI file and write the data to my array. I can successfully read in data an populate my sequncer array and channel table. Though my event table is in a nested for loop and the data isn't being inserted. I can see the 1D array of the retrieved data flowing to the insert function, but is never passed through to the table. If anyone knows what is going on, please let me know. I've included a sample INI file.
05-08-2007 11:39 AM
I can't look at your code but a couple things you can look for yourself:
For loops in LV can execute 0 times. To determine the number of iterations for a FOR loop LV looks at the value wired to the N node, and size of all arrays that are auto-indexing at the loop border and picks the smallest number as the number of iterations for the loop. So if you have a FOR loop that appears not to execute, it's probibly because you are unintentionally telling it to execute 0 times.
Mike...
05-08-2007 12:01 PM
05-08-2007 12:24 PM
05-08-2007 12:50 PM
Thanks for the input! I'll move my open and close file functions outside the loop! I'll have to research the auto indexing feature that you're talking about. The only reason I reshaped the array, was to change the 1D array from a vertical to a horizontal array so I could insert it into my table. Though if I can figure out the auto-indexing I'll get rid of it. I already know that I can't change the config file format. So I'm stuck with INI.
I did find what was wrong. I didn't initialize the array. The channel setup table was fine without being initialized but the event setup wasn't. So I just initialized the first two rows to an empty string in the INIT Case. However, now my event setup table keeps writing data to row 110. Is the max 2D array size 110x10? Or do you know what is going on?
05-08-2007 01:13 PM - edited 05-08-2007 01:13 PM
Here is an example of auto indexing and For Loops. This can be used with While Loops too. Now can you see how much simpler your block diagram could be?

Somehow the comment got cut off at the top. It says that the indexing feature extracts the elements out of the array one at a time and uses them.
Message Edited by tbob on 05-08-2007 12:15 PM
05-08-2007 01:20 PM
05-09-2007 07:47 AM
05-09-2007 08:24 AM
05-09-2007 02:32 PM