08-24-2009 04:09 PM
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?
Solved! Go to Solution.
08-24-2009 04:36 PM
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?
08-24-2009 04:42 PM
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.