LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to 'automatically' wire a bunch of stuff to 'build-array' inputs?

Solved!
Go to solution

@Dr_Daryl wrote:

Hello altenbach! I will attempt to answer your questions:

 


You are basically writing a graphical version of text based code, defining all "variables" using all terminals disconnected inside a stacked sequence, then pushing all data around using value properties. This is extremely inefficient, because property nodes are synchronous. Most likely you force orders of magnitude more thread switching compared to properly written code.

 

All these very deeply stacked sequences just give me the creeps!!!

 

Sorry, this code is so far out of my comfort zone that I won't be able to provide much assistance.

 

In any case, since that label array is static at runtime, that code belongs before the toplevel loop, to be run exactly once. It has no business in inner code.

0 Kudos
Message 11 of 15
(880 Views)

You are correct! Using the property nodes and stacked sequences, novices who may need to change the code can very easily locate and update information in the code. The alternative would be to string wires all over the place, making the code look like a spider web of shift registers and tunnels. Or, I could cluster the data and pass it to the states in the queue, which is how I started to do it. But then the customer kept adding in more and more inputs. Each time I added something to the cluster, the program would break because there were now unwired terminals that had to be handled. It became a nightmare so I went with the good old property nodes to move the data about without any wires.

 

Oh, and you're correct- the label array could have been defined in the initialize state (which is already about 15 stacks deep), but I thought it better to move them to the state where they are used. But- I suppose I could move them back to the initialize state and bury them way down deep in a 'creepy' stacked sequence. 

 

But what would be helpful is if someone told me what 'properly written code' means? If it works, and the machine is fast enough to not care about number of threads or memory, is there any harm done in doing it this way?

0 Kudos
Message 12 of 15
(871 Views)

@altenbach wrote:

@billko wrote:
Big guess, but I'm guessing these will become headers in some report or something of that nature, and the headers would then change if a change was made to the labels of the controls.

Then I would probably iterate over an array of references. Still seems overly complicated. 😄

No matter what, I would probably also use the legend instead of the label.

 

 


I would do an array of refs as well.  This was the best scenario I could come up with, though.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 13 of 15
(859 Views)

@Dr_Daryl wrote:

WHAT IS THIS MAGIC?!? The Quick Drop Window has the ability to wire stuff? Why don't they call it a "Quick Method" or "Shortcut Window"? I assumed the Quick Drop was just for controls and operators. I will have to find some training on all that thing does now!!

 

Thank you for answering my question and taking the time to illustrate. I hope this helps other young Padawans who have never used the Force in Labview yet!!


You can actually add your own stuff to the quick drop menu as control-key shortcuts.  There's an entire forum called Quick Drop Enthusiasts on here for people who made their own.  I put one up on there back in 2017 to more easily add "Value change" events for controls to event structures, though it's less useful now that there's a "Create -> event case" right-click option on controls (there wasn't when I created mine).  There's plenty more up there that you could also consider adding to speed up (and/or remove tedium from) your development time.

0 Kudos
Message 14 of 15
(844 Views)

@Dr_Daryl wrote:

 

But what would be helpful is if someone told me what 'properly written code' means? If it works, and the machine is fast enough to not care about number of threads or memory, is there any harm done in doing it this way?



your coding style kinda reminds me of this...

 

Frozen_0-1644447998727.png

 

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
Message 15 of 15
(832 Views)