LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent Help with tables under labview

Hello, I am a student and I am currently working for a company that uses labview software. I get positions with an array in x and y. On this table. I would like to compare the positions which are too close to one another and to x and y. If it is too close, I add the x and add the y to make an average. I rank these averages in a new table. I do not know if I was clear enough in my explanations. I leave you a little VI to show a little my logic. But this VI does not work. I do not know how to create the new array with the averages of those positions. If anyone can help me please.

Download All
0 Kudos
Message 1 of 10
(3,069 Views)

Wow.  I have almost no idea what you want to do!  The poorly-drawn picture shows X and Y as identical arrays of shapes, with the left side having (what I supposed are supposed to be) duplicate circle and triangle entries that were removed.  It shows X and Y as identical.

 

The Code isn't much clearer (but thank you for including it as a VI, rather than as a PNG!).  There is absolutely no need for a Matlab script (whose logic was also not clear, and I apologize for not investing the time and patience to try to understand it).

 

Some questions.

  • What do you mean by "Tables"?  What are X and Y?  Are X and Y always identical (to each other)?
  • Consider attaching two "tables" (what format are the tables?  are the values numeric, shapes like your PNG, a file of text, a file of numbers, an Excel Worksheet?), one "before" showing the data you need to process and one "after", showing what you hope to achieve.  Be careful -- you can only attach three files in the Forum, so if you have more, combine them all into a ZIP file.
  • I don't know what you mean by "positions which are too close to one another and to x and y".
  • If your company uses LabVIEW (and wants you to use it, too), you should (at a minimum) spend some time with the LabVIEW Tutorials available on the Web (look at the first page of this Forum for help).  You should also be able to find a LabVIEW Guru at your company -- many LabVIEW users are happy to help their colleagues learn LabVIEW (it's a lot of fun).

Bob Schor

0 Kudos
Message 2 of 10
(3,053 Views)

Your code is overly complicated and contains serious race conditions. Maybe that's why it does not work.

 

  • Most of your indicators are of the wrong representation
  • You should autoindex on the inner and outer loop, no need for the "index array" wired to [i]
  • Eliminate all value proerties and just branch from the wire. Currently, there is no guarantee that the value properties are read before the terminals have been updated, so you could read stale information.
  • There is no need for the formula node. Try to use plain LabVIEW.
  • The sequence structure makes no difference, remove it.
  • Yes, please explain what the program is supposed to do.
  • Please don't maximise the diagram and front panel.
  • Save the VI with typical default data in all controls, then tell us what result you expect from it.
0 Kudos
Message 3 of 10
(2,998 Views)

Hello everyone, Thank you for your answers. Indeed, I expressed myself very badly by explaining my problem. I took a shortcut. For me it was obvious, but not for you and I apologize. The problem is this: I use a camera to detect fruits. Thanks to acquisition vision, I have the possibility to know the positions x and y. I use Color Location. He sends me all the portions of colors he has found. At the beginning, I added the x and also the y. This was perfect for a single fruit on the screen, but not for several. Below, I made a small drawing representing an example of situation. For example, if 2 squares are too ready for each other, I will average because it will be one fruit. On the other hand if the squares are too elongated with their positions X and Y it is that it is not the same fruit. I hope you have understood me better this time. I am still a student and it is during my Saturdays that I work in this company. It's a small box that just opened a very short time ago. We are only 2. The boss and I. Thanks again.

0 Kudos
Message 4 of 10
(2,965 Views)

How about sending an actual Image that you are trying to analyze?  Now I think I understand a little better what it is you are trying to do.

 

Do you have a lot of experience using Machine Vision software, i.e. using Image Analysis to identify "objects"?  I know that NI does this sort of thing (I've seen demos of NI Vision routines used to "find the part that has a manufacturing defect" or "sort the red, blue, and green marbles rolling down a track into separate bins", but have not done this, myself.

 

Bob Schor

0 Kudos
Message 5 of 10
(2,952 Views)

It sounds like you can use IMAQ Count Objects if you just set the limits correct. Then you should just get 1 square/object and can easily get the average within each.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 10
(2,947 Views)
Thank you for your answers. I think I did not think well. Since I have to detect nuts, damassines or mirabelles as fruits and it is rare that 2 fruits have the same shape. I will no longer ask myself and think about doing otherwise to detect them and have a position at a time for a single fruit.

Thanks again. A good day.
0 Kudos
Message 7 of 10
(2,901 Views)

@djo.mayala wrote:
Thank you for your answers. I think I did not think well. Since I have to detect nuts, damassines or mirabelles as fruits and it is rare that 2 fruits have the same shape. I will no longer ask myself and think about doing otherwise to detect them and have a position at a time for a single fruit.

Thanks again. A good day.

Please DON'T use code tags when posting plain text. Simply Don't!!!

0 Kudos
Message 8 of 10
(2,881 Views)
Hello,

I come back to you with clearer explanations. Here is a VI of my program with the worries that I meet.

When I have a single fruit on the screen, I have the exact position of this fruit. On the other hand when I have 2, it gives me the average of 2. I wish to have the position of each fruit separately.

I uploaded my VI. I did this because I use 2 functions that are needed to open the file.

Is it possible?

Cordially.
0 Kudos
Message 9 of 10
(2,831 Views)

Let me requote Altenbach:

 

"Please DON'T use code tags when posting plain text. Simply Don't!!!"

 

Yet you did it again.  Just type your message in the edit box.  Don't mess with any buttons above that box!

0 Kudos
Message 10 of 10
(2,820 Views)