08-14-2009 11:38 AM
What is required to connect to a PCI-1422 card using Visual Studio 2008?
I am trying to do two things through the PCI card:
1) control camera settings (or connect to the camera, I have the SDK that contains the camera functionality)
2) read image data from the camera to be able to save it to my own file for later analysis.
08-17-2009 10:04 AM
You will need the IMAQ driver which is part of the Vision Acquisition Software. You can download it from the link below:
NI Vision Acquisition Software 8.6 - Windows 2000/Vista x64/Vista x86/XP
http://joule.ni.com/nidu/cds/view/p/id/1099/lang/en
You can check camera functionality in Measurement and Automation Explorer and then use IMAQ functions to perform image acquisition in Visual Studio.
Nick Keel
Applications Engineering
National Instruments
09-09-2009 07:11 PM - edited 09-09-2009 07:15 PM
I currently have NI-IMAQ 2.5.1 installed, and use IRVista 2.51 to "use" my camera.
Will upgrading my NI-IMAQ software have any effect on this?
Also, I cannot find how to add NI-IMAQ to the toolbox in Visual Studio...
09-10-2009 10:15 AM
Upgrading your IMAQ driver could have an effect on your program. Upgrading from NI-IMAQ 2.5.1 to the newest driver is a large update, and the driver has advanced quite a bit.
Below is a link to a KnowledgeBase article that will help you program in VB:
Do NI-IMAQ and NI Vision Support Microsoft Visual Studio .NET?
http://digital.ni.com/public.nsf/allkb/B16A906B761B216F86256F4A0077258C?OpenDocument
Nick Keel
Applications Engineering
National Instruments
12-30-2009 01:29 PM
I am getting down to programming now, and just wondering.
Is this the most recent version of the IMAQ driver?
Are there any examples of c++ code for acquiring images, and sending serial commands?
12-31-2009 10:17 AM
The most recent version of the driver is available at the link below:
NI Vision Acquisition Software 2009.11 - Windows 2000/7 x64/7 x86/Vista x64/Vista x86/XP x86
http://joule.ni.com/nidu/cds/view/p/id/1524/lang/en
As of LabVIEW 2009, there is native .net support in the Vision Development module. Examples come with the download and can be found on your C drive a:
C:\Program Files\National Instruments\Vision\Examples\dotNET
These examples are for either C# or VB .net, so the C# examples should be able to be modified for C++.
Nick Keel
Applications Engineering
National Instruments
12-31-2009 12:24 PM
Hi vs3,
I'm not sure where Nick was going with his answer, as the C# examples are unlikely to be much use to you if you are looking to write a C/C++ application (unless you're looking to write a C++/CLI .NET app, but that is unlikely). He also pointed you to the Vision examples, not the Vision Acquisition ones.
We do in fact give examples for Microsoft Visual Studio that are written in C. You can find the Vision Acquisition examples here:
C:\Users\Public\Documents\National Instruments\NI-IMAQ\Examples\MSVC (Vista and later)
or here
C:\Documents and Settings\All Users\National Instruments\NI-IMAQ\Examples\MSVC (XP and 2000)
Hope this helps,
Eric
12-31-2009 01:03 PM - edited 12-31-2009 01:07 PM
I've installed the latest version of the IMAQ drivers, but none of the paths that have been presented exist.
I'm using XP, and wishing to program a few image collection functions that can be called from a main program.
Basically, I am looking to snap an image (via PCI-1422), then turn a filter wheel (via serial connection).
I will possibly later add my own image processing functions, but those are already written and work.
I do not see an "Examples" folder in "C:\Program Files\National Instruments\NI-IMAQ\"
There is nothing NI related in "C:\Documents and Settings\All Users\"
It might not be relevant, but during the install of this version (and the previous version 8.6.1) I got an error during installation that "Windows could not load the installer for IMAQ. Contact your hardware vendor for assistance." I clicked OK and it continued along with the install.
EDIT:
still looking i found an example folder here:
"C:\Documents and Settings\All Users\Documents\National Instruments\NI-IMAQ\Examples\" with the MSVC and .NET directories under it.
Thank you for your help thus far
01-26-2010 04:23 PM
Up to this point, I can use the examples to snap an image, and can slightly manipulate the code within the examples to better suit my needs...
I used an example code that NI provides on an older tutorial, but cannot build my solution.
My attempt at coding a simple snap & save operation:
#include "niimaq.h"
int main(int argc, char* argv[]) {
INTERFACE_ID iid;
SESSION_ID sid;
Int8* ImaqBuffer = NULL;
imgInterfaceOpen("img0", &iid);
imgSessionOpen(iid, &sid);
imgSnap(sid, (void**)&ImaqBuffer);
imgSessionSaveBufferEx(sid, &ImaqBuffer, "C:\\IMAGES\\SNAP.PNG");
imgClose(iid, TRUE);
}
This code will compile, but when I try to build the project each of the img____ functions triggers an "LNK2019: Unresolved External Symbol" error.
01-26-2010 06:17 PM
It was as simple as adding C:\Program Files\National Instruments\NI-IMAQ\Lib\MSVC\imaq.lib to my project
compiles, and builds... tomorrow we'll see if I get an image!