08-14-2009 12:20 PM
Hi,
I have a photon focus camera which comes with a pfremote software for changing the camera attributes. I want to change the camera attributes like ROI, gain, resolution from my CVI program. Is it possible to link these features in my program instead of using the pfremote everytime.
Regards,
Farhan.
08-17-2009 10:16 PM
Hello Farhan,
You can definitely read and write attributes of the camera you are using programmatically. The functions to be used will depend on the driver and interface you are using. When using the NI-IMAQ driver, you can execute functions such as imgGetAttribute and imgSetAttribute2. When using the NI-IMAQdx driver, you can use the IMAQdxGetAttribute and IMAQdxSetAttribute functions for this purpose. You can find details for these functions at Start >> All Programs >> National Instruments >> Vision >> Documentation and then wiithin the NI-IMAQ and NI-IMAQdx folders.
If you are using any of our drivers to interface with the camera, we recommend uninstalling the third-party software trying to access it (the pfremote software in this case) to prevent driver conflicts. I hope this helps.
09-24-2009 04:35 PM
I am currently using the IMAQ drivers as IMAQdx does not work with this camera and the card. My problem is that I want to include the camera attributes to my program so that I do not have to use the pfremote to change the camera attributes. If I can load the pfremote onto my UIR as a seperate tab that would be great or my second option is to set those attributes using my own code. I do not have any idea to do the first one. I tried using the second approach but it does not allow me to change a lot of the features that I want to change like bit depth and gain etc for this camera. I am using a Photon Focus MV-D1024E-160-CL-12 camera with a Pcie 1429 card. I have the latest IMAQ drivers and softwares. I would really apreciate if anyone can help me in anyway either for my first approach or the second one.
Regards,
Farhan.
09-25-2009 10:36 AM
To communicate with Photon Focus cameras, we used the library “camdll.dll” supplied by Photon Focus. In order to interact with it from LabVIEW, we created a wrapper DLL, since “camdll.dll” is not directly callable from LabVIEW. Below is an example of how to set the exposure time. The image displays how to call the wrapper DLL from LabVIEW, and the code is the source inside the wrapper DLL, see attachment and below.
long __stdcall SetExposureTime (float* exposureTime_ms, float* frameTime_ms, CStr errorString){ CAMERA cam; int error = 0; CStr tempString; cam = gblCamSession; if (error == 0) { error = pfSetExposureTime (cam, (*exposureTime_ms * 0.001)); delay_ms (50); *exposureTime_ms = 1000.0 * pfReadExposureTime (cam); delay_ms (50); *frameTime_ms = 1000.0 * pfReadFrameTime (cam); } tempString = pfGetErrorString (error); CopyString (errorString, 0, tempString, 0, 255); return (error);
}
09-25-2009 10:40 AM
Apparently, copy and paste did not work too well, please view the .txt file for the source code inside the wrapper.
09-26-2009 10:55 PM
09-29-2009 06:13 PM
Hi Robert,
I am not using Labview and I am using Labwindows CVI. I have tried using the functions with the 'pf' prefix but no header files have been defined for these to operate. I also tried using the code from the text file you provided but the program does not compile. Kindly help me how to program the camera in CVI instead of Labview. I do not have any idea about Labview and my entire program is in CVI.
Regards,
Farhan.
09-30-2009 02:18 PM
01-30-2010 12:25 AM
Hello Guys,
I have another problem now. Since you guys have had experience with photonfocus cameras so I have another question for you guys. I figured out how to set the camera attributes thanks to your help. Now I am having problem to program CVI to enable me to obtain images based on an external trigger. Does anyone of you have any experience or any idea how to do that. I want to set the exposure time of the camera based on the duration of the external trigger.
02-01-2010 05:56 PM
Hello Farhan,
I would recommend creating a new thread for your question, so that the subject accurately describes your issue. You can link to the new thread from this one.
Are you using the DLL provided by photon focus or the NI-IMAQ driver? If you are using the NI-IMAQ driver, how are you currently trying to set the camera attributes?