LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Code layout

I have my application which is attached. I am just looking for some improvements and tips on how my code is laid out?

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 1 of 5
(2,584 Views)

1) Don't use the Quite LabVIEW function.  That is a lot like hitting the Abort button.  Instead, just close your front panel with an invoke node.

2) No need for the sequence structure.

3) No need for the Wait in your loop.  The event structure will limit your loop rate.

4) Use a shift register to hold your XML Path and ID.  No need to make hidden controls to use local variables.

5) No need for the Listbox Path to be a hidden control either.  Just pass the value into the event structure.  Avoid using those locals.

6) No need for the Trigger to be a hidden control (are we seeing a pattern here?).  The only way for that event case to be called right now is where you call that property node.  Just put the small amount of code you have there into the location where you called the property node.

7) Work on cleaning up your wires.  You have a lot of unnecessary bends and some going backwards.  I recommend putting wires that go through the event cases should be grouped near the top.  This helps keep them out of the way of the code while keeping them organized (ie, not bending around the code in all of your cases).


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
Message 2 of 5
(2,550 Views)

Adding to Tim's suggestion I would recommend passing the Error wires through the property nodes, which will automatically make you to align items properly.

-----

The best solution is the one you find it by yourself
Message 3 of 5
(2,525 Views)

... dont use string operations to make paths (e.g. where you create the xml path). Use "built path" instead.

("path to string" and "string to path" are rarely needed, mostly when dealing with os specific functions)

0 Kudos
Message 4 of 5
(2,499 Views)

@altenbach wrote:

... dont use string operations to make paths (e.g. where you create the xml path). Use "built path" instead.

("path to string" and "string to path" are rarely needed, mostly when dealing with os specific functions)


To explain a bit further, Alt is recommending this because it allows for cross-platform support.

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.
0 Kudos
Message 5 of 5
(2,492 Views)