mkaravitis Posted May 17, 2008 Report Share Posted May 17, 2008 We are using a Mightex CCD line camera. Their dll and example code in VC++ has the following: ------------------------------------------------- // Structure ------------------------------------------------- typedef struct { int CameraID; int ExposureTime; int TimeStamp; int TriggerOccurred; int TriggerEventCount; int OverSaturated; int LightShieldAverageValue; } TProcessedDataProperty; ------------------------------------------------- // Function ------------------------------------------------- void _cdecl FrameCallBack( int __, int __, int __, TProcessedDataProperty* Attributes, unsigned char *FrameData ) { // Code here... ..... .... ... .. . } ------------------------------------------------- // dll function ------------------------------------------------- SDK_API CCDUSB_InstallFrameHooker( int __, FrameDataCallBack FrameCallBack ); The structure (TProcessedDataProperty) is called in the function (FrameCallBack), which in return is called as an argument in the dll function (CCDUSB_InstallFrameHooker). This dll funcion is third party vendor dll who don't have LabVIEW support, but is necessary to use this dll in order to access the CCD camera data. We have implemented the structure as a cluster in LabVIEW. But how do we implement the following in LabVIEW? (1) the FrameCallBack function that takes a pointer to structure argument (TProcessedDataProperty* Attributes), and (2) how do we pass the pointer to FrameCallBack function as an argument to the CCDUSB_InstallFrameHooker dll function? -- Thanks, Gautam. Quote Link to comment
Rolf Kalbermatter Posted May 19, 2008 Report Share Posted May 19, 2008 QUOTE (mkaravitis @ May 16 2008, 04:56 PM) We are using a Mightex CCD line camera. Their dll and example code in VC++ has the following:------------------------------------------------- // Structure ------------------------------------------------- typedef struct { int CameraID; int ExposureTime; int TimeStamp; int TriggerOccurred; int TriggerEventCount; int OverSaturated; int LightShieldAverageValue; } TProcessedDataProperty; ------------------------------------------------- // Function ------------------------------------------------- void _cdecl FrameCallBack( int __, int __, int __, TProcessedDataProperty* Attributes, unsigned char *FrameData ) { // Code here... ..... .... ... .. . } ------------------------------------------------- // dll function ------------------------------------------------- SDK_API CCDUSB_InstallFrameHooker( int __, FrameDataCallBack FrameCallBack ); The structure (TProcessedDataProperty) is called in the function (FrameCallBack), which in return is called as an argument in the dll function (CCDUSB_InstallFrameHooker). This dll funcion is third party vendor dll who don't have LabVIEW support, but is necessary to use this dll in order to access the CCD camera data. We have implemented the structure as a cluster in LabVIEW. But how do we implement the following in LabVIEW? (1) the FrameCallBack function that takes a pointer to structure argument (TProcessedDataProperty* Attributes), and (2) how do we pass the pointer to FrameCallBack function as an argument to the CCDUSB_InstallFrameHooker dll function? -- Thanks, Gautam. Callback functionality is not supported byt the Call Library Node. The most simple solution is to write a wrapper DLL in C that provides that callback function translating the callback event into a LabVIEW occurrence or LabVIEw user event and a LabVIEW callable function to install that callback function. All in all not something you are likely to solve without some good C programming knowledge. Rolf Kalbermatter Quote Link to comment
jcryan Posted June 6, 2008 Report Share Posted June 6, 2008 QUOTE (rolfk @ May 18 2008, 01:55 AM) Callback functionality is not supported byt the Call Library Node. The most simple solution is to write a wrapper DLL in C that provides that callback function translating the callback event into a LabVIEW occurrence or LabVIEw user event and a LabVIEW callable function to install that callback function.All in all not something you are likely to solve without some good C programming knowledge. Rolf Kalbermatter Did you proceed with the .dll wrapper solution. I have just run into the same problem, and was wondering if you had given any thought to the .dll. If so could you let me know any tips for building the .dll. Quote Link to comment
Rolf Kalbermatter Posted June 7, 2008 Report Share Posted June 7, 2008 QUOTE (jcryan @ Jun 5 2008, 02:08 PM) Did you proceed with the .dll wrapper solution. I have just run into the same problem, and was wondering if you had given any thought to the .dll. If so could you let me know any tips for building the .dll. I don't have such a camera and couldn't do it. Maybe the original poster did something but my experience with this is that most do not bother with the complicacies this causes. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.