LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision assistant in LabView

Solved!
Go to solution

Dear All,

I am not that familiar with LabView yet, and would really appreciate some help.

I have attached to this message three documents. the first one represents the block diagram of how I can use a few tools from labview with my thermal camera. All this works fine for this one. The second one, is a tool developped from Vision Assistant, but created as a LabView VI, so same in the block diagram. And in the third one, is the block diagram of the two (the first which corresponds to image and few data from the camera, and the second one the tool developped in Vision assistant) together. Bacsically my question is, could you help me or show me how to link the two, so that I can use the tool developped in Vision Assistant with my image from the thermal camera (file 1). Link file 1 and 2 together basically.

Many thanks for your time

 reivaxseniab

Download All
0 Kudos
Message 1 of 24
(4,861 Views)

Hello reivaxseniab,

 

Unfortunately that first VI (GetImageExample.vi) has a couple of VI's that were not included when you sent it over (Initialize.vi, GetData.vi, ConvertToImage.vi etc...) but I'm assuming that these are VI's specific to the camera that you are using, and that you actually just want to take the data output as "Image" in the 2D picture control and to put that into your IMAQ functions found in "trial 1.vi".

 

To do this first of all you would need to convert the image data into data that can be read in by IMAQ, this example file gives a good example of how you can do that, using the "GetImagetoIMAQ.vi" functions, where you would only need to use the functions from "Picture to Pixmap" onwards, and then feed that reference wire (Image Out) through the rest of your IMAQ function (maybe create your own SubVI in the program to save some space)

 

If you are new to LabVIEW I would suggest having a look at the example files by going to Help >> Find Exmaples... then on the NI Example Finder clicking on the Toolkits and Modules >> Vision >> Getting Started , and you should find some examples that will help to explain the functionality and flow of general IMAQ programs.

 

Hope this helps!

Best regards,

Mark W
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 24
(4,826 Views)

Dear Mark,

this is of a great help. Thank you so much

 

Best regards

 

Xavier Baines

0 Kudos
Message 3 of 24
(4,811 Views)

Dear Mark,

I have tried what you have told me, but I am sure I must have misunderstood some things because of course I didn't manage, but I really hope to get there eventually.

So I have done as said that's to say link from picture to pixmap, but somehow, on both ends where I link the GetImagetolMAQ.vi, there are wire problems.

I know I've done something wrong but I really don't know what.

In the attachment is a copy of what I have done, which is just trying to link my VI with the GetImagetolMAQ.vi.

Could you help out please

kind regards 🙂

 

Xavier Baines

0 Kudos
Message 4 of 24
(4,802 Views)

Hi Xavier,

 

So it looks like you've got the image feeding into the "Draw Flattened Pixmap.vi" which is good, but you don't need to use this VI, you could infact wire it directly into the "Picture to Pixmap.vi" and delete the other VI all together. There are a couple of reasons that you are getting your wire problems here. The first issue is that the two wires you are trying to join together are of different types, for example, the wire coming from your "GetData.vi" is a pointer to a VISA resource, which is a way of pointing your VI's to the third party instrument you are using and telling them what they need to interact with or get the data from. The second wire coming from "IMAQ ArrayToColorImage" is a pointer to the image that you have fed into your "IMAQ" VI's. There is no need for these two resources to share any data between each other as you have already passed the image from one, through the set of VI's that you have just inserted.

 

The second issue that you are facing is that you are trying to connect an output of one VI's to the output of another, effectively the two streams of data are butting into each other. This is counter-active to the Dataflow principle that LabVIEW generally relies on, if you have a LabVIEW Core 1 manual lying around you can find more detail about this in there.

 

Whilst I can't write your code for you, what I would suggest doing is inserting the code that you have presented me with in "test 1.vi" and place that into your program, and using the "Image Out" terminal of "IMAQ ArrayToColorImage" to wire into your "IMAQ ExtractSingleColorPlane".

 

You may need to think about where you want to put this code in your program as the loop will re-iterate every bit of data within it, so if you wanted to write each result to a file you should take that into consideration.

Best regards,

Mark W
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 5 of 24
(4,796 Views)

Dear Mark,

Let's try and solve problems one at a time (by the way, I really appriciate your help).

ok so I have deleted the "draw flattened Pixmap" and nked the image to "picture to pixmap" which I thought I had to do right at the start given you told me so. Anyway, that's settled. Next is the "getData" problem. I uderstand very swell what you are saying, that they are different types, but then I don't know where to link "getData" to, because before actually trying to fit in the "GetImagetoIMAQ", the GetData.vi was connected to the close.vi right next to the error out on the far right. So now I don't know where to link it too... Or do I have to remove it?

 

Thanks for your time

 

Yours truely

 

Xavier Baines

0 Kudos
Message 6 of 24
(4,787 Views)

Ok I think I understood, and I deleted the wire going from the GetData.vi to the close.vi, because if I got it, the only wire that should be connected to close.vi is from the IMAQ array to color Image. Am I right?

Sorry I am useless, but I am trying and I think I am starting to get it 🙂

Cheers

 

Xavier Baines

0 Kudos
Message 7 of 24
(4,784 Views)

Hi Xavier,

 

No problem, resources are somtimes quite hard to get your head around without practice!

 

You actually want to wire your "GetData.vi" an "Close.vi", as these are all talking to your 3rd party instrument.

 

You would probably want to wire your IMAQ VI's together like the image I have attached, you will need to choose where to put your IMAQ functions, whether they should be outside or inside your loop is up to you, context help is a really good tool to understand the exact functionality of each of the VI's, and will give you a good idea of where you want to put them.

 

Best regards,

Mark W
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 8 of 24
(4,767 Views)

Dear Mark,

I have tried to wire "getDigitalData" to close, but it doesn't seem to work...

As for the rest, I think I have connected correctly although I am sure there is still a few things to do.

Here is what I have done, tell me what you think 🙂

 

Best regards

 

Xavier Baines

0 Kudos
Message 9 of 24
(4,749 Views)

Hi Xavier,

 

I am not really sure what you mean by it doesn't seem to work, it looks to me like the VISA reference wire is going into the "Close.vi" fine, are you referring to how there is a broken run arrow up the top left of the program, not allowing your program to run?

 

If you click on that broken run (or hit ctrl+r) arrow it will automatically give you an error list of items to fix like the first attachment.

 

In your case you wont have the errors where subVI's are missing, but you will have the errors of tunnels not being wired together correctly, if you double click on that error it should take you to the area on your block diagram where the error occurs. Your VI's have a couple of tunnels hidden behind each other like the second attachment.

 

You may want to move these out from each other so that they are easier to wire into individually, like the third attachment.


You want to make sure that each of these terminals have data wired in to them in each one of your cases so that they do not appear as an empty shell, but as a solid colour.

 

These links are good for understanding case structures and terminals a bit more.

 

These are all subjects covered in LabVIEW Core 1, I would suggest Xavier that if you are looking to use LabVIEW more in the future it is often more beneficial to sit down and dedicate three days to learning these principles with exampls and excercises than struggling to piece together code, if you're an academic in the UK training is at a discounted rate. Let me know if you're interested.

 

Best regards,

Mark W
Applications Engineer
National Instruments UK & Ireland
Download All
0 Kudos
Message 10 of 24
(4,744 Views)