VisionBox Interface Library
1.7.11.0 (2024-12-03)
|
|
The factory for devices.
See also Device Factory for a detailed description.
|
bool | CloseDevice (iDevice *pDevice) |
| Closes a device. More...
|
|
bool | GetAPIVersion (Version4Parts &APIVersion) |
| Returns the version of this library. More...
|
|
bool | GetDeviceInfo (DeviceInfo *pDeviceInfoList, unsigned int MaxNumberItems, unsigned int &NumberOfListItems) |
| Returns a list of available devices for this hardware component. More...
|
|
bool | GetFirmwareVersion (Version4Parts &FirmwareVersion, unsigned int Index=0) |
| Returns the firmware version for this hardware component. More...
|
|
bool | GetHardwareType (eHardwareType &HardwareType) |
| Returns the type of the underlying hardware platform for this factory. More...
|
|
bool | GetNumberOfDeviceTypes (unsigned int &NumberOfDeviceTypes) |
| Returns the number of different device types for this hardware component. More...
|
|
bool | GetVersionString (char *pText, unsigned int MaxStringSize) |
| Returns a string with version data from all components. (DLL, driver, FPGA, ...) More...
|
|
bool | IsOpen (eDeviceType Type, int Index, bool &DeviceState) |
| Checks if the device open. More...
|
|
bool | OpenDevice (class CameraLinkIn *&pCameraLinkIn, int Index=0) |
| Opens a CameraLinkIn device and returns the new device object. More...
|
|
bool | OpenDevice (class CameraTrigger *&pCameraTrigger, int Index=0) |
| Opens a CameraTrigger device and returns the new device object. More...
|
|
bool | OpenDevice (class DigitalInput *&pDigitalInput, int Index=0) |
| Opens a DigitalInput device and returns the new device object. More...
|
|
bool | OpenDevice (class DigitalOutput *&pDigitalOutput, int Index=0) |
| Opens a DigitalOutput device and returns the new device object. More...
|
|
bool | OpenDevice (class IOScheduler *&pIOScheduler, int Index=0) |
| Opens a IOScheduler device and returns the new device object. More...
|
|
bool | OpenDevice (class LCD *&pLCD) |
| Opens a LCD device and returns the new device object. More...
|
|
bool | OpenDevice (class Led *&pLed) |
| Opens a Led device and returns the new device object. More...
|
|
bool | OpenDevice (class Multiplexer *&pMultiplexer, int Index=0) |
| Opens a Multiplexer device and returns the new device object. More...
|
|
bool | OpenDevice (class PowerOverEthernet *&pPowerOverEthernet) |
| Opens a PowerOverEthernet device and returns the new device object. More...
|
|
bool | OpenDevice (class Rs232 *&pRs232, int Index=0) |
| Opens a Rs232 device and returns the new device object. More...
|
|
bool | OpenDevice (class Rs422 *&pRs422, int Index=0) |
| Opens a Rs422 device and returns the new device object. More...
|
|
bool | OpenDevice (class Service *&pService) |
| Opens a Service device and returns the new device object. More...
|
|
bool | OpenDevice (class Strobe *&pStrobe, int Index=0) |
| Opens a Strobe device and returns the new device object. More...
|
|
bool | OpenDevice (class TriggerGenerator *&pTriggerGenerator) |
| Opens a TriggerGenerator device and returns the new device object. More...
|
|
bool | OpenDevice (class TriggerOverEthernet *&pTriggerOverEthernet) |
| Opens a TriggerOverEthernet device and returns the new device object. More...
|
|
bool | OpenDevice (eDeviceType Type, int Index, iDevice **ppNewDevice) |
| Opens a device and returns a new device object. More...
|
|
◆ CloseDevice()
bool VIB::VIBSystem::CloseDevice |
( |
iDevice * |
pDevice | ) |
|
Closes a device.
Theoretically it is possible to use another factory to clean up the device as previously used for creation.
- Parameters
-
pDevice | Previously opened device class object |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
◆ CreateInstance() [1/3]
bool VIB::VIBSystem::CreateInstance |
( |
VIBSystem ** |
ppVIBSystem | ) |
|
|
static |
Creates a factory instance for the mainboard.
This function call is identical to CreateInstance(ppVIBSystem
, SYST_BASEBOARD, 0
).
- Parameters
-
ppVIBSystem | Double pointer which contains the pointer to the new VIBSystem instance. |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
◆ CreateInstance() [2/3]
bool VIB::VIBSystem::CreateInstance |
( |
VIBSystem ** |
ppVIBSystem, |
|
|
const eSystemType |
SysType, |
|
|
const unsigned int |
Index |
|
) |
| |
|
static |
Creates a factory instance for the specified hardware component.
See Supported hardware components for a mapping of eSystemType to the actual hardware component for each platform.
- Parameters
-
ppVIBSystem | Double pointer which is used to store the pointer to the new instance |
SysType | Desired system type |
Index | Index for the specified system type, 0 ... (SystemInfo::GetNumberEntities() - 1) |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
char ErrorText[1024] = {0};
{
printf("Error: %s\n", ErrorText);
return -1;
}
◆ CreateInstance() [3/3]
bool VIB::VIBSystem::CreateInstance |
( |
VIBSystem ** |
ppVIBSystem, |
|
|
eHardwareType |
HardwareType, |
|
|
unsigned int |
Index |
|
) |
| |
|
static |
◆ DeleteInstance()
bool VIB::VIBSystem::DeleteInstance |
( |
VIBSystem * |
pObj | ) |
|
|
static |
Releases the device object.
The function deletes only the factory. The call will not fail or block until all open devices are closed.
- Parameters
-
pObj | Pointer to VIBSystem object |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
◆ GetAPIVersion()
Returns the version of this library.
- Parameters
-
APIVersion | Version data (major/minor/patch/build) |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
◆ GetDeviceInfo()
bool VIB::VIBSystem::GetDeviceInfo |
( |
DeviceInfo * |
pDeviceInfoList, |
|
|
unsigned int |
MaxNumberItems, |
|
|
unsigned int & |
NumberOfListItems |
|
) |
| |
Returns a list of available devices for this hardware component.
The function returns an array of DeviceInfo containing all devices for the associated system (hardware component).
- Parameters
-
pDeviceInfoList | Device list |
MaxNumberItems | Maximum number of list items |
NumberOfListItems | Number of returned items |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
unsigned int NumTypes;
goto error;
unsigned int NumberOfListItems;
if ( !pVIBSystem->
GetDeviceInfo(pDeviceList, NumTypes, NumberOfListItems) )
goto error;
for(unsigned int i=0; i<NumberOfListItems; i++)
{
printf("Number of strobe devices: %d\n", pDeviceList[i].GetNumberEntities());
}
◆ GetFirmwareVersion()
bool VIB::VIBSystem::GetFirmwareVersion |
( |
Version4Parts & |
FirmwareVersion, |
|
|
unsigned int |
Index = 0 |
|
) |
| |
Returns the firmware version for this hardware component.
There can be a different number of firmware components for each hardware component. The following table lists the different firmware components:
Platform | Hardware component
(see eHardwareType) | Firmware component
index | Firmware description |
VisionBox AGE-X1 | Mainboard | 0 | FPGA (RTCC) |
VisionBox AGE-X2 | Mainboard | 0 | FPGA (RTCC) |
Smart NIC | 0 | Microcontroller |
Camera Link | 0 | FPGA |
VisionBox AGE-X3 | Mainboard | 0 | FPGA (RTCC) |
1 | Microcontroller |
VisionBox AGE-X4 | Mainboard | not available, only VisionBoards are supported |
VisionBox AGE-X5 | Mainboard | 0 | FPGA (RTCC) |
Smart NIC | 0 | Microcontroller |
Camera Link | 0 | FPGA |
VisionBox LE MANS | Mainboard | 0 | FPGA (RTCC) |
VisionBox DAYTONA | Mainboard | 0 | FPGA (RTCC) |
VisionBoards | Machine Vision Controller | 0 | FPGA (RTCC) |
PCIe Smart NIC board | 0 | Microcontroller |
PCIe Camera Link board | 0 | FPGA |
VisionCam XM | Mainboard | 0 | FPGA (RTCC) |
VisionSensor PV / PV2 | Mainboard | 0 | PRU (programmable real-time unit) |
VisionSensor PV3 | Mainboard | 0 | FPGA |
Machine Vision Manager | Mainboard | 0 | FPGA (RTCC) |
1 | Microcontroller |
- Parameters
-
FirmwareVersion | Firmware version structure |
Index | Index of the firmware component |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
◆ GetHardwareType()
bool VIB::VIBSystem::GetHardwareType |
( |
eHardwareType & |
HardwareType | ) |
|
Returns the type of the underlying hardware platform for this factory.
- Parameters
-
HardwareType | Hardware type |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
◆ GetLastErrorString()
void VIB::VIBSystem::GetLastErrorString |
( |
char & |
pText, |
|
|
unsigned int |
MaxStringSize |
|
) |
| |
|
static |
Returns the last error message.
All library functions return a bool
to indicate the status of a call. In the case of an error, this function returns a readable error description.
See CreateInstance() for an example.
- Parameters
-
pText | Array of char for storing the string |
MaxStringSize | Maximum string length |
◆ GetNumberOfDeviceTypes()
bool VIB::VIBSystem::GetNumberOfDeviceTypes |
( |
unsigned int & |
NumberOfDeviceTypes | ) |
|
Returns the number of different device types for this hardware component.
For example, if the VisionBox has two Strobe units and one RS-422 interface, the function returns a value of 2.
- Parameters
-
NumberOfDeviceTypes | Number of unique device types |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
◆ GetNumberOfSystemTypes()
bool VIB::VIBSystem::GetNumberOfSystemTypes |
( |
unsigned int & |
NumberOfSystemTypes | ) |
|
|
static |
Gets number of different system types.
For example, a VisionBox with two smart network cards returns the value 2, one for the mainboard and one for both NICs.
- Parameters
-
NumberOfSystemTypes | Number of system types |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
◆ GetSystemInfo()
bool VIB::VIBSystem::GetSystemInfo |
( |
SystemInfo * |
pSystemInfoList, |
|
|
unsigned int |
MaxNumberItems, |
|
|
unsigned int & |
NumberOfListItems |
|
) |
| |
|
static |
Returns information about the installed system types.
The function returns an array of SystemInfo objects containing all installed systems or hardware entities. Each item holds information about a different system type.
- Parameters
-
pSystemInfoList | Valid pointer for storing the list |
MaxNumberItems | Maximum number of list items |
NumberOfListItems | Number of valid items returned |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
unsigned int NumTypes;
goto error;
unsigned int NumberOfListItems;
goto error;
for(unsigned int i=0; i<NumberOfListItems; i++)
{
printf("Number of CL-Cards: %d\n", pSystemList[i].GetNumberEntities());
}
◆ GetVersionString()
bool VIB::VIBSystem::GetVersionString |
( |
char * |
pText, |
|
|
unsigned int |
MaxStringSize |
|
) |
| |
Returns a string with version data from all components. (DLL, driver, FPGA, ...)
Do not parse or interpret this string to do any assumption. Use the string only to give the user a human readable overview about the versions. The layout and 'keywords' can be different for each hardware type.
- Parameters
-
pText | String for version data |
MaxStringSize | Maximum size of pText |
- Returns
- Since API version 1.2.x.x the call returns false if the buffer is to short, earlier releases generate a structured exception.
- Example:
char VerText[4096] = "?";
goto error;
printf("\t<== Versions ==>\n%s", VerText);
◆ IsOpen()
bool VIB::VIBSystem::IsOpen |
( |
eDeviceType |
Type, |
|
|
int |
Index, |
|
|
bool & |
DeviceState |
|
) |
| |
Checks if the device open.
The function returns the system wide state of the device. If a program has opened the device the function will return true.
- Note
- This function does not work with VIB::DT_SERVICE.
- Even if the result indicates that the device is closed, it's possible that another thread or process opens the device immediately after the call.
- Parameters
-
Type | Type of device |
Index | Index of device |
DeviceState | Device state, true for open |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
◆ OpenDevice() [1/16]
bool VIB::VIBSystem::OpenDevice |
( |
class CameraLinkIn *& |
pCameraLinkIn, |
|
|
int |
Index = 0 |
|
) |
| |
Opens a CameraLinkIn device and returns the new device object.
- Parameters
-
pCameraLinkIn | Pointer for storing the new device object |
Index | Index of the device on this hardware component |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [2/16]
bool VIB::VIBSystem::OpenDevice |
( |
class CameraTrigger *& |
pCameraTrigger, |
|
|
int |
Index = 0 |
|
) |
| |
Opens a CameraTrigger device and returns the new device object.
- Parameters
-
pCameraTrigger | Pointer for storing the new device object |
Index | Index of the device on this hardware component |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [3/16]
bool VIB::VIBSystem::OpenDevice |
( |
class DigitalInput *& |
pDigitalInput, |
|
|
int |
Index = 0 |
|
) |
| |
Opens a DigitalInput device and returns the new device object.
- Parameters
-
pDigitalInput | Pointer for storing the new device object |
Index | Index of the device on this hardware component |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [4/16]
bool VIB::VIBSystem::OpenDevice |
( |
class DigitalOutput *& |
pDigitalOutput, |
|
|
int |
Index = 0 |
|
) |
| |
Opens a DigitalOutput device and returns the new device object.
- Parameters
-
pDigitalOutput | Pointer for storing the new device object |
Index | Index of the device on this hardware component |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [5/16]
bool VIB::VIBSystem::OpenDevice |
( |
class IOScheduler *& |
pIOScheduler, |
|
|
int |
Index = 0 |
|
) |
| |
Opens a IOScheduler device and returns the new device object.
- Parameters
-
pIOScheduler | Pointer for storing the new device object |
Index | Index of the device on this hardware component |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [6/16]
bool VIB::VIBSystem::OpenDevice |
( |
class LCD *& |
pLCD | ) |
|
Opens a LCD device and returns the new device object.
- Parameters
-
pLCD | Pointer for storing the new device object |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [7/16]
bool VIB::VIBSystem::OpenDevice |
( |
class Led *& |
pLed | ) |
|
Opens a Led device and returns the new device object.
- Parameters
-
pLed | Pointer for storing the new device object |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [8/16]
bool VIB::VIBSystem::OpenDevice |
( |
class Multiplexer *& |
pMultiplexer, |
|
|
int |
Index = 0 |
|
) |
| |
Opens a Multiplexer device and returns the new device object.
- Parameters
-
pMultiplexer | Pointer for storing the new device object |
Index | Index of the device on this hardware component |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [9/16]
◆ OpenDevice() [10/16]
bool VIB::VIBSystem::OpenDevice |
( |
class Rs232 *& |
pRs232, |
|
|
int |
Index = 0 |
|
) |
| |
Opens a Rs232 device and returns the new device object.
- Parameters
-
pRs232 | Pointer for storing the new device object |
Index | Index of the device on this hardware component |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [11/16]
bool VIB::VIBSystem::OpenDevice |
( |
class Rs422 *& |
pRs422, |
|
|
int |
Index = 0 |
|
) |
| |
Opens a Rs422 device and returns the new device object.
- Parameters
-
pRs422 | Pointer for storing the new device object |
Index | Index of the device on this hardware component |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [12/16]
bool VIB::VIBSystem::OpenDevice |
( |
class Service *& |
pService | ) |
|
Opens a Service device and returns the new device object.
- Parameters
-
pService | Pointer for storing the new device object |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [13/16]
bool VIB::VIBSystem::OpenDevice |
( |
class Strobe *& |
pStrobe, |
|
|
int |
Index = 0 |
|
) |
| |
Opens a Strobe device and returns the new device object.
- Parameters
-
pStrobe | Pointer for storing the new device object |
Index | Index of the device on this hardware component |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
◆ OpenDevice() [14/16]
◆ OpenDevice() [15/16]
◆ OpenDevice() [16/16]
Opens a device and returns a new device object.
After this call there is no relationship between the factory and the device instance. Closing the factory will not close the device, it must be closed manually.
Each hardware device can only be opened once at the same time, except for the VIB::Service device. This is ensured for all processes running on the system. A device must be closed before it can be reopened again.
- Parameters
-
Type | Type of the device |
Index | Index of the device on this hardware component, use GetDeviceInfo() to obtain the number of available devices |
ppNewDevice | Double pointer for storing the pointer to the new device object |
- Returns
true
for success, use VIBSystem::GetLastErrorString() for an error description
- Example:
-
static bool GetSystemInfo(SystemInfo *pSystemInfoList, unsigned int MaxNumberItems, unsigned int &NumberOfListItems)
Returns information about the installed system types.
Definition: VIBSystem.cpp:314
@ SYST_BASEBOARD
Definition: VIB_Interface.h:112
This class represents the Camera Link grabber module.
Definition: VIB_Interface.h:968
static bool CreateInstance(VIBSystem **ppVIBSystem)
Creates a factory instance for the mainboard.
Definition: VIBSystem.cpp:105
This class controls the I/O Scheduler which can store and emit output signals in hard real-time.
Definition: VIB_Interface.h:829
bool CloseDevice(iDevice *pDevice)
Closes a device.
Definition: VIBSystem.cpp:856
This class controls the digital camera trigger output.
Definition: VIB_Interface.h:629
bool GetDeviceInfo(DeviceInfo *pDeviceInfoList, unsigned int MaxNumberItems, unsigned int &NumberOfListItems)
Returns a list of available devices for this hardware component.
Definition: VIBSystem.cpp:399
bool GetVersionString(char *pText, unsigned int MaxStringSize)
Returns a string with version data from all components. (DLL, driver, FPGA, ...)
Definition: VIBSystem.cpp:937
This class represents the TriggerOverEthernet (ToE) module which allows the generation of GigE Action...
Definition: VIB_Interface.h:1090
This class contains functions associated with the hardware component (serial number,...
Definition: VIB_Interface.h:577
This class allows sending and receiving data over a serial port.
Definition: VIB_Interface.h:1178
This class controls a group of digital output signals.
Definition: VIB_Interface.h:467
This class stores information about a specific device type
Definition: VIB_Interface.h:129
static bool GetNumberOfSystemTypes(unsigned int &NumberOfSystemTypes)
Gets number of different system types.
Definition: VIBSystem.cpp:270
@ HWT_AGEX5_POETOE
Quad Ethernet Smart NIC with PoE/ToE for the VisionBox AGE-X5
Definition: VIB_Interface.h:71
This class controls the FPGA Trigger Unit.
Definition: VIB_Interface.h:716
The interface for all device implementations
Definition: VIB_Interface.h:180
bool GetNumberOfDeviceTypes(unsigned int &NumberOfDeviceTypes)
Returns the number of different device types for this hardware component.
Definition: VIBSystem.cpp:357
@ SYST_CL
Definition: VIB_Interface.h:113
This class controls the Multiplexer unit which connects signal sources and sinks with each other.
Definition: VIB_Interface.h:739
This class represents the PowerOverEthernet (PoE) module, which allows gathering information about th...
Definition: VIB_Interface.h:1137
bool OpenDevice(eDeviceType Type, int Index, iDevice **ppNewDevice)
Opens a device and returns a new device object.
Definition: VIBSystem.cpp:455
This class controls the RS-422 interface.
Definition: VIB_Interface.h:520
This class stores information about a specific system type
Definition: VIB_Interface.h:153
@ DT_STROBE
LED Strobe Controller → VIB::Strobe.
Definition: VIB_Interface.h:86
This class controls the status display of the Machine Vision Controller.
Definition: VIB_Interface.h:1202
This class controls the LED Strobe Controller.
Definition: VIB_Interface.h:291
The factory for devices.
Definition: VIB_Interface.h:219
This class controls the status LEDs.
Definition: VIB_Interface.h:397
static void GetLastErrorString(char &pText, unsigned int MaxStringSize)
Returns the last error message.
Definition: VIBSystem.cpp:233