mvIMPACT Acquire SDK C++
OutputSignalGeneratorFrameGrabber Class Reference

A class to create complex digital output signals(Device specific interface layout only). More...

Public Member Functions

int defineLineScanPulse (DigitalOutput *pOutput, TDeviceSignalOutputStartEvent pulseStartEventValue, int softwareSignalPeriod_pclk, int width_pclk, int polarity, unsigned int divider)
 Defines a pulse to trigger line scan cameras. More...
 
int definePassThroughSignal (DigitalOutput *pOutput, const std::string &digitalSignal, bool boInverted=false)
 Assigning a certain signal to a digital output. More...
 
int definePassThroughSignal (DigitalOutput *pOutput, TDigitalSignal digitalSignal, bool boInverted=false)
 Assigns a certain signal to a digital output. More...
 
int definePulse (DigitalOutput *pOutput, int polarity, int delay, int width, PulseStartConfiguration *pPulseStartConfiguration=0)
 Assigns a single pulse to a digital output. More...
 
int definePulseSequence (DigitalOutput *pOutput, int startLevel, const std::vector< int > &sequence, PulseStartConfiguration *pPulseStartConfiguration=0)
 Assigns a complex signal to a digital output. More...
 
unsigned int getValidPassThroughSignalCount (DigitalOutput *pOutput) const
 Returns the number of signals that can be used for pass through signal definitions for a certain digital output pin of this device. More...
 
std::string getValidPassThroughSignalString (DigitalOutput *pOutput, int index=0) const
 Receives a valid string representation of a signal that can be passed directly to a certain digital output pin. More...
 
TDigitalSignal getValidPassThroughSignalValue (DigitalOutput *pOutput, int index=0) const
 Receives a valid signal that can be passed directly to a certain digital output pin. More...
 
int getValidSignalsForPassThroughModes (DigitalOutput *pOutput, TDigitalSignalTranslationDict &sequence) const
 Receives a list of valid signals that can be passed directly to a certain digital output pin. More...
 
OutputSignalGeneratorFrameGrabberoperator= (const OutputSignalGeneratorFrameGrabber &rhs)
 Allows assignments of mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber objects. More...
 
 OutputSignalGeneratorFrameGrabber (const OutputSignalGeneratorFrameGrabber &src)
 Constructs a new mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber from an existing one. More...
 
 OutputSignalGeneratorFrameGrabber (Device *pDev)
 Constructs a new mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber object. More...
 
int undefineSignal (DigitalOutput *pOutput)
 Removes the signal definition from the specified output pin. More...
 
 ~OutputSignalGeneratorFrameGrabber ()
 Class destructor. More...
 

Public Attributes

PropertyIDigitalOutputControlMode controlMode
 An enumerated integer property defining the general method used to create output signals. More...
 
PropertyIDeviceImageTrigger imageTrigger
 An enumerated integer property defining the general behaviour of created output signals. More...
 
PropertyIDeviceSignalOutputStartEvent pulseStartEvent
 An enumerated integer property defining the general behaviour of created output signals. More...
 

Detailed Description

A class to create complex digital output signals(Device specific interface layout only).

Instances of this class can be used to create more complex digital output related signals like a single pulse or sequence of pulses on a certain pin as a reaction on a signal on one of the digital inputs of a device.

The availability of the features provided by this class heavily depends on the used capture device. Therefore it's crucial to check if a desired feature is available at all. This class either provides the functions needed for these checks or its functions will return appropriate error codes.

Note
If the property mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::controlMode is not available NO feature of this class can be used.
If the translation dictionary of mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::controlMode does not contain mvIMPACT::acquire::docmRTC the function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::defineLineScanPulse will NOT be available.
Calling unsupported functions or accessing unsupported features will raise an exception.

Pointers to mvIMPACT::acquire::DigitalOutput objects MUST be obtained by an instance to a mvIMPACT::acquire::IOSubSystemFrameGrabber object of the same device.

#include <iostream>
#include <vector>
using namespace std;
using namespace mvIMPACT::acquire;
//-----------------------------------------------------------------------------
int main( int argc, char* argv[] )
//-----------------------------------------------------------------------------
{
DeviceManager devMgr;
Device* pDev = getValidDevicePointerFromSomewhere( devMgr );
// The next line will raise an exception if the device is not operated
// in interface layout 'dilDeviceSpecific' or is not a frame grabber! This
// should therefore be wrapped in an exception handler if in doubt!
IOSubSystemFrameGrabber io( pDev );
unsigned int iCnt = io.getInputCount();
cout << "available digital inputs: " << iCnt << endl;
for( unsigned int d=0; d<iCnt; d++ )
{
cout << io.input( d )->getDescription() << endl;
}
unsigned int oCnt = io.getOutputCount();
cout << "available digital outputs: " << oCnt << endl;
// set all available digital outputs to high
for( unsigned int e=0; e<oCnt; e++ )
{
DigitalOutput* pOutput = io.output( e );
cout << "setting " << pOutput->getDescription() << " to high" << endl;
pOutput->set();
}
// check there is at least one digital output
if( oCnt > 0 )
{
// check if this device supports enhanced signal creation at all
if( osg.controlMode.isValid() )
{
// define a simple pulse on the first digital output detected.
// this pulse will be low after 100 us for
// 200us and then switches back to high.
osg.definePulse( io.output( 0 ), 0, 100, 200 );
// define a more complex pulse
vector<int> v;
v.push_back( 100 );
v.push_back( 299 );
v.push_back( 666 );
osg.definePulseSequence( io.output( 0 ), 0, v );
osg.controlMode.write( docmSoftware );
osg.imageTrigger.write( ditAfterDigOutSignals );
// check if line scan pulse creation is supported by this device
vector<pair<string, TDigitalOutputControlMode> > dict;
osg.controlMode.getTranslationDict( dict );
unsigned int dictSize = osg.controlMode.dictSize();
for( unsigned int i=0; i<dictSize; i++ )
{
if( dict[i].second == docmRTC )
{
// supported -> define some signal
cout << "checkGrabberInterface: This device supports RTC control signal creation." << endl;
osg.controlMode.write( docmRTC );
osg.defineLineScanPulse( io.output( 0 ), dsosePeriodically, 100, 100, 1, 1 );
}
}
}
}
return 0;
}
OutputSignalGeneratorFrameGrabber(Device *pDev)
Constructs a new mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber object.
Definition: mvIMPACT_acquire.h:18082
@ dsosePeriodically
The signal generation on the digital outputs starts periodically. CameraLink® only!...
Definition: mvDriverBaseEnums.h:2092
@ ditAfterDigOutSignals
Acquisition starts after all defined signals have been generated on the digital outputs.
Definition: mvDriverBaseEnums.h:1948
@ docmSoftware
The digital output signal is generated by the on-board processor.
Definition: mvDriverBaseEnums.h:2288
@ docmRTC
The digital output signal is generated by a Real Time Controller that is part of the used hardware de...
Definition: mvDriverBaseEnums.h:2290
This namespace contains classes and functions belonging to the image acquisition module of this SDK.

Whenever a signal has been defined for a a certain digital output pin, this pin can no longer controlled using the corresponding functions in the class mvIMPACT::acquire::DigitalOutput. In order to do that the pin in question must be released using the function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::undefineSignal.

Note
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

◆ OutputSignalGeneratorFrameGrabber() [1/2]

OutputSignalGeneratorFrameGrabber ( Device pDev)
inlineexplicit

Constructs a new mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber object.

Parameters
pDevA pointer to a mvIMPACT::acquire::Device object obtained from a mvIMPACT::acquire::DeviceManager object.

◆ OutputSignalGeneratorFrameGrabber() [2/2]

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

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

◆ ~OutputSignalGeneratorFrameGrabber()

Class destructor.

Member Function Documentation

◆ defineLineScanPulse()

int defineLineScanPulse ( DigitalOutput pOutput,
TDeviceSignalOutputStartEvent  pulseStartEventValue,
int  softwareSignalPeriod_pclk,
int  width_pclk,
int  polarity,
unsigned int  divider 
)
inline

Defines a pulse to trigger line scan cameras.

Calling this function without setting mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::controlMode to mvIMPACT::acquire::docmRTC will have NO effect.

Note
Not every frame grabber will offer the mvIMPACT::acquire::docmRTC mode. Check is the mode is available by reading the properties translation dictionary with the functions mvIMPACT::acquire::PropertyIDigitalOutputControlMode::getTranslationDictString and mvIMPACT::acquire::PropertyIDigitalOutputControlMode::getTranslationDictValue. The detailed description of this class might contain source code examples for the language you are working with. C++ offers the more efficient function mvIMPACT::acquire::PropertyIDigitalOutputControlMode::getTranslationDict in addition to the functions mentioned above.
See also
mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::undefineSignal
Returns
Parameters
[in]pOutputA pointer to a mvIMPACT::acquire::DigitalOutput object obtained from an instance of the class mvIMPACT::acquire::IOSubSystemFrameGrabber for this device.
[in]pulseStartEventValueDefines the start event for the signal generation. Valid values for this parameter are defined by mvIMPACT::acquire::TDeviceSignalOutputStartEvent.
[in]softwareSignalPeriod_pclkDefines the frequency for a continuously generated signal if pulseStartEventValue is mvIMPACT::acquire::dsoseSyncInRisingEdge or mvIMPACT::acquire::dsoseSyncInFallingEdge and is ignored otherwise.
[in]width_pclkThe width of the signal to generate if pulseStartEventValue is mvIMPACT::acquire::dsoseSyncInRisingEdge, mvIMPACT::acquire::dsosePeriodically or mvIMPACT::acquire::dsoseSyncInFallingEdge and is ignored otherwise.
[in]polarityThe polarity of the signal to generate if pulseStartEventValue is mvIMPACT::acquire::dsoseSyncInRisingEdge, mvIMPACT::acquire::dsosePeriodically or mvIMPACT::acquire::dsoseSyncInFallingEdge and is ignored otherwise. - 0: The signal will be low for width_pclk and high otherwise - 1: The signal will be high for width_pclk and high otherwise
[in]dividerDefines the divider value if pulseStartEventValue is mvIMPACT::acquire::dsosePeriodically

◆ definePassThroughSignal() [1/2]

int definePassThroughSignal ( DigitalOutput pOutput,
const std::string &  digitalSignal,
bool  boInverted = false 
)
inline

Assigning a certain signal to a digital output.

Some digital input signals or even some internal signals can be passed directly to one or more digital outputs.

Returns
Parameters
[in]pOutputA pointer to a mvIMPACT::acquire::DigitalOutput object obtained from an instance of the class mvIMPACT::acquire::IOSubSystemFrameGrabber for this device.
[in]digitalSignalThe string representation of the digital output that shall be passed to the digital output. Valid values for this parameter will be obtained by a call to the function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::getValidSignalsForPassThroughModes
[in]boInvertedIf set to true, the signal will be inverted internally before being passed to the output.

◆ definePassThroughSignal() [2/2]

int definePassThroughSignal ( DigitalOutput pOutput,
TDigitalSignal  digitalSignal,
bool  boInverted = false 
)
inline

Assigns a certain signal to a digital output.

Some digital input signals or even some internal signals can be passed directly to one or more digital outputs.

Returns
Parameters
[in]pOutputA pointer to a mvIMPACT::acquire::DigitalOutput object obtained from an instance of the class mvIMPACT::acquire::IOSubSystemFrameGrabber for this device.
[in]digitalSignalThe digital signal that shall be passed to the digital output. Valid values for this parameter will be obtained by a call to the function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::getValidSignalsForPassThroughModes
[in]boInvertedIf set to true, the signal will be inverted internally before being passed to the output.

◆ definePulse()

int definePulse ( DigitalOutput pOutput,
int  polarity,
int  delay,
int  width,
PulseStartConfiguration pPulseStartConfiguration = 0 
)
inline

Assigns a single pulse to a digital output.

Whenever a single pulse of a certain duration and polarity shall be generated on a digital output as a reaction on a trigger signal that was either generated by one of digital inputs of the device or software this is the right function to use.

When the signal is generated can be defined by the properties mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::pulseStartEvent and mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::imageTrigger.

See also
mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::undefineSignal
Returns
Parameters
[in]pOutputA pointer to a mvIMPACT::acquire::DigitalOutput object obtained from an instance of the class mvIMPACT::acquire::IOSubSystemFrameGrabber for this device.
[in]polarityThe polarity of the pulse to generate. - 0: The pulse will be low for width_pclk and high otherwise - 1: The pulse will be high for width_pclk and high otherwise
[in]delayThe delay after the trigger event before a signal generation starts
[in]widthThe width of the pulse to generate
[in]pPulseStartConfigurationThe pulse start configuration to be used for this pulse sequence. Not every device will support the use of pulse start configurations. Valid objects that can be passed to this function can be obtained from a call to mvIMPACT::acquire::IOSubSystem::getPulseStartConfiguration, and mvIMPACT::acquire::IOSubSystem::getPulseStartConfigurationCount. If objects of these type are not supported, pass 0 or ignore this parameter. In that case the property mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::imageTrigger will define the start condition for the signal output.

◆ definePulseSequence()

int definePulseSequence ( DigitalOutput pOutput,
int  startLevel,
const std::vector< int > &  sequence,
PulseStartConfiguration pPulseStartConfiguration = 0 
)
inline

Assigns a complex signal to a digital output.

This function can be used when a complex signal shall be generated on a digital output as a reaction on a trigger signal that was either generated by one of digital inputs of the device or software.

When the signal is generated can be defined by the properties mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::pulseStartEvent and mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::imageTrigger.

See also
mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::undefineSignal
Returns
Parameters
[in]pOutputA pointer to a mvIMPACT::acquire::DigitalOutput object obtained from an instance of the class mvIMPACT::acquire::IOSubSystemFrameGrabber for this device.
[in]startLevelThe start level of the generated signal. - 0: The signal will start with 'low' - 1: The signal will start with 'high'
[in]sequenceAn array of integer values. Each values defines a switch in polarity of the signal after 'x' us. An array containing '1000', '2000' therefore will describe a signal starting with startLevel, switches polarity after 1000 us and then again switches polarity after 2000 us.
[in]pPulseStartConfigurationThe pulse start configuration to be used for this pulse sequence. Not every device will support the use of pulse start configurations. Valid objects that can be passed to this function can be obtained from a call to mvIMPACT::acquire::IOSubSystem::getPulseStartConfiguration, and mvIMPACT::acquire::IOSubSystem::getPulseStartConfigurationCount. If objects of these type are not supported, pass 0 or ignore this parameter. In that case the property mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::imageTrigger will define the start condition for the signal output.

◆ getValidPassThroughSignalCount()

unsigned int getValidPassThroughSignalCount ( DigitalOutput pOutput) const
inline

Returns the number of signals that can be used for pass through signal definitions for a certain digital output pin of this device.

Parameters
[in]pOutputA pointer to a mvIMPACT::acquire::DigitalOutput object obtained from an instance of the class mvIMPACT::acquire::IOSubSystemFrameGrabber for this device.

◆ getValidPassThroughSignalString()

std::string getValidPassThroughSignalString ( DigitalOutput pOutput,
int  index = 0 
) const
inline

Receives a valid string representation of a signal that can be passed directly to a certain digital output pin.

Whenever it is necessary to output a certain signal (e.g. a digital input signal connected to the device or an internal digital signal like e.g. a frame valid signal) to a digital output of the device this can be done by a call to the function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::definePassThroughSignal

As the type of signals that a device can send to a digital output depends heavily on the device and even on the digital output as well, this function together with the function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::getValidPassThroughSignalString can be used to query a list of strings and a numerical representation for each signal that can be sent to this digital output.

C++ offers the more efficient function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::getValidSignalsForPassThroughModes to obtain this information.

Parameters
[in]pOutputA pointer to a mvIMPACT::acquire::DigitalOutput object obtained from an instance of the class mvIMPACT::acquire::IOSubSystemFrameGrabber for this device.
[in]indexThe index of the entry to read from the property. The find out the last valid value for this parameter call mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::getValidPassThroughSignalCount

◆ getValidPassThroughSignalValue()

TDigitalSignal getValidPassThroughSignalValue ( DigitalOutput pOutput,
int  index = 0 
) const
inline

Receives a valid signal that can be passed directly to a certain digital output pin.

Whenever it is necessary to output a certain signal (e.g. a digital input signal connected to the device or an internal digital signal like e.g. a frame valid signal) to a digital output of the device this can be done by a call to the function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::definePassThroughSignal

As the type of signals that a device can send to a digital output depends heavily on the device and even on the digital output as well, this function together with the function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::getValidPassThroughSignalString can be used to query a list of strings and a numerical representation for each signal that can be sent to this digital output.

C++ offers the more efficient function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::getValidSignalsForPassThroughModes to obtain this information.

Parameters
[in]pOutputA pointer to a mvIMPACT::acquire::DigitalOutput object obtained from an instance of the class mvIMPACT::acquire::IOSubSystemFrameGrabber for this device.
[in]indexThe index of the entry to read from the property. The find out the last valid value for this parameter call mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::getValidPassThroughSignalCount

◆ getValidSignalsForPassThroughModes()

int getValidSignalsForPassThroughModes ( DigitalOutput pOutput,
TDigitalSignalTranslationDict sequence 
) const
inline

Receives a list of valid signals that can be passed directly to a certain digital output pin.

Whenever it is necessary to output a certain signal (e.g. a digital input signal connected to the device or an internal digital signal like e.g. a frame valid signal) to a digital output of the device this can be done by a call to the function mvIMPACT::acquire::OutputSignalGeneratorFrameGrabber::definePassThroughSignal

As the type of signals that a device can send to a digital output depends heavily on the device and even on the digital output as well, this function will return a list of strings and a numerical representation for each signal that can be sent to this digital output.

Note
This function is much more efficient than calling OutputSignalGeneratorFrameGrabber::getValidPassThroughSignalValue and OutputSignalGeneratorFrameGrabber::getValidPassThroughSignalString and therefore this function should be called whenever all entries are required.
Returns
Parameters
[in]pOutputA pointer to a mvIMPACT::acquire::DigitalOutput object obtained from an instance of the class mvIMPACT::acquire::IOSubSystemFrameGrabber for this device.
[out]sequenceA reference to a vector that will receive the list of allowed digital signals for this particular digital output pin.

◆ operator=()

◆ undefineSignal()

int undefineSignal ( DigitalOutput pOutput)
inline

Removes the signal definition from the specified output pin.

Whenever a signal has been defined for a a certain digital output pin, this pin can no longer controlled using the corresponding functions in the class mvIMPACT::acquire::DigitalOutput. This function removes the signal definition and hands back manual control of that digital output to the user.

Returns
Parameters
[in]pOutputA pointer to a mvIMPACT::acquire::DigitalOutput object obtained from an instance of the class mvIMPACT::acquire::IOSubSystemFrameGrabber for this device.

Member Data Documentation

◆ controlMode

An enumerated integer property defining the general method used to create output signals.

This setting always applies to every signal defined. Modifying this property will also change the behaviour of signals already defined.

Valid values for this property are defined by the enumeration mvIMPACT::acquire::TDigitalOutputControlMode.

When switching to mvIMPACT::acquire::docmRTC mode only one signal can be created currently.

Note
Not every frame grabber will offer the mvIMPACT::acquire::docmRTC mode. Check if the mode is available by reading the properties translation dictionary with the functions mvIMPACT::acquire::PropertyIDigitalOutputControlMode::getTranslationDictString and mvIMPACT::acquire::PropertyIDigitalOutputControlMode::getTranslationDictValue. C++ offers the more efficient function mvIMPACT::acquire::PropertyIDigitalOutputControlMode::getTranslationDict in addition to the functions mentioned above.

Some devices will offer a more flexible way to define this behaviour. In this case, this property won't be available (a call to the function mvIMPACT::acquire::Component::isValid will return false). However then calls to mvIMPACT::acquire::IOSubSystem::getPulseStartConfigurationCount and mvIMPACT::acquire::IOSubSystem::getPulseStartConfiguration will succeed and the objects returned by mvIMPACT::acquire::IOSubSystem::getPulseStartConfiguration (mvIMPACT::acquire::PulseStartConfiguration) will provide a more sophisticated way to define the signal output behaviour of a device.

◆ imageTrigger

An enumerated integer property defining the general behaviour of created output signals.

This setting always applies to every signal defined. Modifying this property will also change the behaviour of signals already defined.

Valid values for this property are defined by the enumeration mvIMPACT::acquire::TDeviceImageTrigger.

◆ pulseStartEvent

An enumerated integer property defining the general behaviour of created output signals.

This setting always applies to every signal defined. Modifying this property will also change the behaviour of signals already defined.

Valid values for this property are defined by the enumeration mvIMPACT::acquire::TDeviceSignalOutputStartEvent.


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