Access ni4882.dll with Qt and MinGW

I have to control some electrical loads and power supplies by GPIB. We use Qt 4.7.4 with MinGW 4.4 (32-bit) on Windows 7 64 bit.

The drivers package GPIB-NI-488. 2 package 3.0.2 for Windows 7 64 bit is installed. GPIB Troubleshooting Utility tool displays "pass" and the application of the Measurement & Automation can connect to it and talk to an intrument. So far so good.

Now, I want to write an application can use the NI4882.dll (3.0.0.49153). Unfortunately, there are just objects for compilers files Microsoft and Borland and no lib file.

Therefore, generate us a def of the ni4882.dll file with:

pexports ni4882.h ni4882.dll h > ni4882.def

-ni4882.def-

LIBRARY NI4882.dll
EXPORTS
? compareVersion@nGPIBAPI_NI4882@@YGXABVtSSVersion@@0AAJPBD@Z
? getCurrentVersion@nGPIBAPI_NI4882@@YG? AVtSSVersion@@AAJ@Z
? getOldestCompatibleVersion@nGPIBAPI_NI4882@@YG? AVtSSVersion@@AAJ@Z
AllSpoll@12
DevClear@8
DevClearList@8
...

--

Then generate the lib with:

dlltool k d ni4882.dll d ni4882.def-l libni4882.a

Now, I build a small test QT program.

-.pro file-

INCLUDEPATH += $$ PWD/include

LIBS += $$PWD/lib/libni4882.a

--

-.cpp file-

#include "ni4882.h".

...

Sub MainWindow::Init()

{

int DD = idev (0,3,0,T10s,1,0);

If (Ibsta () & Err)

{

Err (tr ("Unable to open board:ibdev=%1").arg(dd)); "))

}

If (ibonl (0,0) & ERR)

{

Err (tr ("could not close the Council"));

}

}

void MainWindow::Err (QString message)

{

Switch (Iberr ())

{

case 0:

{

message. Append ("(EDVR-erreur système)" ");

} break;

...

}

qDebug ("Error: %s\nibsta = 0 x %x iberr = %d\n",)

(unsigned int) Ibsta(), (int) Iberr ());

}

--

The source code will be compiled and linked without error.

But if I run, the output is:

Error: Could not open the Board of Directors: ibdev = 32768 (EDVR - system error)

ibsta = iberr 0x8000 = 0

Error: Cannot close the Board of Directors (EDVR - system error)

ibsta = iberr 0x8000 = 0

So the question is: what is the problem? Why am I still getting this error EDVR. I also tried SendIFC (0) with the same result.

With interactive control GPIB tool, I can communicate with my instrument and the Trace of e/s OR it connects. But I don't see the papers in my request tracking tool. Is this an indication?

Any ideas?

Marko

Hi all,

After a few questions about the use of the GPIB with Qt library, I wrote a description step by step to create objects for MinGW files:

1 create a folder and copy the "gpib - 32.dll' of the"C:\Windows\System32"("C:\Windows\SysWOW64"in Win7) in this folder.

2. copy "ni488.h" to "c:\Program Files (x 86) \National Instruments\Shared\ExternalCompilerSupport\C\include\. (Not ni4882.h!)

3. load PExports (my version is 0.44) and put the exe in your folder. I don't have a URL to load this tool but should be easy to find. It is freeware.

4. copy "c:\QtSDK\mingw\bin\" dlltool.exe in your folder.

5. create a batch file '1 - build def file.bat' with the content: "pexports ni488.h gpib - 32.dll h > gpib.def.

6. create a batch file "2 - build file.bat lib" with the content: "dlltool k d gpib - 32.dll - d gpib.def-l libgpib.a.

7. run the batch file "1 - def file.bat build" to create the file 'gpib.def' def

8. start the batch file "2 - build file.bat lib" to create the file in the library 'libgpib.a '.

9 copy 'gpib - 32.dll' and 'libgpib.a' in your software project. I created the 'lib' subdirectory and copied the files to.

10. copy "ni488.h" into your software project. I created the "include" subfolder and copied the file in.

11. in your PRO file type:

# #####################################################################
# Include the NI 488 library. 2
# #####################################################################
INCLUDEPATH += $$ PWD/include
HEADERS += include/ni488.h

LIBS += $$PWD/lib/libgpib.a

12. in your type of source code:

#include "windows.h".
#include "ni488.h".

bool InitializeGPIBBoard)

{

bool isStarting = false;

boardID int;        / * id board @brief. */
QString boardName;  / * @brief Committee name. */
int boardDescr;     / * descriptor of Council @brief. */

Get ID Board
SendIFC (boardID);

If (ThreadIbsta() & ERR)
{
ErrorHandling (tr ("failed to open the Council"));

Return isStarting;
}

Open and initialize a Board or a configured by the user device descriptor
wchar_t * aName = new wchar_t [boardName.size () + 1];
m_para.boardName.toWCharArray (Anom);
aName [boardName.size ()] = 0;
m_para.boardDescr = ibfind (Anom);
delete [aName];

The Board of Directors is the system controller.
If (ibconfig (boardDescr, IbcSC, 1) & ERR)
{
ErrorHandling (tr ("failed to create the system controller board"));

Return isStarting;
}

Affirm the clear interface.
If (ibsic (boardDescr) & ERR)
{
ErrorHandling (tr ("Assert clear interface"));

Return isStarting;
}

ASO.

isStarted = true;

return isStarted.

}

13 be happy! :-)

I hope this helps. If you have any problems, please write me a message or post on this thread of Council.

Gruss und viel Erfolg!
Marko

Tags: NI Hardware

Similar Questions

  • Access a dll with a table as argument in Teststand

    Hello

    I did a dll with the following function call:

    __stdcall __declspec (dllexport) int FSCOM_ModbusQuery (int nComport, ucAddress unsigned char, unsigned char ucFunctionCode, unsigned char ucTxData [], int nTxDataLength, unsigned char ucRxData [], int nRxDataLength)

    I want to access this function call in Teststand 2010 SP1. I did table 2 in Teststand and gave addresses to the function call (as you can see in 'Capture.png' and 'Capture1.png').

    When I try to run the sequence I get an error on the ucTxData and the ucRxData with the message "number expected, found the table of numbers.

    How can I solve this problem

    Thanks in advance

    Wissam

    I think you have misunderstood what I wanted. In the specification of the Panel Module tab, you can change the type of data that the function expects. You probably set on the wrong thing. It must be set to an array of numbers where the elements are unsigned 8-bit integers.

    -Doug

  • I can't enter in gmail. Error "page is not redirecting properly" is displayed. I can access gmail on my phone and with IE, but not firefox.

    I tried to clear the cache and delete cookies from gmail, but none worked. I can access gmail from my phone and through IE but not firefox. I also use the gmail gadget to my igoogle page and it does not work either.

    Tried all that precedes, and nothing has worked. I don't think it would be though, it is a new installation of windows 7 with very little installed. I wasn't expecting to find any virus/malware. The only thing found was an adware but removing those does not solve the problem.

    Edit: Uninstall and reinstall firefox did not work either.
    Edit2: I initially deleted all cookies associated with google and it does not work. I went back and remove all cookies, and it works now. Sorry I don't know what cookie was the cause of the problem.

  • How to access the BIOS on a Pavilion Elite e9237c with mouse and keyboard wireless?

    I have a desktop computer Pavilion Elite e9237 with a wireless keyboard and mouse. I tried to access the BIOS by pressing F10 at startup with no luck, and I can't access any of the other menus for the start-up eiither. I don't have a PS/2 port on my computer, so I can't get a wired keyboard and mouse. Does anyone know how to access the BIOS with this configuration?

    I bought a USB keyboard and he answered in the same way... No bios access. I then studied why it did not work and discovered that it was the way in which he has been connected to the computer. I had initially plugged into a USB hub when he was not working and I moved it directly into a USB port and it works! I plugged my keyboard wireless directly into the USB port and it works too! Thanks for your help... I wouldn't have thought of it if it wasn't for to recommend you the USB keyboard.

  • How to call dll com APIs that range from the performance counters of less than 1 ms with CVI and always get less timer resolution of 1 ms

    Hello

    I've created a dll com in VC ++ using performance counters/timers to less than a millisecond.

    This is useful when you send a message to very high speed. (say 10 or more)

    This is done by the dll.

    When I use CVI to create a user interface, this dll runs at a fixed rate of 1ms.

    This slows down the application.

    I tried to use the same dll with VC ++ host and it works well.

    I need to check the registry setting to see if the useDefaultTimer is set to false or TRUE.

    (I'm not near the development PC) However, by default, it should be FALSE and I have no fidle with it.

    Veuileez post any suggestions you might have.

    Thank you!

    This problem is now solved for me.

    Just the highest thread priority in the dll.

    Thank you if you had the answer.

  • Just as a reference: how to FIX the annoying 'White Screen Of Death"with Silverlight and"Access denied"error with computer management.

    Well, I just hope that someone who has met these two mistakes will find my dose. It might save a lot of pointless research on the net.

    SYMPTOMS:
    -When you try to open a Silverlight application in your browser (Firefox, Chrome, IE, etc), your browser displays only a white area. When you right click on the white area, you can click on the Silverlight properties.
    -If you try to start "Computer management" by clicking on the 'My Computer' icon and select 'Manage', you get the following error: 'access denied '.

    CAUSE:
    The following errors are usually the result of a bad environment variable. In this case the "windir" environment variable does not work correctly. You can try running the management of the computer to start > run and entering:
    %windir%\system32\mmc.exe/s %windir%\system32\compmgmt.msc

    Notice the between the characters of percentage windir environment variable. If you run the above code, you will probably get an error saying that MMC cannot open the file. Look closely at the path, it's back!
    You will probably find any % somewhere.

    What actually happened here is the variable windir made reference to another variable: systemroot
    Why this creates problems, I'm not sure. Also, I don't understand what made then variable windir change.

    SOLUTION:
    -From your desktop or Explorer: right-click on "My computer" and select "Properties".
    -Click on the "Advanced" tab and then click "Environment Variables".

    http://pcauthorities.com/images/advanced-system-properties-XP.jpg

    -Did the windir variable. Together to "C:\Windows" do not think that it is already set to "C:\Windows", because windows then tells you. Double-click it to know for sure.

    http://www.adminxp.com/windowsvista/envvariabl.PNG

    -See, I told you! Change this to "C:\Windows".

    http://www.adminxp.com/windowsvista/editenvvar.PNG

    Hi Jooch,
     
    Thanks for posting such a detailed response, including symptoms, Cause, and resolution to "White Screen Of Death" with Silverlight and "Access denied" error with computer management"issues.
     
    I appreciate your time and effort to do the same. This could help other users of the forum as well.
  • I have a problem of access to the Outlook account and other pages because appears "certificate error" what's happened with these certificates?

    I have a problem of access to the Outlook account and other pages because appears "certificate error" what's happened with these certificates? Help please.

    There are two main reasons for the mistakes of certificate:

    1. Your computer's time is not set correctly.  Check your time year/month/day/hour/minute/timezone/light of day.  Right-click on the clock in your taskbar and select "set Date/time" and make sure you are ready approximately 5 minutes of real time (don't forget time zone and DST).
    2. The second reason is that Windows XP is not very good for updating root certificates.  Go to the following site:
         <>http://support.Microsoft.com/kb/931125 >
      and go down to the section:
      'Update Package root (designed for Windows XP only)'
      There is a link, you can use to download a update for your root certificates package.  Download this package and double-click it to update.

    HTH,

    JW

  • When I try to access utility 'defrag' from Microsoft, a link to "Diskeeper" is everything that happens with download and purchase required.

    When I try to access utility 'defrag' from Microsoft, a link to "Diskeeper" is everything that happens with download and purchase required.  What is an intrusion to avoid?  It is possible to access the Microsoft defrag utility?

    Glen, have you ever tried to download Diskeeper?

    If so, he may have added something on your computer for access to defragment.

    You're going to start > all programs > Accessories > system tools > Disk Defragmenter and obtaining the pop-up window?

    Check in Add/Remove programs and see if something diskeeper is installed then uninstall it.

    Post back with more information, make and model of the pc, current anti-virus, browser and operating system and the service pack.

    also:

    Download, install, update and do a full scan with these free malware detection programs at:

    Malwarebytes (MMFA): http://malwarebytes.org/

    SUPERAntiSpyware: (SAS): http://www.superantispyware.com/

    After back with the results.

  • Problems with word and PDF after computer crash. Error "user has access privileges."

    Problems with word and PDF after crash

    My computer crashed and I had to run the recovery disk, the repair option, so he could run again. It does not format my computer but I had to re - install several programs. I reinstalled my copy of office for example.  I have an external hard drive where I put most of my files but since installing the recovery disc, it does not open some Word documents and gives a message error "user has not access privilege." It's the same thing with some pdf files. What can I do?  Please help because I can't open some of my documents from the University.

    Hello world
    I would like to just say thank you for your help and the problem is now solved.  In the end I paid someone to sort it out.  He explained that it was something like permissions for some of my files were owned by my old operating system and after that my computer crashed and I had to put through the recovery disc these permissions have been lost.  He told me that he had a program that looked for the old existing and re-installed.
    Thank you.

  • Wired router with POE and Gigabit ethernet to run two AC1750 access points?

    Hello, I'm looking for a recommendation for a wired router with POE and Gigabit ethernet to connect to both access to ceiling LinkSys AC1750 points internet routing on the WAN to a Virgin Media UK cable connection plug - can someone advise a good solution?

    I'm a Home Office / Small Office so user there are several Wired's devices and a mixture of wireless clients. I need at least 8 ethernet outlets. Reliablity and speed performance are important, but not important enough to go overboard on the cost!

    Many thanks to you all.

    I recommend a router Linksys (SMB) LRT214\224 and a switch POE LGS Linksys (SMB). This combination will be very fast and stable.

  • my laptop has completed the automatic update of vista and after that I can't access wireless router with an ethernet cable only

    My sony vaio laptop running windows vista has completed an automatic update and after that, I can't connect to my wireless network, I can access the internet with an ethernet cable.

    It worked perfectly fine before the update, I know that there is a problem with what I had the same problem in the past. The way it's been solved previously was to restore the laptop to an earlier point before the end of the update. Unfortunately I can't do that and the laptop has been completed, wiped and there is no backup where I can go to restore.

    I know I can remove some updates but don't know what 1, me it is another way to solve the problem.

    Your help would be much appreciated.

    Thank you

    Hi Nadzarif,

    You can try the following steps and check if it helps:

    Method 1:

    Because the wireless stopped working after windows update, you can check the Sony support link and try to install the latest version of the drivers for the wireless card and check if it helps:

    Sony support

    For more information, see the article:

    Update drivers: recommended links

    Method 2:

    Updated version has a problem in the history of the update.

    Step 1:

    You can check in the history of the update for the updates that are installed recently or before the show.

    a. open Windows Update by clicking the Start button. In the search box, type Update, and then in the list of results, click Windows Update.

    (b) in the left pane, click view update history.

    c. to display more information about an update, double-click it.

    See the Windows updates are installed

    Step 2:

    Uninstall recently installed updates and install the updates one at a time to understand what update is the cause of the problem.

    For more information, see the articles:

    Remove an update

    Install Windows updates

  • Pavilion dv4: Windows 7 does not start and I can't access the system with f11 recovery

    I use a Pavilion dv4. Windows just crashed on a blue screen with a message about physical memory dump. Now when I start the computer it will just a black screen with a blinking cursor to the place when windows normally should start. I can not access the system with the f11 key recovery. I went in with the f2 key diagnostic mode. Diagnostic tests except for the battery test that failed, but shouldn't the laptop to be able to run without a battery if it is connected? And besides, if the problem was the battery, the laptop wouldn't be able to turn on at all, no?

    I'm not about to spend all that money on a battery just to know that it is not the battery.

    Hello

    If you have the 64 bit rescue CD, you would have received an error if it was bad.

    Once you have all your data backup, try the following - which means that Windows has been installed on the C Partition.

    Boot from the new rescue CD, select repair your computer and choose the command line.  When this charge, enter the following commands and press on enter after everyone – including spaces as shown.

    Bootrec.exe

    bcdedit/export C:\BCD_Backup

    c:

    Boot CD

    BCD attrib s h - r

    Ren c:\boot\bcd BCD.old

    Bootrec /RebuildBcd

    Bootrec /fixmbr

    Bootrec /fixboot

    Remove the rescue CD and try to restart now.

    Kind regards

    DP - K

  • Guest access with ISE and WLC LWA

    Hi guys,.

    Our company try to implement access as guest with dan ISE WLC with the local Web authentication method. But there is problem that comes with the certificate. This is the scenario:

    1. the clients are trying to connect wifi with guest SSID

    2. once it connects, you can open the browser and try to open a Web page (example: cisco.com)

    3, because guests didn't connect, so this link redirect to "ISE Guest Login Page" (become): url

    https://ISE-hostname:8443/guestportal/login.action?switch_url= https://1.1.1.1/login.html&wlan=Guest&redirect=www.cisco.com/

    )

    4. If there is no Login to ISE not installed comments Page, no reliable connection of message message, but it will be fine is they "Add Exception and install the certificate".

    5. once the Guest Login Page will appear and you can enter their username and password.

    6 connection success and they will be redirected to www.cisco.com and there pop-up 1.1.1.1 (IP of the Virtual Interface WLC) with the logout button.

    The problem occur in scenario 6, after the success of the opening session, the Web page with the address and the error of certificate ISE IP to 1.1.1.1 is appear.

    I know that it happened when you can has no Page of Login of WLC certificate...

    My Question is, is there a way of tunneling WLC certificate to EHT? Or what we can do for ISE validate certificate WLC, invited didn't need to install the certificate WLC / root certificate before you connect to the Wifi?

    THX 4 your answer and sorry for my bad English...

    Do not mix WLC with ISE comments Portal local Web authentication. Choose one or the other. I suggest the portal + WLC CWA.

  • Comment create a private with password and login access?

    Comment create a private with password and login access?

    If all you need is to grant a person/company access to a specific folder on your site (a location test for their website for example), you can usually do this from your control panel hosting account. You must consult your webhost for exact directions on how to do it.

    If you need a more robust record and the system log-in, you will need to become familiar with a language such as php server-side and a database like mySQL. DW has nothing built-in that will do these things for you, however you can use DW to encode or lining up third-party code on your site.

  • Hello I would like to create a Muse site with homepage and a member area with access code to access the other page of the site is possible this? Thank you

    Hello I would like to create a Muse site with homepage and a member area with access code to access the other page of the site is possible this? Thank you

    No. you're looking completely in the wrong place. These things requires a dynamic system that is appropriate like Wordpress, Joomla and so on. That or a paid Business Catalyst Pro account.

    Mylenium

Maybe you are looking for