Impact Acquire SDK Python
RTCtrProgram Class Reference

A class to represent real time control programs(Device specific interface layout only). More...

Inheritance diagram for RTCtrProgram:
[legend]

Public Member Functions

 __init__ (self, src)
 Constructs a new mvIMPACT.acquire.RTCtrProgram from an existing one.
 
 getProgramSize (self)
 Returns the number of program instructions for this program.
 
 load (self)
 Loads an existing program specified by the property mvIMPACT.acquire.RTCtrProgram.fileName.
 
 programStep (self, nr)
 Returns a pointer to a program instruction of the program.
 
 save (self)
 Stores the current state of the program under the name specified by the property mvIMPACT.acquire.RTCtrProgram.filename.
 
 setProgramSize (self, newSize)
 A function to define the number of instructions this program should consist of.
 

Properties

 filename = property(lib_mvIMPACT_acquire.RTCtrProgram_filename_get, doc=)
 A string property storing the filename for this program.
 
 mode = property(lib_mvIMPACT_acquire.RTCtrProgram_mode_get, doc=)
 An enumerated integer property defining the current state this program is into.
 
 programSize = property (getProgramSize, setProgramSize, None, None)
 An integer property (read-only) which holds the number program instructions for this program.
 
 programState = property(lib_mvIMPACT_acquire.RTCtrProgram_programState_get, doc=)
 A string property (read-only) containing information about the current state of the program.
 
 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Detailed Description

A class to represent real time control programs(Device specific interface layout only).

Real time control programs can be used to control the way how an when images are exposed and transmitted to the user.

An mvIMPACT.acquire.RTCtrProgram e.g. can be used to achieve a constant frame rate with a desired frequency. This can be done e.g. by triggering the camera with a constant frequency.

def runAt10Hz(pBF):
bfs = acquire.CameraSettingsBlueFOX(pBF)
bfIOs = acquire.IOSubSystemBlueFOX(pBF)
# define a HRTC program that results in a define image frequency
# the hardware real time controller shall be used to trigger an image
bfs.triggerSource.write(acquire.ctsRTCtrl)
# when the hardware real time controller switches the trigger signal to
# high the exposure of the image shall start
bfs.triggerMode.write(acquire.ctmOnRisingEdge)
# error checks
if bfIOs.RTCtrProgramCount == 0:
# no HRTC controllers available (this never happens for the mvBlueFOX)
return
pRTCtrlProgram = bfIOs.getRTCtrProgram(0)
if pRTCtrlProgram == None:
# this only should happen if the system is short of memory
return
# start of the program
# we need 5 steps for the program
pRTCtrlProgram.setProgramSize(5)
# wait a certain amount of time to achieve the desired frequency
progStep = 0
pRTCtrlStep = None
pRTCtrlStep = pRTCtrlProgram.programStep(progStep)
pRTCtrlStep.opCode.write(acquire.rtctrlProgWaitClocks)
pRTCtrlStep.clocks_us.write(99900)
# trigger an image
progStep = progStep + 1
pRTCtrlStep = pRTCtrlProgram.programStep(progStep)
pRTCtrlStep.opCode.write(acquire.rtctrlProgTriggerSet)
# high time for the trigger signal (should not be smaller than 100 us)
progStep = progStep + 1
pRTCtrlStep = pRTCtrlProgram.programStep(progStep)
pRTCtrlStep.opCode.write(acquire.rtctrlProgWaitClocks)
pRTCtrlStep.clocks_us.write(100)
# end trigger signal
progStep = progStep + 1
pRTCtrlStep = pRTCtrlProgram.programStep(progStep)
pRTCtrlStep.opCode.write(acquire.rtctrlProgTriggerReset)
# restart the program
progStep = progStep + 1
pRTCtrlStep = pRTCtrlProgram.programStep(progStep)
pRTCtrlStep.opCode.write(acquire.rtctrlProgJumpLoc)
pRTCtrlStep.address.write(0)
# start the program
pRTCtrlProgram.mode.write(acquire.rtctrlModeRun)
# Now this camera will deliver images at exactly 10 Hz (1 / (99900 us + 100us))
# when it is constantly feed with image requests.

Once this program has been defined it can be executed by setting the mode property to mvIMPACT.acquire.rtctrlModeRun. As in this example we do not wait for an external signal the property triggerMode must be set to a value demanding an external signal (e.g. mvIMPACT.acquire.ctmOnHighLevel ; You will find a summary of the valid trigger modes in the sensor specific data in the "Sensor data" chapter of the specific product manual. triggerMode must be set to mvIMPACT.acquire.ctsRTCtrl to inform the driver that the signal generate by the real time program shall be used as the trigger signal.

Note
mvIMPACT.acquire.RTCtrProgram objects can't be created directly! To access an mvIMPACT.acquire.RTCtrProgram associated with a certain device create an instance of an object derived from mvIMPACT.acquire.IOSubSystem and then use the function mvIMPACT.acquire.IOSubSystem.RTCtrProgramCount() to find out if there are hardware real time controller machines available for this device and if so how many of them can be accessed. Pointers to the machines then can be obtained by calling the function mvIMPACT.acquire.IOSubSystem.getRTCtrProgram() with the number of the controller (zero based) to be modified.
This class will only be available if mvIMPACT.acquire.Device.interfaceLayout is set to mvIMPACT.acquire.dilDeviceSpecific before the device is opened.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
src )

Constructs a new mvIMPACT.acquire.RTCtrProgram from an existing one.

Parameters
src[in] A constant reference to the mvIMPACT.acquire.RTCtrProgram object, this object shall be created from

Reimplemented from ComponentCollection.

Member Function Documentation

◆ getProgramSize()

getProgramSize ( self)

Returns the number of program instructions for this program.

Returns
The number of program instructions for this program.

◆ load()

load ( self)

Loads an existing program specified by the property mvIMPACT.acquire.RTCtrProgram.fileName.

The default file extension for these programs is '*.rtp'. If the user doesn't specify this file extension, it is appended automatically. Only files of this type can be loaded by this function.

Returns

◆ programStep()

programStep ( self,
nr )

Returns a pointer to a program instruction of the program.

Returns
A pointer to a program instruction of the program.
Parameters
nr[in] The index of the program instruction to obtain.

◆ save()

save ( self)

Stores the current state of the program under the name specified by the property mvIMPACT.acquire.RTCtrProgram.filename.

The default file extension for files stored using this function is '*.rtp'. If the user doesn't specify this file extension, it is appended automatically. Only files of this type can be loaded by the function mvIMPACT.acquire.RTCtrProgram.load.

Returns

◆ setProgramSize()

setProgramSize ( self,
newSize )

A function to define the number of instructions this program should consist of.

Parameters
newSize[in] The new number of program instructions

Property Documentation

◆ filename

filename = property(lib_mvIMPACT_acquire.RTCtrProgram_filename_get, doc=)
static

A string property storing the filename for this program.

mvIMPACT.acquire.RTCtrProgram s can be stored and loaded from/to XML files. To do this, this property must be set to the desired filename.

See also
mvIMPACT.acquire.RTCtrProgram.load,
mvIMPACT.acquire.RTCtrProgram.save

◆ mode

mode = property(lib_mvIMPACT_acquire.RTCtrProgram_mode_get, doc=)
static

An enumerated integer property defining the current state this program is into.

In order to affect the behaviour of the image acquisition an mvIMPACT.acquire.RTCtrProgram must be in running mode. Apart from that the property triggerSource must be set appropriately.

Valid values for this property may be: mvIMPACT.acquire.rtctrlModeStop, mvIMPACT.acquire.rtctrlModeRun, mvIMPACT.acquire.rtctrlModeRunRestart.

◆ programSize

programSize = property (getProgramSize, setProgramSize, None, None)
static

An integer property (read-only) which holds the number program instructions for this program.

See mvIMPACT.acquire.RTCtrProgram.getProgramSize()

◆ programState

programState = property(lib_mvIMPACT_acquire.RTCtrProgram_programState_get, doc=)
static

A string property (read-only) containing information about the current state of the program.

◆ thisown

thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
static