10-14-2016 01:34 PM
Hello Everyone,
I'm new to the forums and (farely) new to LabVIEW. Used it for a couple simple lab exercises in school, but never took a strong interest until now. I am admittedly aweful at LabVIEW and am trying my best, but need some quick help here. The front panel is not organized as I've just finished the block diagram.
A quick explanation of my code is as follows:
1. I ask the user to input strings, which are used to automate file naming.
2. The start and stop frequencies are inputs since we aren't able to read that info from our equipment.
3. The ring I have is to allow the user to choose what type of measurement they're taking.
4. My program takes the input and changes one of the inputs based on their choice.
The "Screen Pull and Write" VI takes these inputs and saves a CSV file to a default directory. I know that the only real difference between each structure is what type of measurement I'm taking, but I couldn't find a way to do this with an Event Structure.
Please feel free to be as critical as possible. I'm learning and it's all helpful. If you hurt my feelings, shame on me for putting emotion into it.
10-14-2016 01:46 PM - edited 10-14-2016 01:52 PM
Hi chopeter,
why do you use local variables instead of wire?
Why do you use local variables when the terminals are unused?
Why do you use 4 case structures when just one is needed?
Why put constant code into structures at all?
How will you ever iterate the outer loop when the inner loop never exits?
THINK DATAFLOW!
(Maybe you should start to take some of those free beginner courses offered by NI on their website? :))
Just to give an idea:
10-14-2016 02:12 PM - edited 10-14-2016 02:16 PM
Hey GerdW,
I appreciate the feedback and I agree my code is ugly. The four case structures were because the value "0" in the picture you attached changes depending on the "Measurement Type" chosen by the user. For the case of "IL", I put a 0 since the user should not have any reference level, but for the other options, I need to make the value positive or negative depending on "Measurement Type". I want the program not to care whether they input a positive or negative number to avoid an added level of confusion.
I found some threads on similar issues and think something like the attached photo should work for me.
Just want to reiterate that I do appreciate the feedback and I will be going through the beginner guides, but wanted to get some quick code going to help process improvements at work.
10-14-2016 04:16 PM
I think I figured it out. Thanks for the nudge, GerdW!
10-15-2016 03:35 AM
10-16-2016 12:12 PM
@GerdW wrote:Hi chopeter,
why don't you wire the "Ring" value directly to the case structure selector?
Better yet, replace the ring with an enumerated control (I8 representation) then wire THAT to the case selector. Then just groove to some Three Dog Night