LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to see images in MAX

I have a SenTech USB camera and recently purchased the NI Vision software.   Failing to sufficiently program in LabView to get an image using the SDK from SenTech I thought I might try to use the built in frame grabbers with Vision.  Seeing as I needed a configuration name from MAX, I thought I'd try MAX to run the camera first. 

So I open MAX and go into the Devices and find my camera properly identified.  "cam0 : StUSBcam".  But when I hit snapshot or play I get the following unknown error:

 

0x80040217

 

The message is "Unknown error" which is not terribly helpful.  I would like to get back to the point where I am programming in LabView using the new IMAQ Image.ctl that I just bought but I wouldn't mind getting the camera to acknowledge me first.  

 

If anyone has any experience with the SenTech SDK I'd love to pick your brain.


-Ken

0 Kudos
Message 1 of 15
(7,458 Views)

Hi KenMarr,

 

In general, in order for any USB camera to work in Measurement & Automation Explorer (MAX), it will need to be DirectShow compliant. I could not find out if the SenTech was DirectShow compliant or not (you may have to get in touch with the manufacturer). However, it looks like SenTech does provide its own drivers for LabVIEW. If we want to use the camera natively with LabVIEW, we will need to get it working in MAX first before we get it working in LabVIEW. Here are some things to check:

 

1. All USB cameras will use our IMAQdx driver. Make sure you have this installed. If you do not have this installed you can download it from here.

 

2. Make sure the camera is linked to the proper camera file. You can do this in MAX by going to Devices and Interfaces » NI-IMAQdx Devices » <your camera> and right-clicking your camera and going to Camera. You should see a list (or just one) of camera files. Make sure the camera file is the proper one for the camera.

 

3. The DirectShow drivers might be included in the DirectX driver from SenTech. Try installing this.

------------------------------
Bill E. | Applications Engineer | National Instruments
0 Kudos
Message 2 of 15
(7,438 Views)

Great!  I will give these a try. 

0 Kudos
Message 3 of 15
(7,433 Views)

Hello EverSong,

 

I decided to prod my camera again in MAX and discovered a setting which read "1360 x 1024 UNKNOWN 15fps".  When I changed this setting to "1360 x 1024 32RGB 15fps" or 16RGB or 8Mono(?) the camera no longer threw an unknown error and was able to display an image of varying quality. 

 

Initially I had tried to create a LabView program using SenTech / NI .vi's and the IMAQ vision .vi's.  I set my image to be RGB (U32) and once I sized it properly, got not one image, but 16!  I attach a picture of the alternating purple and green images from that attempt.

 

Having learned about Bayer filters from SenTech I tried applying a Bayer decoder to a Greyscale (U8) image and just got garbage.  That image and program I have also attached.  The program initializes the camera, sets the trigger to free run, sets the scan mode to full scan, and starts the transfer.  The program that created the 16 pictures is the same except the source image was RBG (U32) and the output of "SNAP" fed directly into Image 2.

Download All
Message 4 of 15
(7,420 Views)

I was exploring the LabVIEW drivers that SenTech provides and it looks like they are just calling into a dll so I am not really sure what they are doing or what they require to work properly. This most likely means that the camera is not DirectShow compatible. If it is not DirectShow compatible it will not show up correctly in MAX and will not natively work with the IMAQ VI’s, so the functionality may be strange.

 

I think our best bet is to first try using SenTech’s example program that they provide with their LabVIEW drivers and see if that works correctly. If this does not work, then it would be worth contacting SenTech to see how exactly to integrate their drivers with IMAQ VI’s.

------------------------------
Bill E. | Applications Engineer | National Instruments
0 Kudos
Message 5 of 15
(7,373 Views)

Unfortunately, the old example program uses IMAQ Copy which is no longer a supported VI as far as I can tell.  From what I gather, it simply created a copy of the image.  Copy Overlay is still around, but I don't think that does quite the same thing.  But if all IMAQ Copy did was to copy the image, I should have been able to short circut around that.  I believe I did that and got the 16 image issue.  I'll try to confirm that.  They have supplied an updated version, but my LabView (8.6.1) is so old that I can't even open it. 

Today I tried a run around the SenTech VI's using the IMAQdx commands and even though I could query the camera for its name, etc (cam0, StUSBCam, etc). I couldn't initialize a proper session using IMAQdx Open.  I've downloaded the USB IMAQ drivers and will try those shortly.

 

I do really really appreciate having another pair of eyes on this.

 

KM

0 Kudos
Message 6 of 15
(7,368 Views)

Also SenTech outsourced the creation of their drivers to someone at National Instruments so they aren't really sure what's going on in their VI's either. 

0 Kudos
Message 7 of 15
(7,364 Views)

I was told by the USB drivers that I needed NI VISION 7(?) or higher to install.  I bought the NI Vision Acquisition which included NI IMAQ and IMAQdx (and one other), but I guess that's not VISION 7.  

 

The old example program starts with Greyscale (U8) images and then has a note at the end which says "Process this image" which may or may not be actually happening.  I cannot get it to do anything different than my homegrown program above. 

 

Using the IMAQdx VI to enumerate camera attributes I obtained that the only Video Mode available is "1360 x 1024 RGB8 15fps".  Is RGB8 even a thing?  Its not an option for the IMAQ images.  Greyscale (U8) is, as is RGB (U32) and RGB (U64).    Even applying a Bayer filter, I still get gibberish results (see above).  

 

I'm getting the feeling that this camera just doesn't want LabView.

0 Kudos
Message 8 of 15
(7,359 Views)

I had a couple of comments regarding your posts. First off, it sounds like the camera is not fully (or at all) DirectShow compliant; which is the standard that is required for it to work properly in Measurement & Automation Explorer (MAX) and with the IMAQdx VI’s. It may have some features that sort or work but overall, if it is not DirectShow compliant, it is not likely to be able to run natively with IMAQdx (I suspect this is the reason they have LabVIEW drivers). If we are not able to use the IMAQdx VI’s, then we will have to use the drivers provided by SenTech.

 

Currently, all we have is NI Vision Acquisition Software. This includes all of our vision drivers (IMAQ, IMAQdx, and IMAQ I/O). These can be found at www.ni.com/drivers under NI Vision Acquisition Software. NI Vision 7 may be a reference to an older version of similar drivers.

 

The IMAQ Copy should not matter as it does not affect if we are able to display an image or not; as it just creates a copy of the image.

 

RGB 8 just means that it is using 8-bit color which is equivalent to LabVIEW’s U32 representation. This is how LabVIEW stores image data.

 

Generally, we do not create drivers for companies. It may have been an alliance partner that created the drivers, but I am not sure (not that it really matters).

 

Finally, I could down-convert the updated example program that SenTech sent you (if you are able to attach it).

------------------------------
Bill E. | Applications Engineer | National Instruments
0 Kudos
Message 9 of 15
(7,347 Views)

That would be very helpful.  Here are the two versions they sent in the update.  I think Version 2 is the one I need ported.  Even a screen shot of the diagram in LV11 would be helpful I think.  Mostly of the while loop at the end of the diagram (assuming its still there.)

 

 

0 Kudos
Message 10 of 15
(7,342 Views)