Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

camera attributes

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.

Regards,
Farhan Ahmad.
0 Kudos
Message 1 of 11
(6,032 Views)

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.

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 2 of 11
(6,004 Views)

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.

Regards,
Farhan Ahmad.
0 Kudos
Message 3 of 11
(5,931 Views)

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);

}

 
Robert Eastlund
Graftek Imaging, Inc.
Phone: (512) 416-1099 x101
Email: eastlund@graftek.com
0 Kudos
Message 4 of 11
(5,920 Views)

Apparently, copy and paste did not work too well, please view the .txt file for the source code inside the wrapper.

Robert Eastlund
Graftek Imaging, Inc.
Phone: (512) 416-1099 x101
Email: eastlund@graftek.com
0 Kudos
Message 5 of 11
(5,918 Views)

Robert,

can this code be pasted in a neat way?

 

Thanks a lot

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 6 of 11
(5,889 Views)

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.

Regards,
Farhan Ahmad.
0 Kudos
Message 7 of 11
(5,858 Views)
Photon Focus has made major changes to their API since that code was written, and thus no longer ships with "camdll.h".  You should refer to the documentation for their SDK on their recommended methods for communicating with the camera.  I recommend getting the latest SDK from the Photonfocus website.  Since you are not using LabVIEW, you do not need a wrapper DLL, but can rather call their DLLs directly.  See http://zone.ni.com/devzone/cda/tut/p/id/3341 for information on how to use a DLL in CVI.
0 Kudos
Message 8 of 11
(5,837 Views)

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.

Regards,
Farhan Ahmad.
0 Kudos
Message 9 of 11
(5,347 Views)

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? 

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 10 of 11
(5,306 Views)