LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Ivi_GetLogicalNamesList -- function doesn't seem to work right

Solved!
Go to solution

it only fills the first logical name in the first element of the struct even though i have plenty of allocated space for multiple entries.  (and several IVI devices)

 

anyone know why?

 

 

0 Kudos
Message 1 of 3
(3,454 Views)

Ivi_GetLogicalNamesList dynamically allocates memory for the array, and returns a pointer to the array and the number of names that the IVI Engine recognized.

 

What was the number of entries returned in the second parameter of the call to Ivi_GetLogicalNamesList?

 

How did you verify that Ivi_GetLogicalNamesList only filled in the first entry?

 

Did you try calling Ivi_GetNthLogicalName() for something other than the first entry?

 

Did you look for your IVI devices using NI Measurement and Automation Explorer?  How many devices did NI MAX see?

 

Message 2 of 3
(3,450 Views)
Solution
Accepted by topic author rjohnson

i have four IVI devices, and the number 4 is returned.   however only the first name is visible in my allocated array of structures.

 

but i discovered my error is that i'm assuming an incorrect use of the function...

 

 

(apparently) the function does not allow direct access the list of structures, even if you allocate it.   you must use the "Ivi_GetNthLogicalName" function to access each of the names, one at a time, in succession.

 

and you don't need to allocate anything, the "Get List" function dynamically allocates the structure that the "Get Nth" works from, then you have to "Dispose" of the list with another function.

 

the Help file on this function was kind of ambiguous, although now that i know how it works, it makes sense.

 

 

0 Kudos
Message 3 of 3
(3,448 Views)