Impact Acquire SDK Java
IOSubSystemCommon Class Reference

A base class to handle the digital inputs and outputs for devices (Device specific interface layout only). More...

Inheritance diagram for IOSubSystemCommon:
[legend]

Public Member Functions

synchronized void delete ()
 
long getInputCount ()
 Returns the number of mvIMPACT.acquire.DigitalInput s available for the mvIMPACT.acquire.Device associated with this object.
 
long getOutputCount ()
 Returns the number of digital outputs available for the mvIMPACT.acquire.Device associated with this object.
 
PulseStartConfiguration getPulseStartConfiguration (long nr)
 Returns a pointer to a mvIMPACT.acquire.PulseStartConfiguration associated with this device.
 
long getPulseStartConfigurationCount ()
 Returns the number of mvIMPACT.acquire.PulseStartConfiguration objects available for the mvIMPACT.acquire.Device associated with this object.
 
RTCtrProgram getRTCtrProgram (long nr)
 Returns a pointer to a mvIMPACT.acquire.RTCtrProgram associated with this device.
 
DigitalInput input (long nr)
 Returns a const pointer to a mvIMPACT.acquire.DigitalInput object.
 
 IOSubSystemCommon (Device pDev)
 Constructs a new mvIMPACT.acquire.IOSubSystemCommon object.
 
DigitalOutput output (long nr)
 Returns a pointer to a mvIMPACT.acquire.DigitalOutput object.
 
long readInputRegister ()
 Returns the current state of the digital input register.
 
long readOutputRegister ()
 Returns the current state of the digital output register.
 
long RTCtrProgramCount ()
 Returns the number of mvIMPACT.acquire.RTCtrProgram s available for the mvIMPACT.acquire.Device associated with this object.
 
void writeOutputRegister (long value)
 Alters the state of the digital output register.
 
void writeOutputRegister (long value, long mask)
 Alters the state of the digital output register.
 

Protected Member Functions

void finalize ()
 
 IOSubSystemCommon (long cPtr, boolean cMemoryOwn)
 

Static Protected Member Functions

static long swigRelease (IOSubSystem obj)
 
static long swigRelease (IOSubSystemCommon obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

A base class to handle the digital inputs and outputs for devices (Device specific interface layout only).

This class provides a convenient basic access to the digital inputs and outputs of almost every device supported by this interface.

Note
This class may NOT be used for mvBlueFOX devices.
The number of digital inputs and outputs available will vary significantly from device to device. Some devices might not even have digital inputs and/or digital outputs. Therefore it's crucial to check for available pins before using them. The corresponding functions to do that can be found in the base class mvIMPACT.acquire.IOSubSystem.
import mvIMPACT.acquire.*;
//-----------------------------------------------------------------------------
public class CameraDescriptionManagerExample
//-----------------------------------------------------------------------------
{
//=============================================================================
//=== Static member functions =================================================
//=============================================================================
static
{
try
{
System.loadLibrary( "mvIMPACT_Acquire.java" );
}
catch( UnsatisfiedLinkError e )
{
System.err.println( "Native code library failed to load. Make sure the 'mvIMPACT_Acquire.java' library can be found in the systems search path.\n" + e );
System.exit( 1 );
}
}
//-----------------------------------------------------------------------------
public static void main( String[] args )
//-----------------------------------------------------------------------------
{
DeviceManager devMgr = new DeviceManager();
Device pDev = mvIMPACT.acquire.examples.helper.DeviceAccess.getDeviceFromUserInput( devMgr );
if( pDev == null )
{
System.out.print( "Unable to continue!" );
mvIMPACT.acquire.examples.helper.DeviceAccess.waitForENTER();
System.exit( 1 );
}
System.out.println( "Initialising the device. This might take some time..." );
try
{
pDev.open();
}
catch( ImpactAcquireException e )
{
// this e.g. might happen if the same device is already opened in another process...
System.out.println( "An error occurred while opening device " + pDev.getSerial().read() +
"(error code: " + e.getMessage() + ")." );
mvIMPACT.acquire.examples.helper.DeviceAccess.waitForENTER();
System.exit( 1 );
}
try
{
// the next line will raise an exception if this device is not a frame grabber
IOSubSystemFrameGrabber io = new IOSubSystemFrameGrabber( pDev );
final long iCnt = io.getInputCount();
System.out.println( String.format( "Available digital inputs: %d", iCnt ) );
for( long d=0; d<iCnt; d++ )
{
System.out.println( io.input( d ).getDescription() );
}
final long oCnt = io.getOutputCount();
System.out.println( String.format( "Available digital outputs: %d", oCnt ) );
// set all available digital outputs to high
for( long e=0; e<oCnt; e++ )
{
DigitalOutput pOutput = io.output( e );
System.out.println( "setting " + pOutput.getDescription() + " to high" );
pOutput.set();
}
}
catch( ImpactAcquireException e )
{
System.out.println( "An error occurred: " + e.getMessage() + "." );
mvIMPACT.acquire.examples.helper.DeviceAccess.waitForENTER();
System.exit( 1 );
}
}
}
Note
This class will only be available if mvIMPACT.acquire.Device.getInterfaceLayout() is set to mvIMPACT.acquire.TDeviceInterfaceLayout.dilDeviceSpecific before the device is opened.

Constructor & Destructor Documentation

◆ IOSubSystemCommon() [1/2]

IOSubSystemCommon ( long cPtr,
boolean cMemoryOwn )
protected

◆ IOSubSystemCommon() [2/2]

Constructs a new mvIMPACT.acquire.IOSubSystemCommon object.

Parameters
pDev[in] A pointer to a mvIMPACT.acquire.Device object obtained from a mvIMPACT.acquire.DeviceManager object.

Member Function Documentation

◆ delete()

synchronized void delete ( )

Reimplemented from IOSubSystem.

Reimplemented in IOSubSystemFrameGrabber.

◆ finalize()

void finalize ( )
protected

Reimplemented from IOSubSystem.

Reimplemented in IOSubSystemFrameGrabber.

◆ getInputCount()

long getInputCount ( )
inherited

Returns the number of mvIMPACT.acquire.DigitalInput s available for the mvIMPACT.acquire.Device associated with this object.

◆ getOutputCount()

long getOutputCount ( )
inherited

Returns the number of digital outputs available for the mvIMPACT.acquire.Device associated with this object.

◆ getPulseStartConfiguration()

PulseStartConfiguration getPulseStartConfiguration ( long nr)
inherited

Returns a pointer to a mvIMPACT.acquire.PulseStartConfiguration associated with this device.

Parameters
nr[in] The number of the pulse start configuration to return

◆ getPulseStartConfigurationCount()

long getPulseStartConfigurationCount ( )
inherited

Returns the number of mvIMPACT.acquire.PulseStartConfiguration objects available for the mvIMPACT.acquire.Device associated with this object.

◆ getRTCtrProgram()

RTCtrProgram getRTCtrProgram ( long nr)
inherited

Returns a pointer to a mvIMPACT.acquire.RTCtrProgram associated with this device.

Parameters
nr[in] The number of the real time controller program to return

◆ input()

DigitalInput input ( long nr)
inherited

Returns a const pointer to a mvIMPACT.acquire.DigitalInput object.

Note
The possibility to access the digital inputs of a device as single objects is just provided for convenience. The same thing can be achieved by calling the function mvIMPACT.acquire.IOSubSystem.readInputRegister.
Parameters
nr[in] The number of the digital input.

◆ output()

DigitalOutput output ( long nr)
inherited

Returns a pointer to a mvIMPACT.acquire.DigitalOutput object.

Note
The possibility to access the digital outputs of a device as single objects is just provided for convenience. The same thing can be achieved by calling the function mvIMPACT.acquire.IOSubSystem.writeOutputRegister with the corresponding bit mask.
Parameters
nr[in] The number of the digital output.

◆ readInputRegister()

long readInputRegister ( )
inherited

Returns the current state of the digital input register.

This function can be used to read all digital inputs as a single value. Each bit represents the status of one digital output pin.

EXAMPLE

A value of '3' returned by this function means that digital inputs 0 and 1 are currently have a voltage considered as logical '1' applied to them.

◆ readOutputRegister()

long readOutputRegister ( )
inherited

Returns the current state of the digital output register.

This function can be used to read all digital outputs as a single value. Each bit represents the status of one digital output pin.

EXAMPLE

A value of '3' returned by this function means that digital output 0 and 1 are currently set to high.

◆ RTCtrProgramCount()

long RTCtrProgramCount ( )
inherited

Returns the number of mvIMPACT.acquire.RTCtrProgram s available for the mvIMPACT.acquire.Device associated with this object.

◆ swigRelease() [1/2]

static long swigRelease ( IOSubSystem obj)
staticprotectedinherited

◆ swigRelease() [2/2]

static long swigRelease ( IOSubSystemCommon obj)
staticprotected

◆ writeOutputRegister() [1/2]

void writeOutputRegister ( long value)

Alters the state of the digital output register.

This function can be used to alter the state of certain (or all) digital outputs with a single function call. By working with the parameter mask certain bits can remain unaffected.

EXAMPLE

If the previous state of a digital output register was '5', which means that outputs 0 and 2 are set to high a call to mvIMPACT.acquire.IOSubSystem.writeOutputRegister with value set to 2 and mask set to 3 would result in '6' as the new value for the output register. Pin 2 will remain unaffected, as mask states just to modify pin 0 and 1 ( 3 = 00000011 binary ).

Parameters
value[in] The value to be applied to the output register set to '1' in this parameter means that the state of this output has to adopt its style according to the value in value.

Reimplemented from IOSubSystem.

◆ writeOutputRegister() [2/2]

void writeOutputRegister ( long value,
long mask )

Alters the state of the digital output register.

This function can be used to alter the state of certain (or all) digital outputs with a single function call. By working with the parameter mask certain bits can remain unaffected.

EXAMPLE

If the previous state of a digital output register was '5', which means that outputs 0 and 2 are set to high a call to mvIMPACT.acquire.IOSubSystem.writeOutputRegister with value set to 2 and mask set to 3 would result in '6' as the new value for the output register. Pin 2 will remain unaffected, as mask states just to modify pin 0 and 1 ( 3 = 00000011 binary ).

Parameters
value[in] The value to be applied to the output register
mask[in] The mask to specify which pins to modify. A bit set to '1' in this parameter means that the state of this output has to adopt its style according to the value in value.

Reimplemented from IOSubSystem.

Member Data Documentation

◆ swigCMemOwn

transient boolean swigCMemOwn
protectedinherited