LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Auto index only shows partial data

Solved!
Go to solution

To be more correct you should make that "Replace with NaN" to a sub-vi you place 4 times. 🙂

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 53
(1,077 Views)

Ok.  I don't really know what a sub-vi is but I'll do some googling and figure it out.  Thanks!

0 Kudos
Message 12 of 53
(1,076 Views)

A subVI is the same as a function or method in other languages.

 

In LabVIEW, you'll configure the connector pane to control your input and output parameters.  Then you'll run the logic.  You can place this VI into other VIs and wire the inputs and outputs.  That way, you write the code once and can use it multiple times.  It's a huge help if you need to debug this code later.

0 Kudos
Message 13 of 53
(1,067 Views)

You already got the important suggestions. Here are a few more to dramatically simplify your code.

 

  1. Take an array subset before indexing, eliminating all the array subsets later. If you do it right, you can also skip the "delete from array".
  2. If you would place an autoindexing FOR loop around your "built array" nodes, you would not need to transpose later.
  3. Don't use matrix operations on arrays. There is a "transpose" in the array palette.
  4. Your diagram and front panel would be significantly simpler of you would place each button group into a cluster container. You can make the container transparent for the exact same FP look. Use "cluster to array" to create an array for later processing. (4 terminals instead of 20+!)
  5. Why are you reading and processing the same file 5x/second? Once is enough until the path or file changes.

 

 

Message 14 of 53
(1,059 Views)

@altenbach: Thank you for your suggestions.  I understand everything except the cluster container.  What is that?  I can't seem to find it and how is it different than what I've done i.e. grouped the buttons in a container?

0 Kudos
Message 15 of 53
(1,053 Views)

@rhupd wrote:

@altenbach: Thank you for your suggestions.  I understand everything except the cluster container.  What is that?  I can't seem to find it and how is it different than what I've done i.e. grouped the buttons in a container?


If you've programmed in other languages a Cluster is a Struct or Type, thus a functional unit when programming. A group is just a way to arrange front panel items. It's in the Array, Matrix and Cluster-menu.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 16 of 53
(1,045 Views)

@rhupd wrote:

@altenbach: Thank you for your suggestions.  I understand everything except the cluster container.  What is that?  I can't seem to find it and how is it different than what I've done i.e. grouped the buttons in a container?


Grouping is a cosmetic property of the front panel, you still have the terminal clutter on the diagram.

 

You would place an empty cluster container from the cluster palette, then drop your switches into them. You need  to ensure that the cluster order is correct (right-click...reorder ...) to ensure that the elements of the array are in the same order.

 

Clusters can even contain elements of different datatype. Cluster to array of course only works if all elements are the same type, e.g. boolean in our case.

 

Here's a quick draft comparing your method and the cluster method. Arguably, the cluster gives significantly less diagram clutter, making the code easier to maintain.

Message 17 of 53
(1,039 Views)

Hi everyone,

 

I think I incorporated all the changes that were suggested but it's still not working properly.  I have a feeling it's the loops and auto-indexing business.  I've been reading about it and trying to understand it better but I need a second pair of eyes to look at what I've done please.  The buttons still aren't working properly.

 

Thank you!

Download All
0 Kudos
Message 18 of 53
(959 Views)

Fairly close.  I Fixed A-C  You get to do the restSmiley Wink


"Should be" isn't "Is" -Jay
Download All
0 Kudos
Message 19 of 53
(943 Views)

You need to disable indexing of the boolean array on the outer loop. It needs to autoindex on the inner loop instead.

 

(EDIT: I guess Jeff was a little faster :D)

0 Kudos
Message 20 of 53
(939 Views)