LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help terminating an array in LabWindows

Using the finction FindLstn requires an address array. How do I terminate the array. My attached c code shows two methods I tried and the same error resulted.
Download All
0 Kudos
Message 1 of 2
(2,860 Views)
In your attached source code there was a slight error, in that addr_list[31] = -1; would be outside of the array you created in the above define. The code below works.

Also, placing the FindLstn (0, addr_list, inst_list, 1);
before the loop worked fine for me too.
If you cut and paste the code below into the IM window it will run. (I don't have a GPIB controller board on this PC, but it error'd for that reason. If I made the last element not -1, then it gave me the oerror that you got.

I can only think that you did not assign the array correctly.

Hope this helps,

Chris




#include
static short addr_list[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30};
static short ins
t_list[31];

static int j;


addr_list[0] = 0;
for (j = 1; j < 31; j++)
{
addr_list[j] = j;
}
addr_list[30] = -1;

FindLstn (0, addr_list, inst_list, 1);
0 Kudos
Message 2 of 2
(2,860 Views)