LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing imaq with imaqdx.vis to enable non NI camera use

Hi,

 

So i am trying to run a labview vi to aquire images while some other events are triggrered.

For this i am using a DMK 23UP1300 USB3.0 camera. and LabView SP1 2019.

The code I am using was written some years ago, so I was not involved in this and generally have not really much understanding of Labview unfortunately. What I know is that the code uses NI IMAQ to control the camera. UNfortunately when I set everything up, I received the following error: "NI-IMAQ: The passed in interface or session is invalid"

After some research I then came across a forum discussion in which it was said that if a camera is used which requires IMAQdx support, this error could come up and that all IMAQ VIs should be replaced with IMAQdx VIs. After deinstalling the IMAQ driver (I kept the IMAQdx), two sub VIs are not wxecutable, because they are referencong to IMAQ VIs. I thought about replacing these missing IMAQ VIs with IMAQdx VIs now, but I can not find these specific VIs in IMAQdx. So could I replace them with other IMAQdx VIs which would fulfill the same purpose? Or would there be any other option besides writing a new code, which would be quite difficult for given my lack of experience. I included images of the 4 missing IMAQ VIs, as well as the block diagrams of the to VIs which are referenceing to these(attached as VIs as well). I hope this might help.

 

 

 

Thanks,

Jasper

Capture.JPG

 

block 1.JPG

 

block 2.JPG

Download All
0 Kudos
Message 1 of 7
(2,849 Views)

I must confess that NIPM "scares me", particularly when it comes to LabVIEW Vision products (which can be quite confusing!).  So I'm going to use terminology that comes from LabVIEW 2009-2016 (i.e. "before NIPM") -- while I'm successfully using LabVIEW 2019, I haven't done a 2019 Installation in a year or so, so I'm forgetting some of the details.

 

There are two parts to LabVIEW Vision -- manipulating data that comes from a Camera (or something similar), which was formerly called the "Vision Development Module" (or VDM), and acquiring Images from a Camera, the Vision Acquisition Software (or VAS).  The VAS came in three "Flavors" -- IMAQ and IMAQ I/O, designed for NI Hardware such as Frame Grabbers  (designed, largely, for NI hardware -- I'm not sure they work with third-party Cameras) and IMAQ-dx, designed for third-party data acquisition devices (a.k.a. "Cameras") that adhere to various published buses and standards (e.g. IEEE 1394, GenICam, etc.).

 

The Camera you mention says it supports LabVIEW, which probably means that it will work with IMAQ-dx.  Note, however, that IMAQ-dx is a separately-licensed Product -- not only must you install the appropriate Drivers, you must also "Activate" its separate license.

 

You can tell if you have the appropriate Drivers by opening MAX and expanding its Software Tab.  On my machine, I see two entries with "Camera" Icons for IMAQ and IMAQ-dx, with the latter including both Development Support and Runtime, plus two additional entries for Vision Common Resources and Vision Development Module (with a different Icon that I think is supposed to be a Display Window, but I'm not sure, it's too tiny).

 

What is installed on your system now?

 

Bob Schor

0 Kudos
Message 2 of 7
(2,801 Views)

I have all these listed in my MAX software list as well (see below)

MAX Devices.JPG

 I deinstalled the IMAQ and IMAQ I/O drivers though, since I wanted to see how the code reacts if they are not present. So I think the issue I have is not that the IMAQdx environment is not properly installed, but that the code I want to use is referring to IMAQ sub VIs, and I do not know with which IMAQdx VI I could replace them, since I can not find VIs with the exact same name. If it would help I could as well install the IMAQ and IMAQ I/O support again, but I think this is not the mein issue I have. For your information, I can as well use the camera over the MAX Interface, so I can grab the camera and take snapshots. I think that as well means that generally the issue is not with the IMAQdx drivers, but how they are referenced by the code I want to use?

 

Thanks,

Jasper

0 Kudos
Message 3 of 7
(2,768 Views)

IMAQdx is a different API. So you will not find VIs that have the exact same name as your NI-IMAQ VIs used by your program.

Also to correct some other things said in this thread, the difference between NI-IMAQ and IMAQdx is not really that the former is for NI hardware while the other is for 3-rd party hardware. More correct would be to say that NI-IMAQ only supported NI hardware with some extra hacks that could be downloaded as semi official examples from the NI site to support other cameras such as USB cameras through the Windows DirectX API and NI-1394 for firewire and compatible cameras.

 

IMAQdx is a combination of all those technologies under one single, newer and more modern application API. So IMAQdx definitely supports also NI frame grabbers, although that is a bit of a historical thing nowadays since NI has pretty much stopped selling such boards. IMAQdx did indeed not support some of the older legacy NI frame grabbers anymore, but they were generally EOLed already at the time IMAQdx was released for the first time.

 

So how to approach your problem?

 

1) Learn a bit about image acquisition by looking at the examples that ship with IMAQdx. It is important to have an idea how you need to initialize and configure an IMAQdx session and then use it to grab single images or a continuous stream of images. 

 

2) Armed with that knowledge, go through your existing program and find where the different NI-IMAQ VIs were called, what they were supposed to do and how to best replace them with an equivalent IMAQdx call. There won't be always a 1 to 1 replacement and some of your application may need some modification to adapt to the new IMAQdx interface. While this can be intimidating for someone with no experience in LabVIEW and/or image acquisition, it is a fairly easy and straightforward task, but you either have to invest the time to learn the basics or hire someone who knows enough of the topic to not only be dangerous enough to believe he can change your application, but to actually successfully tackle this task.

 

There is something called the Knowledge Curve from Dunning-Kruger:

dunning-kruger-0011.jpg

Everybody who starts with something new generally starts at the "I know nothing point" and is afraid to do anything. Then there is the most dangerous point of "Wow I fully understand it". That's the point where someone knows enough to be really dangerous, but not enough to know that they are dangerous. You do not want to hire someone like that to help you. After that comes the point of despair where you finally realize that you basically understand nothing. From there on you have a slow and steady slope of enlightenment where you finally start to understand things more and more but never quite forget that you basically never will know everything that can be known about the topic.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 4 of 7
(2,759 Views)

Thanks for your replies. I tried to understand now what all these VIs do and how to replace them, and think generally solved the main issues. But now I am stuck at another one, which is present in 2 of my codes. I can configure the camera and acquire the image but then when I want to convert the image into an array it gives me the following error:

Capture.JPG

 

But I do not understand what the issue is, since the image should be in I16 format, which is compatible with the IMAQ IMageToArray VI. Or is it an issue that the image was acquired with IMAQdx and this is an IMAQ VI. But I could not find an IMAQdx VI with which I can convert an image to an array of pixel values. Do you have any idea how I could solve this?

 

best,

Jasper

0 Kudos
Message 5 of 7
(2,691 Views)

Put an IMAQ Display on your front panel and connect the image from the IMAQdx Grab.vi to it! I bet it will show as color image since you use your build-in webcam as source.

 

IMAQdx Grab.vi will convert the IMAQ reference to whatever image format is most compatible to the source format of the camera. So if you want to use grey scale images you need a greyscale camera, or one that can be configured to grab in greyscale (webcams usually can't), or you need to convert the image after the grab to a greyscale image.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 7
(2,680 Views)

The output of many IMAQ and IMAQdx functions is something called an "Image".  This is not a simple 2D Array of numbers, suitable for plotting on an Intensity Graph.  There are special IMAQ Indicators, called an "Image Display", that are designed for this particular type of Data Structure.

 

On the other hand, there are IMAQ functions that will manipulate the Image Data Structure.  One, IMAQ Color Image to Array, will take an Image and create a 2D Array of U32 out of it.  If you take a "Snap" (or a "single picture", not a "video") with your Camera, send the Image to an Image Display and send the output of the IMAQ Color Image to Array to your "Live Image" Intensity Graph, you should see something interesting.

 

For extra credit, why is the "image" in the Intensity Graph rotated by 90°?

 

Bob Schor

 

P.S. -- Image Processing in LabVIEW can be pretty challenging ...

0 Kudos
Message 7 of 7
(2,670 Views)