04-11-2015 09:12 PM - edited 04-11-2015 09:17 PM
hi, i have problem with my program. when i want to compare legend graph with my present graph it just overwirite with my present graph.when I add new data then execute my program it doesn't work. i was trying use shift regoster but my program eror. where i should put shift register in my program ? thanks
Solved! Go to Solution.
04-11-2015 09:35 PM
If you want advice about your program, don't show such a small piece that nobody can really help you.
04-11-2015 09:47 PM
i'm sory., thos is my program
04-11-2015 10:25 PM
You have two data files that you want to read, one when you push the Start button, the other when you push OK Button 2 (note that it doesn't matter in which order you push the buttons). You have a graph that will display 2 traces, with one trace "loaded" from Input Data, the other loaded from Input Data 2.
Ask yourself what varies, and what stays constant. One answer, it seems to me, is the trace -- initially both traces are 0 (or empty arrays), and when each button is pushed, one of the two traces is made from the Input Data, calculations of eigenvalues and vectors, and some final manipulations that you now are doing outside the Event loop (why? bring it inside with the rest of the calculations). Seen in this light, you need two Shift Registers, one that holds Trace 1, the other that holds Trace 2, both initialized outside the While loop with empty traces, and both combined with Build Array just before displaying the graph.
A note on Front Panel Boolean Controls and Event Structures. Your Boolean controls are all set with Latch when Released to act as "momentary push buttons", i.e. once you let go of the mouse, they "pop up" again. For this to work, they need to be read. The usual way to do this is to put the switch inside the Event case that it controls, usually wired to nothing. You know what its value has to be (True, since once you read it inside the Event, it will "pop back" to False), after all ...
Bob Schor
04-11-2015 11:28 PM - edited 04-11-2015 11:29 PM
I have edited my program . but I still can not to display two graphs .i'm still confuse with " you need two Shift Registers, one that holds Trace 1, the other that holds Trace 2, both initialized outside the While loop with empty traces, and both combined with Build Array just before displaying the graph." cause i try both the graph didn't change anything. perhaps you could edit my program ?
04-12-2015 01:04 AM
First of all, your code does not contain a single shift regsiter. Show us what you tried..
I would strongly recommend to first do a few LabVIEW tutorials.
04-12-2015 03:22 AM
thanks for your correction, i'm newbie in labview program. sory if my program looks so bad. i have edited my program with shift register, but it still not show legend graph with difference color. what next should i do ?
04-12-2015 09:56 AM - edited 04-12-2015 10:00 AM
The shift register belongs on the outer while loop. There is no need for the inner while loops. The shift register should contain an array of two xy plots. Replace one of the two plots accrding to the button pressed using "replace array subset".
You only need a single shift register, You still have way too much code.
(Please attach VIs with a suitable name. My donwloads folder already contains dozends of "untitled x.vi" files)
04-12-2015 11:01 AM
I absolutely agree with Altenbach that you need to learn more LabVIEW, and think more about Design and Style. I endorse taking the on-line tutorials, paying particular attention to the form and format of the examples that they illustrate. Try to emulate their simplicity.
However, in an effort to get you on the right track, here is what I was trying to get you to do in my earlier post.
The Event structure is contained within a While Loop that builds and displays the Graph. The job of the Event structure is (among other things) to generate the data for the First Plot or for the Second Plot when a button is pushed. The data are carried on the two shift registers shown here, and are combined to make the plot. They are initialized to empty arrays outside the loop. Notice that the Boolean Control that "controls" the Event is located inside the Event loop -- when you take the Tutorial that covers Event structures, you will learn why this is done (I also mentioned this in my previous post).
Altenbach is right -- you do not need two Shift registers, as you could do the Array build/updates inside the Event. "You Pays Your Money and You Takes Your Choice" -- I thought doing it this way was easier to state, and hoped that you would "get it" more quickly.
Bob Schor