VisionBox Interface Library
Loading...
Searching...
No Matches
Inheritance diagram for VIB::Service:

Detailed Description

This class contains functions associated with the hardware component (serial number, system temperature, watchdog, firmware updates).

The behavior of this class is different in comparison to other device classes, because it can be opened more than once the same time. Note that the library functions are thread safe but not process safe.

The following table lists the supported features for different hardware components:

PlatformHardware component
(see eHardwareType)
Generic system type
eSystemType
Supported features
Serial Number[1]Temperature StatusFan Status and ControlWatchdogFirmware Update
VisionBox AGE-X1MainboardSYST_BASEBOARDAGEX-yymm-0xxxxxyesyes (control)yesyes
VisionBox AGE-X2MainboardSYST_BASEBOARDAGEX-yymm-1xxxxxyesnoyesyes
Smart NICSYST_NETWORKNIC0-yymm-xxxxxxnononoyes
Camera LinkSYST_CLCL00-yymm-xxxxxxnononoyes
VisionBox AGE-X3I/O boardSYST_BASEBOARDAGEX-yymm-2xxxxxnonoyesyes
VisionBox AGE-X4[2]MainboardSYST_BASEBOARDAGEX-yymm-3xxxxxyesyes (status)yesno
VisionBox AGE-X5MainboardSYST_BASEBOARDAGEX-yymm-4xxxxxyesnoyesyes
Smart NICSYST_NETWORKnonononoyes
Camera LinkSYST_CLnonononoyes
VisionBox AGE-X6MainboardSYST_BASEBOARDAGEX-yymm-5xxxxxnonoyesyes
Smart NICSYST_NETWORKnonononoyes
Camera LinkSYST_CLnonononoyes
VisionBox LE MANS[2]MainboardSYST_BASEBOARDLMNS-yymm-xxxxxxyesnoyesyes
VisionBox DAYTONAMainboardSYST_BASEBOARDDTNA-yymm-xxxxxxyesnoyesyes
VisionBox AIMainboardSYST_BASEBOARDVBAI-yymm-0xxxxxyesnoyesyes
VisionBox AI BasicMainboardSYST_BASEBOARDVBAI-yymm-1xxxxxyesnonono
VisionBoardsMachine Vision ControllerSYST_INTERNAL_PCIMVC0-yymm-xxxxxxnononoyes
PCIe Smart NIC boardSYST_NETWORKNIC1-yymm-xxxxxxnononoyes
PCIe Camera Link boardSYST_CLCL01-yymm-xxxxxxnononoyes
VisionCam XMMainboardSYST_BASEBOARDVCXM-yymm-0xxxxxyesnoyesno
VisionCam XM2MainboardSYST_BASEBOARDVCXM-yymm-1xxxxxyesnoyesno
VisionSensor PV / PV2MainboardSYST_BASEBOARDVSPV-yymm-0xxxxxyesnonono
VisionSensor PV3MainboardSYST_BASEBOARDVSPV-yymm-1xxxxxyesnoyes[3]no
Machine Vision ManagerUSB deviceSYST_EXTERNAL_USBMVM0-yymm-xxxxxxnonoyes[4]yes
Machine Vision Manager 2USB deviceSYST_EXTERNAL_USBMVM2-yymm-xxxxxxnonoyes[4]yes

  1. Serial number format:
    yymm: place holder for production year and month
    xxxxxx: place holder for a serial number
    The dash not actually part of the serial number, but often printed for better readability.
  2. The VisionBox AGE-X4 and the VisionBox LE MANS can also use the VisionBoards.
  3. VisionSensor PV3: requires I/O Expansion and only SERVICE_WDT_RESET_TYPE_MULTIPLEXER is supported.
  4. Machine Vision Manager: requires firmware ≥ 1.0.0.69 and only SERVICE_WDT_RESET_TYPE_MULTIPLEXER is supported.

Serial Number

The function GetSerialNumber() returns the serial number for the associated hardware component.

The serial number consists of a null-terminated string. The string format is listed in the table above for the different hardware entities.

Example code
VIB::VIBSystem *pVIBSystem = NULL;
VIB::Service *pService = NULL;
// create a factory instance for the mainboard
pVIBSystem->OpenDevice(VIB::DT_SERVICE, 0, (VIB::iDevice**)(&pService));
// read the serial number
char serialnumber[32];
pService->GetSerialNumber(serialnumber);
printf("Serial number: '%s'\n", serialnumber);
// Close the device and the factory
pVIBSystem->CloseDevice(pService);
VIB::VIBSystem::DeleteInstance(pVIBSystem);
This class contains functions associated with the hardware component (serial number,...
Definition VIB_Interface.h:583
bool GetSerialNumber(char pSerialnumber[32])
Returns the serial number for the hardware component.
Definition Service.cpp:536
The factory for devices.
Definition VIB_Interface.h:223
static bool CreateInstance(VIBSystem **ppVIBSystem)
Creates a factory instance for the mainboard.
Definition VIBSystem.cpp:105
All relevant classes and functions are residing in this namespace.
Definition VIB_Documentation_Main.txt:2
@ SYST_BASEBOARD
Definition VIB_Interface.h:116
@ DT_SERVICE
Hardware service module → VIB::Service.
Definition VIB_Interface.h:96
Please note that error checking was removed to keep the code simple.

Temperature Status

The temperature of the mainboard can be read with GetSystemTemperature().

Example code
VIB::Service service;
float temperature;
service.Open();
service.GetSystemTemperature(temperature);
printf("Temperature: %.1f °C\n", temperature);
bool GetSystemTemperature(float &fTemperature)
Returns system temperature.
Definition Service.cpp:482
bool Open(unsigned int Index=0)
Opens a device.
Definition iDevice.cpp:109
Please note that error checking was removed to keep the code simple.

Fan Status and Control

Depending on the hardware configuration, the VisionBox AGE-X1 and AGE-X4 can have one or more fans installed.

The VisionBox AGE-X4 supports reading the number of fan channels with GetFanNumberOfChannels() and reading the fan speed with GetFanSpeed().

The VisionBox AGE-X1 supports adjustment of the target temperature for the fan regulation circuit by SetFanTargetTemperature().

Watchdog

The Watchdog can be used to reset the system if the function WatchdogService() is not called within a time period specified by WatchdogSetup().

Example code
VIB::Service service;
// create a factory instance for the mainboard
service.Open(0);
// enable Watchdog with a timeout of 3 seconds
service.WatchdogSetup(true, 3000);
// reset Watchdog timer in the main loop
while (progIsRunning)
{
service.WatchdogService();
// do something else
}
// disable the Watchdog
service.WatchdogSetup(false, 3000);
bool WatchdogSetup(bool boEnable, unsigned int msTimeout)
Configures the FPGA watchdog.
Definition Service.cpp:568
bool WatchdogService()
Sends a signal to the FPGA which resets the watchdog timer.
Definition Service.cpp:612
Please note that error checking was removed to keep the code simple.

Starting with firmware version ≥ 1.0.0.37, the Watchdog can alternatively be used to reset only the Multiplexer to the default state (all output lines off), see SERVICE_WDT_RESET_TYPE. The function WatchdogHasFired() can then be used to check the state of the watchdog.

Firmware Update

Firmware updates are normally provided by IMAGO as separate packages which can be executed on the system. The function FirmwareUpdate() can alternatively be used to update the firmware within the user application.

This function is not supported by the following platforms. The firmware is provided as Debian packages instead:

  • VisionCam XM
  • VisionSensor PV (1/2/3)
  • VisionBox DAYTONA
Note
  • A system may contain multiple hardware components which have to be updated separately.
  • Using the incorrect firmware file can lead to inoperative hardware. Contact IMAGO for choosing the right files.
  • The update process can take up to one minute. Don't interrupt the process.
  • After success, the power supply for most systems must be reapplied before the new firmware is used.

Public Types

enum  SERVICE_WDT_RESET_TYPE
 Configures the reset behavior of the watchdog, used by WatchdogSetup(). More...

Public Member Functions

bool FirmwareUpdate (const unsigned char *pFirmwareData, const size_t FileSize)
 Executes an update of the firmware for the hardware entity.
bool GetFanNumberOfChannels (unsigned int &NumberOfChannels)
 Returns the number of possible fan channels.
bool GetFanSpeed (const unsigned int ChannelIndex, unsigned int &RPM)
 Return the current fan speed for the given index.
bool GetSerialNumber (char pSerialnumber[32])
 Returns the serial number for the hardware component.
bool GetSystemTemperature (float &fTemperature)
 Returns system temperature.
bool Reset ()
 Resets the device to default settings.
 Service ()
 Default constructor for the device object.
bool SetFanTargetTemperature (unsigned int Temperature)
 Sets the target temperature of the fan regulation.
bool WatchdogHasFired (bool &HasFired)
 Returns the state of the Watchdog.
bool WatchdogService ()
 Sends a signal to the FPGA which resets the watchdog timer.
bool WatchdogSetup (bool boEnable, unsigned int msTimeout)
 Configures the FPGA watchdog.
bool WatchdogSetup (bool boEnable, unsigned int msTimeout, SERVICE_WDT_RESET_TYPE ResetType)
 Configures the watchdog and the reset behavior.
Public Member Functions inherited from VIB::iDevice
bool Close ()
 Closes a device.
 iDevice (const iDevice &device)
 The copy constructor makes a copy of the existing device object.
bool isOpen (bool &state)
 Returns the open state of a device object.
bool Open (unsigned int Index=0)
 Opens a device.
iDeviceoperator= (const iDevice &device)
 The assignment operator makes a copy of the existing device object.
virtual ~iDevice ()
 Deletes the device object.

Member Enumeration Documentation

◆ SERVICE_WDT_RESET_TYPE

Configures the reset behavior of the watchdog, used by WatchdogSetup().

Enumerator
SERVICE_WDT_RESET_TYPE_REBOOT 

Cold reset of the system using a hardware reset signal.

SERVICE_WDT_RESET_TYPE_MULTIPLEXER 

The output signals of the Multiplexer are reset to the default state.

Constructor & Destructor Documentation

◆ Service()

VIB::Service::Service ( )

Default constructor for the device object.

The device must be opened with Open() before it can be used.

Member Function Documentation

◆ FirmwareUpdate()

bool VIB::Service::FirmwareUpdate ( const unsigned char * pFirmwareData,
const size_t FileSize )

Executes an update of the firmware for the hardware entity.

This function can be used to update the firmware within the user application.

Parameters
pFirmwareDataPointer to buffer holding the firmware data
FileSizeNumber of valid bytes in the buffer
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ GetFanNumberOfChannels()

bool VIB::Service::GetFanNumberOfChannels ( unsigned int & NumberOfChannels)

Returns the number of possible fan channels.

The number of installed fans can be lower.

Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ GetFanSpeed()

bool VIB::Service::GetFanSpeed ( const unsigned int ChannelIndex,
unsigned int & RPM )

Return the current fan speed for the given index.

Parameters
ChannelIndexFan index, 0 ... (GetFanNumberOfChannels() - 1)
RPMCurrent speed in RPM
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ GetSerialNumber()

bool VIB::Service::GetSerialNumber ( char pSerialnumber[32])

Returns the serial number for the hardware component.

The function will return a null-terminated string like "AGEX1109000012". See section Serial Number for a detailed description and example code.

Parameters
pSerialnumberValid string pointer for storing the serial number
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ GetSystemTemperature()

bool VIB::Service::GetSystemTemperature ( float & fTemperature)

Returns system temperature.

Parameters
fTemperatureTemperature in °C
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ Reset()

bool VIB::Service::Reset ( )

Resets the device to default settings.

  • The Watchdog is disabled
  • VisionBox AGE-X1: the fan target temperature is set to 45 °C
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ SetFanTargetTemperature()

bool VIB::Service::SetFanTargetTemperature ( unsigned int Temperature)

Sets the target temperature of the fan regulation.

Remember, a higher system temperature will reduce the noise but also reduces the life-time and decreases the ability for the CPU to use clock speeds above the base frequency.

Parameters
TemperatureTarget temperature in °C, 0 ... 50
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ WatchdogHasFired()

bool VIB::Service::WatchdogHasFired ( bool & HasFired)

Returns the state of the Watchdog.

The function returns true if the watchdog timeout has expired. A reboot or any call to WatchdogSetup() resets the state.

Parameters
HasFiredWatchdog state
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ WatchdogService()

bool VIB::Service::WatchdogService ( )

Sends a signal to the FPGA which resets the watchdog timer.

Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ WatchdogSetup() [1/2]

bool VIB::Service::WatchdogSetup ( bool boEnable,
unsigned int msTimeout )

Configures the FPGA watchdog.

If the watchdog is enabled the program has to call WatchdogService() within the specified timeout period. If the timeout expires, a hardware system reset is triggered.

This function call is identical to WatchdogSetup(boEnable, msTimeout, SERVICE_WDT_RESET_TYPE_REBOOT).

The watchdog will not be disabled when the Service device is closed.

Parameters
boEnableEnable or disables the watchdog timer
msTimeoutWatchdog timeout in milliseconds (max. 40000)
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ WatchdogSetup() [2/2]

bool VIB::Service::WatchdogSetup ( bool boEnable,
unsigned int msTimeout,
SERVICE_WDT_RESET_TYPE ResetType )

Configures the watchdog and the reset behavior.

This function is identical to the WatchdogSetup() except, that the reset type can be specified after the timeout expires.

Parameters
boEnableEnable or disables the watchdog timer
msTimeoutWatchdog timeout in milliseconds (max. 40000)
ResetTypeReset behavior
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description