PvAPI-Python-Wrapper for Allied Vision Camera - not able to set parameters/execute commands

asked 2015-10-30 08:57:46 -0500

Richard Mohana gravatar image

Hi guys,

Since hours Iam trying to configure the AVT Manta G-504C Kamera. Therefor i used some wrapper like

py-avt-pvapi or py-avt-pvapi2

Whatever I do, I can't do some configurations like

PvAttrEnumSet('FrameStartTriggerMode','Freerun')
PvAttrEnumSet('AcquisitionMode','Continuous')
PvCommandRun('AcquisitionStart')

Each of them causes in the following error message

Camera or attribute not found (ePvErrNotFound)

Iam not sure if it is necessary to set the 'AccessMode' for the camera to have Full (Write) Access

typedef enum { 
ePvAccessMonitor = 2, // Monitor access: no control, read & listen only
ePvAccessMaster = 4, // Master access: full control
__ePvAccess_force_32    = 0xFFFFFFFF
} tPvAccessFlags;

I even can't find out any default configuration. Everything works fine out of the AVT Vimba Viewer.

My steps in Python 3.2 are ...

PvInitialize()
PvCameraListEx()
PvCameraOpen()         # open the camera with the given handle

PvCaptureStart()
PvAttrEnumSet(handle,"FrameStartTriggerMode","Freerun")
PvAttrEnumSet(handle, 'AcquisitionMode','Continuous')

# begin main loop to grab frames
PvCaptureQueueFrame()
PvCommandRun(handle,"AcquisitionStart")
PvCaptureWaitForFrameDone()

etc.
...
...
...

I can read these values from the camera (UniqueIdentifier in brackets)

Camera: Manta_G-504C (5010103) FirmwareVersion: 00.01.44.04

I hope that somebody could help in that case. For now, Iam really stumped.

Additional:

I used the following python function block as example commandRun()

def commandRun(self,handle,command):
    """Runs a particular command valid in the Camer and Drive Attributes"""
    result = self.dll.PvCommandRun(handle,command)
    if result != e.ePvErrSuccess:
        self.handleError(result)
    else:            
        return result
edit retag flag offensive close merge delete

Comments

how is this related to opencv ?

berak gravatar imageberak ( 2015-10-30 08:58:59 -0500 )edit

I want to grab and process the frames with OpenCV after that.

Richard Mohana gravatar imageRichard Mohana ( 2015-10-30 09:17:49 -0500 )edit