Actually, everybody that has replied to your posts has correctly answered the explicit question that you asked: "How do I terminate the address list passed to the FindLstn function?" But what we didn't realize is that you were trying to execute this improperly inside of a function panel only. Even the code that you posted with this reply leads one to believe that you were receiving a library error when debugging your program's source file. But what is actually happening is that even though you have initialized the array passed to the FindLstn function in your program's source, this code is unknown to the interactive execution of the function's fp.
I have ran the following code on my system flawlessly and it should do the same on yours, notice that it is almost identical to the code in your second attachment although I changed the last parameter to FindLstn to 30 instead of 31 (the Limit parameter is the maximum number of addresses that can fit in the array in addition to the list terminator, -1).
#include
#include
static short addr_list[31];
static short inst_list[31];
int main (int argc, char *argv[])
{
int j;
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
SendIFC (0);
addr_list[0] = 0;
for (j = 1; j < 31; j++)
{
addr_list[j] = j;
}
addr_list[30] = -1;
FindLstn (0, addr_list, inst_list, 30);
return 0;
}
Now, as far as "running" the FindLstn function panel goes, as stated in the documentation of the LabWindows/CVI User Manual Chapters 5&6, any variable declarations and assignments needed to properly execute a function panel must be included correctly in the Interactive Execution Window. The reason that you were getting the specific error that you got was because the interactive execution of the FindLstn function was passed an array without -1 assigned to its last index. So, in short it would be of great benefit to read over the two chapters I mentioned above, and the manual in question can be located in your ...\cvi\manuals directory as the usermanl.pdf file.
Jason F.
Applications Engineer
National Instruments
www.ni.com/ask