12-04-2019 02:27 PM
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.
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!
Solved! Go to Solution.
12-04-2019 02:33 PM
Post your vi and we can help show you some tricks.
12-04-2019 02:37 PM
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.
12-04-2019 02:41 PM
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:
The parsing and then displaying to an indicator keeps on repeating all the way down. That is what makes it so cluttered.
12-04-2019 02:47 PM
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.
12-04-2019 03:08 PM
@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
12-04-2019 03:15 PM
As others have said, we cannot help more unless you actually attach a simplified version of your VI.