Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

transfer images from visual basic application to labview application

Hi,
I have a problem as I'm not expert about VB.net programming.
 
I need to get an image acquire from an application developped in VB.net and I need to trasfer this image under a labview application for the processing...We use VisulStudio 2005 for VB.
LBV is 8.5.1 with Vision Development module 8.5..
 
My meaning is basically to use a structure as a LBV global variable where the VB application acquires the image and store in the variable and in parallel the LBV application gets the image out of the variable and process the analysis using the customized criteria.
Grab acquisistion is triggered by a signal coming from LBV IO card to camera (but this is not the issue, just for info).  We process one image per second.
 
I need to use this strange approach due to the fact that using the acquising under VB I can acquire from more than a USB camera in parallel, but using LBV I can acquire only from one camera, not multiple camera in parallel..
 
Is there anybody can help me with some good leads?
Thank you ina advance for the help.
Marco
 
0 Kudos
Message 1 of 4
(3,483 Views)

Hi Marco,

you can use TCP/IP to send your image between both applications. If you use it, then you are independent from a LabVIEW global variable.

Mike

0 Kudos
Message 2 of 4
(3,481 Views)
Hi Mike,
thank you for the help..
 
Concernerning the way to transfer the image via TCP/IP with VB... could you help me a little bit more? Any indication how to do in order get the correct format from LBV to be process?
 
In LBV I know I can flatten image to string and send via tcpip and then the client will unflatten back from string to image..but with VB I don't know what to do exactly to prepare the image data to be sent in a string format in order to get (on the LBV client side) a string to be unflatten..
 
Do you have any sample code or link about that?  As mentioned before, I'm new with VB and starting up.
Thank you very much indeed.
Marco
0 Kudos
Message 3 of 4
(3,476 Views)

Hi Dreamer,

   I'm not an Expert in network programming, but working extensively using IMAQ and VB.NET. If you are allowed to use IMAQ under Visual Studio, you can use "ImagetoArray" where each element in the array could be sent to LV and collected to form the image again. If not, you may access the image grabbed in VB using System.Drawing.Bitmap class (GetPixel method), reading teh pixel value and sending the pixel index and value.

Another dummy solution but much easier:

  • Grab the image
  • Save it to a shared folder
  • load it from labview (as long as the file is shared, you can access the picture easily)

I hope this helps.

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 4 of 4
(3,472 Views)