LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Condense multiple control arrays

I want to add more to this but there isn't enough room. This is a small part of a larger program. What this section does is load settings from an excel sheet. The file has many sheets that fill the control arrays, turn buttons on or off per sequence, change voltage current and compliance of meters and switch relays. I am not at liberty to share the whole program. There is a similar save event. We can make changes in LabView and save them or make changes in a spreadsheet and load them. So how can I turn all of those references into an array which would make it easier to add more.

 

Capture.JPG

0 Kudos
Message 1 of 11
(4,514 Views)
  1. Why do you need the Load Setup local variable?  Connect the wire straight from the Excel VI.
  2. Remove the sequence structure.  Not needed.
  3. I see a second event structure at the very bottom of the picture.  I am 99% certain that one of these structures is going to cause problems in your program.  Read the caveats for event structures in the help file. 
  4. You can bundle these values into a cluster to remove the clutter from the block diagram. 
aputman
0 Kudos
Message 2 of 11
(4,503 Views)

The items I leave on the front panel are things that need to be changed frequently. If you are seldom touching it, I would put it into a SubVI that pops up when called.

 

You may want to look into the MGI Read Write Anything toolkit, which allows you to easily write cluster data to a text file.

0 Kudos
Message 3 of 11
(4,500 Views)

@RHutchings wrote:

I want to add more to this but there isn't enough room.


On a side note: As we already said 15 years ago:

 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
If your LabVIEW problem can be solved by getting a bigger monitor, the problem is elsewhere.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

 


@RHutchings wrote:

So how can I turn all of those references into an array which would make it easier to add more.


 

Your image does not show any references. Can you clarify your terminology?

 

How about using cluster containers on the front panel?

0 Kudos
Message 4 of 11
(4,494 Views)
  1. Why do you need the Load Setup local variable?  Connect the wire straight from the Excel VI.
    1. I see that I don't so I removed it
  2. Remove the sequence structure.  Not needed.
    1. Removed
  3. I see a second event structure at the very bottom of the picture.  I am 99% certain that one of these structures is going to cause problems in your program.  Read the caveats for event structures in the help file. 
    1. Unfortunately this was built by more than 1 LabView beginner so I'm stuck with some things and just trying to downsize  the mess. This is what's inside the vi on the right. The others are similar.
    2. Capture.JPG

  4. You can bundle these values into a cluster to remove the clutter from the block diagram. 
    1. Many of these arrays are on different tabs and I would have to through them tab by tab.

Capture.JPG

0 Kudos
Message 5 of 11
(4,437 Views)

I think this is way to far along for those kind of changes .

0 Kudos
Message 6 of 11
(4,430 Views)

#3 quick simplification.

 

Delete all of those Index Arrays but one.  Drag the bottom border down to give you as many outputs as you need and wire them up.  They'll automatically be index 0 through 21.

 

Then you can delete all the constants.

 

The trickiest part will be making sure that 0 still goes to the 0, 1 still goes to the 1, .....  Luckily the code after the Index Arrays seem to be in order except that index 0 code is way at the bottom.

0 Kudos
Message 7 of 11
(4,417 Views)

I did that. plus I turned all the hex converters into sub vi's. 

Capture.JPG

 

0 Kudos
Message 8 of 11
(4,403 Views)

Delete all those constants 0 - 21.  You don't need them!

 

(As I said in my previous message.)

 

If you are making subVI's for the other stuff, you'd be better off put the index array into the subVI so you don't need a dozen string inputs to wire up.

 

And you'd be better off making the outputs a cluster that you could unbundle top reduce the number of connections coming out of the subVI.

 

0 Kudos
Message 9 of 11
(4,398 Views)

@RHutchings wrote:

I did that. plus I turned all the hex converters into sub vi's. 

Capture.JPG

I'd send the full array into the sub-vi's and extract the interesting part as part of that. That way you only have 1 array split in three wires on this level.

/Y

 


 

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 11
(4,352 Views)