LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How i will get the data structure of any DLL?

Hiiiiiiii
I am using Mightex USB Camera and Want to set the properties of camera through lab view.
Actually I am using this DLL in lab View Thats why I want the data structure of these DLL.
1) MT_USBCamera_SDK.dll
2) MtUsbLib.dll
 
It contains some function like
MTUSB_InitDevice
MTUSB_OpenDevice
MTUSB_StartCameraEngine
........
................
MTUSB_StopCameraEngine
MTUSB_UnInitDevice
 
But it gives error at "MTUSB_StartCameraEngine". Actually it wants "Hwnd parent Handle" And "DEV_HANDLE DevHandle"
But I don't Know it Find. So plz Help me.....
Thank You
 
0 Kudos
Message 1 of 12
(4,989 Views)
Find the programming API description or the header file for the specified DLL.
Regards,
André (CLA, CLED)
Message 2 of 12
(4,972 Views)
You shougo the manufacturer's web site and check out their download section. I noticed that several of the cameras have available a zip package which contains and SDK. This SDK contains documentation as well as programming examples.
Message 3 of 12
(4,950 Views)

Hello,

 

I'm also trying to have a mightex usb camera working in labview 8.2 by using the "CCD_USBCamera_SDK.dll" downloaded from the mightex site.

until now i do not get it working.

some of the calls are working like :

SDK_API CCDUSB_InitDevice( void );
SDK_API CCDUSB_UnInitDevice( void );
SDK_API CCDUSB_GetModuleNoSerialNo( int DeviceID, char *ModuleNo, char *SerialNo);
SDK_API CCDUSB_AddDeviceToWorkingSet( int DeviceID );

but getting the ccd-camera dat out seems imposible t me:

 SDK_API CCDUSB_InstallFrameHooker( int FrameType, FrameDataCallBack FrameHooker );

The callback seems to be the problem here.

I have heard callbacks are not possible in labview!

 

Did you solve this problem already, or can you give me advice?

 

greetings T-spark 

 

 

 

0 Kudos
Message 4 of 12
(4,822 Views)
Yes, LabVIEW cannot handle callbacks. The best way to get around this is to create a wrapper DLL that will handle the callback. Please take a look at the following links for further reference.

http://forums.ni.com/ni/board/message?board.id=170&message.id=237441&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=256635&requireLogin=False
Eli S.
National Instruments
Applications Engineer
Message 5 of 12
(4,792 Views)

OK, so callbacks do'not work in labview.

 

The manufactyerer of the ccd camera now came up with a new dll, with the procedure I need as a normal call.

 

I tried it but i do not seem to be able to implement it in labview either, because the return parameter of the funtion is a pointer to the data-aray.

 

In labview (8.2) it seems not posible to handle pointers for the terurn parameter (they are alowed in the arguments only)

In labview the only types that are alowed for the return are: String, void and numeric, but not Array.

 

Im i doing something wrong? The manufacterer says other users use this dll in laview.

 

This is the function:

 

 

SDK_POINTER_API CCDUSB_GetCurrentFrame( int Device);

User may call this function to get the one frame, this is the latest frame while host invokes this API..

Argument : DeviceID – The device number, which identifies the camera’s frame is being grabbed.

Return: 0 (NULL): If the function fails (e.g. invalid device number, or camera engine is not started )

Or a frame is not grabbed with pre-defined timeout. (3 seconds)

A valid pointer to an internal array if the call succeeds.

Important: User might use this API to get a frame of the specified device, this is an easy way to grab frame data, however, when user uses this API, it’s not guarantee each frame can be captured, the returned frame data is the latest frame at the moment the API is invoked. The returned point points to a "unsigned short" (we call it "word") array, the array has two parts as following:

FrameDataProperty: It occupies the first 8 words which contains the 7 fields in TprocessedDataProperty and one more reserved word (always ZERO).

FrameRawData: After the 8 words, the following words are raw data of the frame, note that for TCX-1304-X, it has 3648 words, while for TCX-1209-X, it has 2048 words only.

 

 can someone help me?

 

T-spark

 

 

Message 6 of 12
(4,756 Views)
A pointer is just an integer value, so you could use "integer" as the return value. However, that's not going to do you any good because you won't be able to access the array from LabVIEW. You will need to write a wrapper DLL for the manufacturer's DLL. The wrapper DLL would have the array as an argument so that you can return it to LabVIEW in that manner. This does bring up a separate issue and is in terms of memory allocation. If the function returns a pointer to an array then it presumably allocates the memory for that array within the function. How is the memory released?
0 Kudos
Message 7 of 12
(4,739 Views)

Good to know Mightex has new function now.

 

However, this function only good for capturing single picture.  For multiple pictures, or continue capture/movie, callback is more efficient.

Besides, a wrapper is needed anyway.

 

George Zou

http://www.geocities.com/gzou999/

George Zou
0 Kudos
Message 8 of 12
(4,726 Views)

Thanks for the advice.

I tried out the new dLL from mightex and it it working now.

I do not need however a wrapper dll to reach the data.

The return from the function (GetCurrentFrame) is a only a pointer to the data, but is is possible within labview to get to the data aswell.

For this you need to use the "moveblock" function from a labview dll. (just fill in library name or path: LabVIEW, its case sensitive)

With just the pointer address you can retreive the data  now.  

 

happy T-spark

0 Kudos
Message 9 of 12
(4,696 Views)

 

I also using the same function, "GetCurrentFrame(int FrameType, int deviceID)". 

But, I cannot get a pointer, though the data type is "integer".  

The other SDK functions look working.

 

Do you have any idea to fix this problem? 

 

My system is shown below.

 

LabView8.6

Mightex BCE-C030-U

 

Lyuu
0 Kudos
Message 10 of 12
(4,643 Views)