mvIMPACT Acquire SDK C++
RTCtrProgram Class Reference

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

Inheritance diagram for RTCtrProgram:
ComponentCollection

Public Member Functions

int getProgramSize (void) const
 Returns the number of program instructions for this program. More...
 
HOBJ hObj (void) const
 Returns a unique identifier for the component collection referenced by this object. More...
 
int load (void)
 Loads an existing program specified by the property mvIMPACT::acquire::RTCtrProgram::fileName. More...
 
RTCtrProgramoperator= (const RTCtrProgram &rhs)
 Allows assignments of mvIMPACT::acquire::RTCtrProgram objects. More...
 
RTCtrProgramStepprogramStep (unsigned int nr) const
 Returns a pointer to a program instruction of the program. More...
 
const ComponentCollectionrestoreDefault (void) const
 Restores the default for every component of this collection. More...
 
 RTCtrProgram (const RTCtrProgram &src)
 Constructs a new mvIMPACT::acquire::RTCtrProgram from an existing one. More...
 
int save (void)
 stores the current state of the program under the name specified by the property mvIMPACT::acquire::RTCtrProgram::filename More...
 
void setProgramSize (int newSize)
 A function to define the number of instructions this program should consist of. More...
 
 ~RTCtrProgram ()
 Class destructor. More...
 

Public Attributes

PropertyS filename
 A string property storing the filename for this program. More...
 
PropertyIRTCtrlModes mode
 An enumerated integer property defining the current state this program is into. More...
 
PropertyS programState
 A string property (read-only) containing information about the current state of the program. More...
 

Protected Attributes

HOBJ m_hRoot
 

Friends

class IOSubSystem
 

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.

An appropriate signal for triggering the camera can be generated as follows:

using namespace mvIMPACT::acquire;
void runAt10Hz( Device* pBF )
{
IOSubSystemBlueFOX bfIOs( 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( ctsRTCtrl );
// when the hardware real time controller switches the trigger signal to
// high the exposure of the image shall start
bfs.triggerMode.write( ctmOnRisingEdge );
// error checks
if( bfIOs.RTCtrProgramCount() == 0 )
{
// no HRTC controllers available (this never happens for the mvBlueFOX)
return;
}
RTCtrProgram* pRTCtrlProgram = bfIOs.getRTCtrProgram( 0 );
if( !pRTCtrlProgram )
{
// 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
int progStep = 0;
RTCtrProgramStep* pRTCtrlStep = 0;
pRTCtrlStep = pRTCtrlProgram->programStep( progStep++ );
pRTCtrlStep->clocks_us.write( 99900 );
// trigger an image
pRTCtrlStep = pRTCtrlProgram->programStep( progStep++ );
// high time for the trigger signal (should not be smaller than 100 us)
pRTCtrlStep = pRTCtrlProgram->programStep( progStep++ );
pRTCtrlStep->clocks_us.write( 100 );
// end trigger signal
pRTCtrlStep = pRTCtrlProgram->programStep( progStep++ );
// restart the program
pRTCtrlStep = pRTCtrlProgram->programStep( progStep++ );
pRTCtrlStep->opCode.write( rtctrlProgJumpLoc );
pRTCtrlStep->address.write( 0 );
// start the program
pRTCtrlProgram->mode.write( 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.
Examples
ContinuousCaptureToAVIFile.cpp, and SequenceCapture.cpp.

Constructor & Destructor Documentation

◆ RTCtrProgram()

RTCtrProgram ( const RTCtrProgram src)
inline

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

Parameters
[in]srcA constant reference to the mvIMPACT::acquire::RTCtrProgram object, this object shall be created from

◆ ~RTCtrProgram()

~RTCtrProgram ( )
inline

Class destructor.

Member Function Documentation

◆ getProgramSize()

int getProgramSize ( void  ) const
inline

Returns the number of program instructions for this program.

Returns
The number of program instructions for this program.

◆ hObj()

HOBJ hObj ( void  ) const
inlineinherited

Returns a unique identifier for the component collection referenced by this object.

This handle will always reference an object of type mvIMPACT::acquire::ComponentList.

Returns
A unique identifier for the component referenced by this object.

◆ load()

int load ( void  )
inline

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

◆ operator=()

RTCtrProgram& operator= ( const RTCtrProgram rhs)
inline

Allows assignments of mvIMPACT::acquire::RTCtrProgram objects.

◆ programStep()

RTCtrProgramStep* programStep ( unsigned int  nr) const
inline

Returns a pointer to a program instruction of the program.

If nr is invalid(too large) a STL out_of_range exception will be thrown.

Returns
A pointer to a program instruction of the program.
Parameters
[in]nrThe index of the program instruction to obtain.
Examples
ContinuousCaptureToAVIFile.cpp, and SequenceCapture.cpp.

◆ restoreDefault()

const ComponentCollection& restoreDefault ( void  ) const
inlineinherited

Restores the default for every component of this collection.

Calling this function will restore the default value for every component belonging to this collection.

Note
The caller must have the right to modify the component. Otherwise an exception will be thrown.
Returns
A const reference to the component.

◆ save()

int save ( void  )
inline

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

void setProgramSize ( int  newSize)
inline

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

Parameters
[in]newSizeThe new number of program instructions
Examples
ContinuousCaptureToAVIFile.cpp, and SequenceCapture.cpp.

Friends And Related Function Documentation

◆ IOSubSystem

friend class IOSubSystem
friend

Member Data Documentation

◆ filename

PropertyS filename

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

◆ m_hRoot

HOBJ m_hRoot
protectedinherited

◆ mode

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 are defined by the enumeration mvIMPACT::acquire::TRTCtrlModes.

Examples
ContinuousCaptureToAVIFile.cpp, and SequenceCapture.cpp.

◆ programState

PropertyS programState

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


The documentation for this class was generated from the following file: