LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Typed variables

In none of this do I want to use a control or even define or use more than a very limited number of controls; I want to perform sequential programing with minimal graphical content.

 

I understand that I can use enumerated types, albeit with difficulty, since Labview is inherently graphical and not as easy or elegant as text programing. But I do not see any indication about to how to create a variable of a particular type, or several of them, without placing graphical images on my "front panel" that would not belong there and have nothing to do with what I want to display. I work occasionally with the book "Labview for Everyone", but the book neatly avoids any such discussion. In real life, I find that Labview applications have huge numbers of unwanted screen objects that, for some reason, have to have Front Panel representations and simply cannot be confined to the Block Diagram and the algorithmic basis of the software. With critical software, this is a huge embarrassment and impediment.

 

Can any thing be done to remove the huge amount of clutter?

Many thanks

 

Mark

0 Kudos
Message 1 of 5
(2,466 Views)

The wire is the variable. If you need the front panel to store data that only belongs on the diagram, you are doing it wrong.

 

One possibility is to use a cluster in a shift register and interact with elements using bundle by name and unbundle by name or the IPE structure.

 


@MarkGrindell wrote:

... since Labview is inherently graphical and not as easy or elegant as text programing.


Graphical programming is significantly more elegant as text, IMHO 😄

 

Can you show us what you are currently doing? You mention "Sequential". What do you actually mean by that? Sequential execution is typically controlled by wired data dependencies. No "variables" needed.

0 Kudos
Message 2 of 5
(2,454 Views)

Hi Mark,

 

why don't you attach an example of your clutter, so we can show you how to clean it up!?

 

The general answer to your generic complaint is THINK DATAFLOW! 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(2,440 Views)

MarkGrindell wrote:

In real life, I find that Labview applications have huge numbers of unwanted screen objects that, for some reason, have to have Front Panel representations and simply cannot be confined to the Block Diagram and the algorithmic basis of the software.


As other have said, that is typically due to the developer not understanding data flow.  "Variables" should be held in shift registers so that you can update them with every loop iteration.  For many variables, they are usually grouped in a cluster (or a struct for you C programmers).  And do make a Type Def out of your clusters so that you do not have to make a ton of edits when you need to add an item to the cluster.  Use the wires to dictate the order of functions instead of a sequence structure.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(2,418 Views)

Hi Mark,

I'm afraid you did the LabVIEW equivalent of posting on a board of C experts that in real life the typical application is a nested mess of GOTO statements so how come the textbook neatly avoids discussing this?

0 Kudos
Message 5 of 5
(2,402 Views)