LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Block Diagram becoming cluttered from Shift Registers (Chart Recorder)

Solved!
Go to solution

Hi. I am brand new to labview. What I am doing is pretty much sending around 80 serial commands at once (according to the set interval). Returning the read data as an array thats been split by new line. Then parsing for the voltage values and displaying that voltage on indicators (eventually to a chart/graph). It seems like my block diagram is becoming very very cluttered. Is there any design techniques or philosophies or tips that I can use to shorten and compact this.

 

brb23_0-1575491063819.png

 

As you can see I am just going down and down the page. To my knowledge I think this is very bad programming practice LabView and would like to fix it. If you have any insight that would be greatly appreciated - Thanks!

0 Kudos
Message 1 of 7
(2,187 Views)

Post your vi and we can help show you some tricks.

Tim
GHSP
0 Kudos
Message 2 of 7
(2,174 Views)

Yes.  Seeing only a partial screenshot of your code means we can't see everywhere the data is being used or possibly changed.

 

You might also want to consider using a feedback node.  For instance, if a value is being changed or used only within an embedded loop or a specific case, you can place a feedback node in there and it will keep the wiring within that structure.  You won't need to run wires through other case structures or loops that aren't using that data.

0 Kudos
Message 3 of 7
(2,170 Views)

Hi Tim

 

Unfortunately I don't think I can post the entire block diagram but the picture in the question is the main thing causing what I think is poor practice.

 

Basically here is the structure:

 

->Write Serial Commands

 

->Read All Serial Input -> Split the response string by lines -> Iterate through each line look for certain words -> if that word is found get the voltage from that line

 

->Flush buffer

 

Here is a better pic:

brb23_0-1575492035162.png

The parsing and then displaying to an indicator keeps on repeating all the way down. That is what makes it so cluttered.

0 Kudos
Message 4 of 7
(2,169 Views)

I think I would use a cluster. Inside of the cluster I would have three controls:

Parse Expression

Search String

Double Result

 

Place the cluster into an array. Now you can index through the array and find the value and add it to the Double Result.

Tim
GHSP
0 Kudos
Message 5 of 7
(2,160 Views)

@brb23 wrote:

Unfortunately I don't think I can post the entire block diagram but the picture in the question is the main thing causing what I think is poor practice.

We don't want you to "post the entire Block Diagram", we want you to attach the VI.  Drag and drop it below the Message Box (where it says "Drag and drop here or browse files to attach" -- you can also "browse files to attach").  Seeing your VI is much more helpful -- we can see everything, we can edit it (and get rid of unnecessary white space so it fits on our screens better), we can test it, modify it, see what version of LabVIEW you are using, etc.

 

Bob Schor

0 Kudos
Message 6 of 7
(2,140 Views)
Solution
Accepted by topic author brb23
  • All you probably need is exactly one shift register containing a 1D DBL array where you replace elements depending on the position and boolean.
  • Autoindex on arrays of "search strings" and "parsing expressions" to avoid all that clutter. Terminals belong before the loop unless you expect them to change during inner loop execution (unlikely and dangerous!).
  • If the shift register is only accessed in the inner loop, use a feedback node instead.
  • ...

As others have said, we cannot help more unless you actually attach a simplified version of your VI.

0 Kudos
Message 7 of 7
(2,133 Views)