09-07-2007 10:48 AM
09-07-2007 10:54 AM
May I make a few suggestions:
Your front panel looks very cluttered. Use a Tab Control to break up the front panel controls and indicators into different sections. Put a set of related controls/indicators on one tab, and another set on the next tab, and so on. This will help the user tremendously, and adding another button won't be so painful.
Your front panel background color should be a light color. That's why Ravens Fan said it hurt his eyes. The current color blends in with too many item's background colors.
You must have one gigantic monitor to see the block diagram, or you have to do a lot of scrolling. It boils down to being very hard to read the program flow. Organize sections into subvi's. Your main can be just a series of subvi calls, and the screen should scroll in one direction only, usually horizontally.
You make use of way too many local variables. Try to use wires instead. An acceptable way to create local variables is to place constants for each variable you want to create in a cluster. Then wire that cluster into a shift register in the main loop. Use unbundle to read a variable and bundle to write to a variable. Se picture:
09-07-2007 11:06 AM
09-07-2007 12:17 PM
@exo wrote:
old code for an old instrument and I only wrote a small section. It ran the old instrument; that's not to say it was either good code or efficent.
I'm now starting to write for a new instrument and I'm trying to solve the following problem: I want to enter a string; terminate with a line feed; recover some information from a file and/or the internet; do it again with out having to hit and start, stop or run buttons. The line feed needs to be the signal that starts the program again. Maybe a while loop with shift registers checking each time for a line feed?
I am going to assume that the buttons you DON'T want to use are the run, run continuous and abort buttons of Labview. (Other than the run button to initially start the program.) You do want to have a Master stop button that you code for that ends all loops, closes all references, and allows the program to end. (Never use "Abort")
So to do what you want such as "start the program again" (and I assume that means a particular section of code and not the entire Labview main VI) would be a button in the code that executes a case statement when it goes true. This could either be a button that is polled frequently and the TO DO code is in the True statement of the case structure attached to it, Nothing in the false case. Or it could be a Value change event for that button, and the TO DO code is in the particular case of the event structure. You would use the shift registers to maintain the values of the wires from one iteration to the next.
I'm not sure what you mean by "checking for a line feed". Where is this line feed getting generated? You could certainly run a loop and wait for the line feed character, but there may be other program structures that could do this better.
09-07-2007 12:21 PM
09-07-2007 12:42 PM
Hi Exo,
It sure sounds like you have made some type of progress.
Since all of the people that have helped so far probably won't be able to use those tickets, could I ask that you award those that helped you with 5-star ratings (see bottom right corner, Do not give les than 5-stars)?
It is the only mechanism we have for awarding our volunteers.
Thank you,
Ben