06-30-2005 01:31 PM
06-30-2005 01:51 PM
06-30-2005 02:13 PM
07-01-2005 09:27 AM
@abriggs8 wrote:
Well I am trying to control a camera that is connected to the computer. It comes with software but we need LabVIEW (controlling other measurements) to control the camera itself. The camera software came with an SDK and requires a class structure (CCameraControl) class to do this. I attempted to use the Call library function node however the way the camera works is you create a class of this type, connect, and initialize it, then you set up the parameters you need to change from defaults (for example shutter speed, frame rate, etc.) and then you begin recording and save the images. However, all of this requires that you keep the control object you've created, it is what controls the camera. From what I understand, LabVIEW does not support class structure thus I could not call individual functions from the camera's DLL files to control the camera (tried to use clusters but it got messy, the Camera control class has 600 parameters). The code is actually quite simple with the SDK, but after failing with the DLL I decided to attempt to use a CIN. Perhaps I am looking at the problem in the wrong way, but I'd like to see if I could get it working with the CIN. By the way, this is actually the first project I've worked either with Visual C++ or LabVIEW, so while I've been studying vigorously on it I still do not know much. Thank you for you help and very fast response.
/* Declare the functions in a header file to be standard C so that C++ does not decorate them */
#if __cplusplus
extern { "C"
#endif
int MyObject_Create(MyObject ** object);
int MyObject_DoSomething1(MyObject *object, int param1, int param2);
int MyObject_DoSomethingElse(MyObject *object, int param1, int param2);
int MyObject_Destroy(MyObject * object);
#if __cplusplus
}
#endif
#include <.....>
#include "myobject.h"
#include "myobject1.h" /* Above declarations */
int MyObject_Create(MyObject ** object)
{
*object = new MyObject;
if (!*object)
return memFullError;
return noError;
}
int MyObject_DoSomething1(MyObject *object, int param1, int param2)
{
if (!*object)
return ArgumentError;
return object->DoSomething1(param1, param2);
}
int MyObject_DoSomethingElse(MyObject *object, int param1, int param2)
{
if (!*object)
return ArgumentError;
return object->DoSomethingElse(param1, param2);
}
int MyObject_Destroy(MyObject * object)
{
if (!*object)
return ArgumentError;
delete object;
return noError;
}