VisionBox Interface Library
1.7.10.0 (2024-04-16)
|
|
Linux SDK location: /opt/ImagoTechnologies/SDK/examples/FirstTest_Linux/src/FirstTest
.cpp
Windows SDK location: <SDK installation folder>\examples\C++\FirstTest\FirstTest.cpp
3 #define usleep(us) Sleep(us / 1000)
18 void TestRes(
bool result)
29 throw std::runtime_error(ErrText);
48 std::vector<char>pstText(4096);
50 printf(
"Version numbers ==>\n%s\n", &pstText[0]);
60 char serialnumber[32];
62 printf(
"\nSerial number: '%s'\n", serialnumber);
68 if (digitalOutput.
Open(0))
70 printf(
"\nFound Digital Output device\n");
74 printf(
" Setting output signals...\n");
77 TestRes(digitalOutput.
Set(0xffff));
80 unsigned int outputSignals;
82 for (
unsigned int signal = 0; signal < outputSignals; signal++)
85 TestRes(digitalOutput.
SetBit(signal,
false));
94 catch (std::runtime_error &err)
96 printf(
"\n==============================================\n");
97 printf(
"Error:\n %s\n", err.what());
98 printf(
"\n==============================================\n");
102 printf(
"\n==============================================\n");
103 printf(
"Error: ???\n");
104 printf(
"\n==============================================\n");
109 if (pVIBSystem != NULL)
111 printf(
"\nClosing devices...\n");
113 if (pService != NULL)
120 printf(
"\nPress ENTER to exit.\n");
bool Set(unsigned int Val)
Sets the state of the digital output signals.
Definition: DigitalOutput.cpp:122
static bool CreateInstance(VIBSystem **ppVIBSystem)
Creates a factory instance for the mainboard.
Definition: VIBSystem.cpp:105
bool CloseDevice(iDevice *pDevice)
Closes a device.
Definition: VIBSystem.cpp:856
bool GetNumberOfOutputs(unsigned int &NumberOfOutputs)
Returns number of output channels.
Definition: DigitalOutput.cpp:93
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 contains functions associated with the hardware component (serial number,...
Definition: VIB_Interface.h:579
This class controls a group of digital output signals.
Definition: VIB_Interface.h:467
static bool DeleteInstance(VIBSystem *pObj)
Releases the device object.
Definition: VIBSystem.cpp:199
Header file for this library.
bool GetSerialNumber(char pSerialnumber[32])
Returns the serial number for the hardware component.
Definition: Service.cpp:497
bool OpenDevice(eDeviceType Type, int Index, iDevice **ppNewDevice)
Opens a device and returns a new device object.
Definition: VIBSystem.cpp:455
bool SetBit(unsigned int BitIndex, bool OnOff)
Sets the state of the specified digital output.
Definition: DigitalOutput.cpp:135
The factory for devices.
Definition: VIB_Interface.h:219
bool Open(unsigned int Index=0)
Opens a device
Definition: iDevice.cpp:109
static void GetLastErrorString(char &pText, unsigned int MaxStringSize)
Returns the last error message.
Definition: VIBSystem.cpp:233