07-25-2014 05:32 AM
I have my application which is attached. I am just looking for some improvements and tips on how my code is laid out?
07-25-2014 07:15 AM
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).
07-25-2014 08:27 AM
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.
07-25-2014 09:59 AM
... 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)
07-25-2014 10:05 AM
@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.