-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (24 loc) · 747 Bytes
/
main.cpp
File metadata and controls
28 lines (24 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "mainwindow.h"
#include <QApplication>
#include <iostream>
#include <LabJackM.h>
int main(int argc, char *argv[])
{
int error, handle;
error = LJM_OpenS("T7", "USB", "-2", &handle);
if (error) {
char errorStr[LJM_MAX_NAME_SIZE];
LJM_ErrorToString(error, errorStr);
std::cerr << "Error connecting to DAQ device: " << errorStr << std::endl;
} else {
int deviceType,
connectionType,
serialNumber;
LJM_GetHandleInfo(handle, &deviceType, &connectionType, &serialNumber, nullptr, nullptr, nullptr);
std::cout << "Connected to DAQ device: " << deviceType << " : " << serialNumber << std::endl;
}
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}