LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Image from RT target in local VI

Hi,

 

I'm doing some image analysis (caliper) with a NI 1744 Smart camera. This is my first project with Vision so I'm still learning a lot. As far as I've understood, I have to run my image aquisition code on the RT target (smart camera)? Or else it wont find my camera source (img0). At least this is what I'm doing and it's working fine. My code is pretty much the same as HL Grab (NI 17xx Series).vi, it can be found in NI Example Finder -> Hardware input and output -> IMAQ -> High-level.

 

Now to my question: My main application is running on the PC. I would like to integrate my vision code (which is on the smart camera) into the main application, or at least display the video feed with the caliper and the measurement in this VI. How can I achieve this?

 

Thanks in advance,

John

Message 1 of 6
(3,329 Views)

Hi John

 

When you develop an application for RT targets, you use the interactive front panel communication which basically runs the front-panel on the windows PC while the code is executed on the RT target. This is a part of the LabVIEW development environment so when you are going to distribute your application, you need to create two executables, one that runs on the smart cam and one that runs on the monitor PC.

 

You need to create your own code for transfering images from the smart cam to the windows PC. This knowledgebase shows how this can be implemented.

 

A second option is to use remote panels, which lets you view the front panel in a web browser.

 

Best regards
Øyvind Ø

Message 2 of 6
(3,292 Views)

Hi Øyvind,

 

Thanks for the quick reply.

 

I managed to solve the problem using IMAQ Flatten Image to String and sending across the network using TCP Read/write etc. I will look at the other options that are mentioned in the knowledgebase to see if there is an even better solution, but it seems to be working very well this way.

 

Best regards,

John B

0 Kudos
Message 3 of 6
(3,289 Views)

Hi John,

 

Did you run into any problems with the real time version on your PC being different than your Camera?

I am trying to do something similar as you.  I am using VBAI 3.6 for my main inspection on the 1744 camera and a Labview VI with a user interface for my setup procedure on the PC.

I have LV Real Time 8.6 on my PC and LV Real Time 8.5.1 on my camera.  I'm unable to upgrade the camera to 8.6 because 8.6 is not compatible with VBAI.

****Is it possible to use LV Real Time 8.5.1 on my PC (it looks like I may not be able to download that version from online)?

Even if I'm able to get the HL Grab.vi working, it sounds like displaying a live image on the PC monitor is going to take additional VIs.

 

The other solution I'm trying in order to use the 8.6 VI, is grabbing images from VBAI using TCP communication (after using a custom VI in VBAI to flatten the image to a string). I'm sending values through TCP to control the camera and light settings. 

 

Thanks for any insight. 

 

0 Kudos
Message 4 of 6
(3,194 Views)

Hi Poppie,

 

Yes, I had the same problem using VBAI 3.6. I was talking to NI support in the Netherlands, and it was eventually reported as a bug but there was also a workaround which i can't remember..

 

Are you using VBAI to build LabVIEW code? If so, maybe you can use Vision Assistant instead.. It will give you a much more simple code, and solved a lot of problems for me.

 

I don't think you can use LVRT 8.5.1 on your PC, but if you upgrade your camera to 8.6 (without VBAI) you can downgrade it to 8.5.1 later to make it work with VBAI again.

 

If you want to use the HL Grab.vi you need to deploy it to your smart camera and run it from there. If you want to use the video feed in your PC application you can do this using TCP read/write etc. I think there are some examples on how to do that. The code is really simple.

 

John B

0 Kudos
Message 5 of 6
(3,192 Views)

John,

 

Thank you for the fast reply.  I was able to get the Labview RealTime 8.5.  Once I had Real-Time 8.5 I was able to create a distribution for the smart camera for my VI (which flattens an image to a string).  I was able to call that VI from VBAI and send the string to another VI running on the PC.

 

The problem I ran into with this method was unflattening the string in my VI running on the PC.  I believe I kept getting an error ('memory or data corrupt') due to the way VBAI or the TCP process changed the string data.  I tried both the traditional 'Flatten to String' and the 'IMAQ Flatten Image to String' functions.  I tried a couple ways of specifying the string size but still received the error.

 

I am still trying to figure out why the unflatten from string does not work but I have also started using the VBAI ActiveX to display an image in Labview.   

0 Kudos
Message 6 of 6
(3,136 Views)