Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Access ni4882.dll with Qt and MinGW

Solved!
Go to solution

Hi A.R.M:

                Do you creat libgpib.a file vi MarkoSat's method? Could you shere to me. I'm faild to creat the libgpib.a file. I am using pexpors(0.46).

 

 

Thanks.

Mitchell

0 Kudos
Message 11 of 19
(3,614 Views)

I did get it to work after a while, A zip file with all the stuff I used as well as the resulting .a file is attached.  One of my lab mates had trouble with it on a different computer, but switched over to the MSCPP version of Qt and said everything worked right away.  Cheers -A

Message 12 of 19
(3,607 Views)

Hi A.R.M:

               Thank you for sharing.

Mitchell

0 Kudos
Message 13 of 19
(3,604 Views)

Hi A.R.M:

                I try to use the libgpib.a, but something wrong. The fail message shwo as below:

An exception was triggered:

Exception at 0x7c9873be, code: 0xc0000139: DLL entry point not found, flags=0x0.

During startup program exited with code 0xc0000139.

 

below is my code:

 

.pro

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../build-GPIBTest-Desktop_Qt_5_3_MinGW_32bit-Debug/release/ -lgpib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../build-GPIBTest-Desktop_Qt_5_3_MinGW_32bit-Debug/debug/ -lgpib
else:unix: LIBS += -L$$PWD/../build-GPIBTest-Desktop_Qt_5_3_MinGW_32bit-Debug/ -lgpib

INCLUDEPATH += $$PWD/../build-GPIBTest-Desktop_Qt_5_3_MinGW_32bit-Debug/debug
DEPENDPATH += $$PWD/../build-GPIBTest-Desktop_Qt_5_3_MinGW_32bit-Debug/debug

 

.cpp file

int hDev;
if(hDev=ibdev(0,17,0,T10s,1,10)<0)
{
QMessageBox::warning(0,"","Unable to get a vaild description of Power supply");

}
else
{
QMessageBox::warning(0,"","Get a vaild description of Power supply");
}

 

Do you have encountered the same problem?

 

Mitchell

0 Kudos
Message 14 of 19
(3,599 Views)

My project file is below, the important stuff is at the end:

 

QT       += core gui webkit

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport

TARGET = UtilSweep
TEMPLATE = app


SOURCES += main.cpp\
        utilsweep.cpp \
    agilentsweeper.cpp \
    qcustomplot.cpp \
    lockin7265.cpp \
    keithley2k.cpp \
    lockin7270.cpp \
    daqlakeshoremag.cpp \
    utilsweepdata.cpp

HEADERS  += utilsweep.h \
    agilentsweeper.h \
    qcustomplot.h \
    keithley2k.h \
    lockin7265.h \
    lockin7270.h \
    ni488.h \
    NIDAQmx.h \
    daqlakeshoremag.h \
    utilsweepdata.h

FORMS    += utilsweep.ui \
    agilentsweeper.ui

win32: LIBS += -L$$PWD/ -lNIDAQmx
LIBS += $$PWD/libgpib.a

INCLUDEPATH += $$PWD/
DEPENDPATH += $$PWD/

 where there is a copy of the GPIB files in the same directory. You have windows.h included first in the source right?  -A

Message 15 of 19
(3,586 Views)

Hi A.R.M:

               Thanks for your reply. I have success to use the lib. I think that  I put the libgpib.a to the debug folder cuase this problem. I put the libgpib to the same folder then solve this problem. Thanks for your help.

 

Mitchell 

0 Kudos
Message 16 of 19
(3,566 Views)

Hi A.R.M,

 

after a long time, your post and your zip file were still useful for me and I just wanted to say: Thank you!

0 Kudos
Message 17 of 19
(2,518 Views)

Glad to hear it!  Made my morning.  -A

0 Kudos
Message 18 of 19
(2,510 Views)

Hi Marko,

Thanks for step by step description.

I run the commands in CMD. Unfortunately, my generated libgpib.a after running "dlltool -k -D gpib-32.dll -d gpib.def -l libgpib.a" command is 0 kB.

In addition, after running the command "pexports -h ni488.h gpib-32.dll > gpib.def", following error is generated:

'gcc' is not recognized as an internal or external command operable program or batch file.

how can i solve the problems?

thanks a lot.

0 Kudos
Message 19 of 19
(1,997 Views)