07-09-2018 10:14 AM
I am working with a FLIR T530 Camera with USB. From LabWindows/CVI, I created a .NET Controller to the FLIR ATLAS SDK 6 libraries. Everything appears working except when calling the function that will discover the USB devices associated with the system. The Flir_Atlas_Live_Discovery_Discovery_Start_2(handle, time, list, error) has 4 arguments, in which "list" is of type System_Collections_Generic_List_T1. The "list" returns an address, but there is none of the expected data at that address associated with the USB data structure for each item of the C# List<T>. So the question is, how is the System_Collections_Generic type handle within the LabWindows? It is unclear how the allocation of memory is done for generic list type in the LabWindows.
Here is a simple example of the code.
From the FLIR.h:
typedef struct __System_Collections_Generic_List_T1 * System_Collections_Generic_List_T1;
From the FLIR.c
System_Collections_Generic_List_T1 list = NULL;
CDotNetHandle hError = NULL;
Flir_Atlas_Live_Discovery_Discovery InstanceHandle;
Initialize_Flir_Atlas_Live();
Flir_Atlas_Live_Discovery_Discovery__Create(&InstanceHandle, &hError);
Flir_Atlas_Live_Discovery_Discovery_Start_2(InstanceHandle, 10, &list, &hError);
return (0);
07-10-2018 10:06 AM
Hello Dan,
I found another forum post that might be helpful in this scenario; try the instructions there:
Solved: Re: use generic list in .net library
https://forums.ni.com/t5/LabWindows-CVI/use-generic-list-in-net-library/m-p/2947574#M67925
07-17-2018 09:06 AM
Thank you for the response. This definitely pointed me in the right direction of trying to figure out what was going on. These problems are not very straight forward. Best. Dan