09-26-2010 12:46 AM
I use logitech webcam plug in to usb it show in Measurement & Automation as cam1
when i change cam0 to cam1 it show error massage like the picture.
how can i use cam1
////////////////////////////////////////////////////////////////////////////////
//
// Author : Vision Assistant
// Purpose: This file implements the algorithm prototyped in Vision Assistant.
//
// WARNING: This file was automatically generated.
// Any changes you make to this file will be lost if you generate the
// file again.
//
////////////////////////////////////////////////////////////////////////////////
//==============================================================================
// Includes
//==============================================================================
#include <stdio.h>
#include <nivision.h>
#include <NIIMAQdx.h>
#include "ImageProcessing.h"
//==============================================================================
// Defines
//==============================================================================
#define DISPLAY_WINDOW 0
//==============================================================================
// Main Function
//==============================================================================
int main (int argc, char *argv[])
{
int success = 1,g=2;
int err = 0;
SESSION_ID sid;
unsigned long bytePerPixel;
ImageType imageType;
Image* image;
// IMAQ Vision creates windows in a separate thread
imaqSetWindowThreadPolicy (IMAQ_SEPARATE_THREAD);
// Open a session
IMAQdxOpenCamera ("cam0", IMAQdxCameraControlModeController, &sid);
IMAQdxConfigureGrab (sid);
printf ("capture.\n");
getchar();
// Create an IMAQ Vision image
image = imaqCreateImage(IMAQ_IMAGE_U8, 0);
while(g>0)
{
// Acquires an image.
IMAQdxGrab (sid, image,TRUE, 0);
// Vision Assistant Algorithm
success = IVA_ProcessImage(image);
if (!success)
err = imaqGetLastError();
// Display the image
imaqMoveWindow(DISPLAY_WINDOW, imaqMakePoint(0,0));
imaqSetWindowPalette(DISPLAY_WINDOW, IMAQ_PALETTE_BINARY, NULL, 0);
imaqDisplayImage(image, DISPLAY_WINDOW, TRUE);
// Wait for a key press before exiting
printf ("Press Enter to exit.\n");
}
getchar();
// Dispose resources
imaqDispose(image);
// Close the the session
IMAQdxCloseCamera(sid);
return 0;
}
09-27-2010 02:24 PM
Hi Unwell,
This error appears to stem from a program that uses a kernel debugger like WinIce for Windows NT Users. Nero Burning Rom 6 (or higher) is one software that is considered by Windows as a kernel debugger. Also other software like anti-virus, intrusion prevention software, some CD/DVD/Blue-ray burning software can cause this as well.
Just out of cursoity what version of Windows are you running?
09-28-2010 08:16 PM
win 7
09-29-2010 05:24 PM
hi unwell,
Does the webcam work in MAX? Have you tried rerunning Vision Assistant, selecting cam1 in the process. What version of NI-IMAQdx do you have installed?