Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

03-29-2013 01:22 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi

- What l am trying to do is sort numbers into groups.

- A group consists of numbers that either are equal or step up or down by one value. Each group is to be assigned to one column. E.g. Column O of input test array would consist of 5, 4, and 3 but not 9 and 10. These values belong in Column 1. However if the adjacent cell in Column was not empty then 9 and 10 would stay in Column 0

- To better understand formula node programming l went to 1D. I found that each cell is not treated individually with my code.

- The orange final input test array is the type of data l would like to sort in a 2D array that ends up the same size array.

- In the code l have provided my aim to compare each cell in each column row by row to determine if a cell is equal e.g. a = b, a+1 = b or a-1 = b if so then these values are in the correct column. If not a sort must be performed to place a value in it's correct column.

This is my first go with formula node and l has to admit looking at other examples l have found a little confusing how a result was obtained. I prefer to do all programming in labview instead of going to another program to obtain the result l am after.I have tried array programming only for this problem and found it to be getting very complicated and large so l stopped. To me the formula node route should be simpler and more compact. My last resort is to use Excel but l still hope to do all programming in Labview so l end up with a more dynamic program.

Regards

Michael

Solved! Go to Solution.

Highlighted
Options
I think you should post the expected 2D Array result for people to better undrestand you requirements.

03-29-2013 05:47 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Highlighted
Options

03-29-2013 05:18 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi

Thank you for your interest.

I have provided you a vi that illustrates the solution l am after.

I could not get the pre and post increments to work ++ or -- and a number of other operators. My main problem was why a number of operators would not work. However simple formulas are easy.

I would like the code to examine cell by cell.

I found another example (quick sort vi) that uses partition to me it seems to be C code. It did not help with my understanding however it seems to be able to view cell by cell. Where as with my 1D array I found one cell that triggered an if statement placed 65 in all the remaining cells. I can see why this happened but l was not able to produce code to examine cell by cell values after the trigger point. This is how the 1D sort vi performs that is provided by Labview so l assume it is based on text code.

I hope my response clarifies my problem

Regards

Michael

Download All

Virus scan in progress. Please wait to download attachments.

Highlighted
Options

03-30-2013 08:19 AM - edited 03-30-2013 08:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I hope this is what you are looking for. Sorry the diagram is a bit cluttered!

Highlighted
Options

** LabVIEW Champion. It all comes together in GCentral **

**What does "Engineering Redefined" mean??**

03-30-2013 05:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Typically we don't like to answer questions with limitating conditions (using a formula node). A graphical solution seems much more appropriate here, after all, this is a LabVIEW forum!

Do you really want to insist on a "formula node" solution? Why? Why do you even use LabVIEW then?

Highlighted
Options

Solution

Accepted by topic author wetland

03-30-2013 06:25 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi

You are bloody brilliant...........!!!!!!!!!!!!!!

I just could not get it to would on multiple occasions using arrays, l have actually been on it for weeks. I never thought of the way you have solved this problem.

I hate excel and text programming. I am graphically minded that is why l like labview.

I did get a solution in Excel yesterday but your solution is far better than what l came up with

I very grateful

Thank you

Michael

Highlighted
Options

03-30-2013 07:06 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Michael,

The courteous thing to do is to mark the post which helped you to fix your problem as the solution, probably the .aCe. post in this case. You first will need to go to the Options link on the right side and unmark your post as the solution and then mark the appropriate one.

Marking your own post as the solution does not help someone else with a similar problem to find the solution quickly.

Lynn

Highlighted
Options

03-30-2013 07:28 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi Lynn

Yes it was aCe. It was a brilliant solution. I had the same ideas but was working at it on the right side of the array and ended up with a mountain of code. Just did not come up with an idea to do it from the left side of the array. In fact this is the first time l have found out that you could solve a sorting problem in this way.

Now what is this options mark all about? Are you able to provide more details? Is it normal to report to a moderator or highlight. I am very happy with the solution. I have only used the forum about two times may 3 to solve a programming problem.

By the way the only other array problem l have had on this forum is one that you had provided a solution. I understand how aCe solution has worked but the one you provided me in the past was also brilliant but l have not yet understand how it completely operates. I am just so happy that it works

So l am very grateful for both you and aCe

Regards

Michael

Highlighted
Options

03-30-2013 07:54 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Your own message that you marked as the solution. There is a link called "Options" to the upper right of that. Pick it. Then pick "Unmark as Solution".

Then you can mark Ace's message as the solution.

Highlighted
Options
Print

03-30-2013 08:43 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi RavensFan

I see the Options link.

When pressed these are the options l have

Mark as New

Bookmark

Subscribe

Subscribe to RSS feed

Highlight

Email to a friend

Report to Moderator

I do not see Unmark as Solution. I did pick a button about solution that l do not see any more. I did this on my first response after first viewing the solution by aCe when l stated the solution was brilliant. So l believe l have done that part already.

It seems to me l have not marked aCe array as the solution. Do you use the message tag for that?

Regards

Michael