VisionBox .NET Library  1.7.10.0 (2024-04-16)
Devices

Detailed Description

Device classes are used to provide acess to the actual components of a system.

All device classes inherit the interface iDevice. Each device class has its own set of methods for accessing the device specific functions. See Classes section below for all supported device classes.

Each device instance is associated with a physical component or functional unit. These devices are provided by different hardware entities like the mainboard or extension cards. See Hardware support for an overview of the supported devices for the different hardware platforms.

Each hardware entity can provide multiple devices of the same type and each device can have multiple channels. For example:
A VisionBox mainboard with two digital I/O modules provides two DigitalInput and two DigitalOutput devices. Each device may provide eight input and output signals.

Note
  • After a device is closed, the RTCC / FPGA logic remains operating in the last state for most devices. For example, the existing Multiplexer connections stay active until reboot, or until the Multiplexer gets reconfigured. Exception: the Strobe and IOScheduler devices will be deactivated after the device is closed.
  • Many devices can be reset explicitly by calling the Reset() method.
  • If a USB device is unplugged, all device indexes remain constant and unique, until all programs have stopped using the library. Therefore, it is possible that a gap is created when a device with a lower number is unplugged.

Opening and closing devices

Device objects for a specific hardware component can be opened only once at a time, except for the Service device. This is guaranteed across all processes on the system.

There are two ways to open and close device objects:

Note
Mixing the device's Open() / Close() API with the factory's VIBSystem API is not allowed for the same device object.

Open devices using the Open() method

After a device object is created with the default constructor, the member function Open() has to be called before the device can be used. The Index parameter specifies the component for the given device type across all hardware entities.

The device can be closed with the function Close().

C# Example:

// Create the device object (not opened yet)
// Open the second DigitaInput device on the system
digitalInput.Open(1);
// Use the device specific methods
digitalInput.ConfigureDebounceTime(1000, 1000);
// Close the device
digitalInput.Close();
Note
The device will not be closed automatically by the object's finalizer, because the Garbage Collector is not deterministic.
Instead, all devices implement the IDisposable interface which inherits the Dispose() method for closing the device.

In C# and Visual Basic, the using statement can be used to dispose the object automatically. This will also close the device.

C# Example:

using (VIB_NET.DigitalInput digitalInput = new VIB_NET.DigitalInput())
{
// Open the second DigitaInput device on the system
digitalInput.Open(1);
// Use the device specific methods
digitalInput.ConfigureDebounceTime(1000, 1000);
} // The device gets closed here

The hardware entities are enumerated in the following order for determining the Index parameter with Open():

For example, consider a VisionBox with one digital I/O module provided by the mainboard and two digital I/O modules provided by the Machine Vision Controller. The Index parameter for DigitalInput::Open() corresponds to the following components:

Open devices using the VIBSystem factory

See page Device Factory for a detailed description.

Classes

class  VIB_NET::CameraLinkIn
 This class represents the Camera Link grabber module. More...
 
class  VIB_NET::CameraTrigger
 This class controls the digital camera trigger output. More...
 
class  VIB_NET::DigitalInput
 This class represents a group of optically coupled input signals. More...
 
class  VIB_NET::DigitalOutput
 This class controls the optically isolated output signals. More...
 
class  VIB_NET::IOScheduler
 This class controls the I/O Scheduler which allows to store and emit output signals in hard real-time. More...
 
class  VIB_NET::LCD
 This class controls the status display of the Machine Vision Controller. More...
 
class  VIB_NET::Led
 This class controls the status LEDs. More...
 
class  VIB_NET::Multiplexer
 This class controls the Multiplexer unit which connects signal sources and sinks with each other. More...
 
class  VIB_NET::PowerOverEthernet
 This class represents the PowerOverEthernet (PoE) module, which allows gathering information about the current state of attached PoE devices. More...
 
class  VIB_NET::RS232
 This class represents the RS232 which allows sending and receiving data over a RS232 port. More...
 
class  VIB_NET::RS422
 This class controls the RS-422 interface. More...
 
class  VIB_NET::Service
 This class contains functions associated with the hardware component or the whole system More...
 
class  VIB_NET::Strobe
 This class represents the LED Strobe Controller. More...
 
class  VIB_NET::TriggerGenerator
 This module controls the FPGA Trigger Unit. More...
 
class  VIB_NET::TriggerOverEthernet
 This class represents the TriggerOverEthernet (ToE) module which allows the generation of GigE Action Commands. More...
 
VIB_NET::DigitalInput
This class represents a group of optically coupled input signals.
Definition: VIB_NET.h:1164
VIB_NET
All relevant classes and functions are residing in this namespace.
Definition: CameraLinkIn.cpp:6
VIB_NET::iDevice::Open
void Open(unsigned int Index)
Opens a device
Definition: iDevice.cpp:39