03-09-2018 01:45 AM
Hello,
I know this may be very simple for any of you here. I am desperately needing help on this as mentioned in the subject.
The CSV file attached contains 84 iterations of 10 data (rows) in each iteration and 8 columns of data (from col C to J).
I want the Waveform Chart in the vi to display each new iteration until completed 84 iterations in every 50ms and the x-axis of the Chart should be displaying 0 to 10.
I also need to include a horizontal slider control as a purpose for the user to go back and forth (to select) which or any iteration number from 0 to 84 to be displayed in another chart/graph. Can anyone please suggest me where the control should be connected to?
Please have a look at the code and suggest me what to be done to achieve my aim.
and please help me understand. Any help would be greatly appreciated.
03-09-2018 05:39 AM - edited 03-09-2018 05:40 AM
1. You array manipulation is WAY too complicated. You can get the data you want just from that first Array Subset.
2. Turn off the autoscaling for the X axis and set it up so that it only displays the 10 samples. You also have a multiplier on your scale to supposedly turn it into ms.
3. Store the data in a shift register and use Array Subset to get the data from the iteration you want for your second graph.
03-14-2018 09:04 AM
3. Store the data in a shift register and use Array Subset to get the data from the iteration you want for your second graph.
Referring to the screenshot, when you said store the data in a shift register.. do you mean the data coming into the graph? and is it correct how I connected the shift register?
Where should the Horizontal Pointer Slider control "Access Iteration No." connect to? This is to display the data in second graph "subarray" according to the iteration number selected by the user.
Please have a look.
03-16-2018 06:03 PM
Would it work for you to use the slider as the input into the (N) terminal of your for loop? That way, only the number of iterations that the user is interested in would be processed.
03-16-2018 10:03 PM
Perhaps I've misunderstood what's you're looking for, but I think perhaps a separate loop would be the better choice. Connect the same data set to a While loop and use the slider to specify the index in the same way you use "i" in your current For loop.
You could use an Event Structure to handle the Value Change event of the slider, or just put a Wait function in your second loop to prevent it using all the CPU.
If you do use the Event Structure, be careful because I think a slider generates events many times per slide - this complicates processing significantly and might make either polling with a wait, or using the Mouse Up event more effective.
03-22-2018 04:45 AM
There is an error when I connected the slider as an input into the (N) terminal of my for loop. Its because I have two pointers in that slider, and the N only accept long data type.
Btw, I need to connect a constant (a number) to the N terminal too. So maybe is there another way where I can connect the horizontal pointer slide that has 2 pointers in it?
03-22-2018 04:56 AM
use the slider to specify the index in the same way you use "i" in your current For loop
Thanks cbutcher for your suggestion, but I don't understand in bold above. Can you please refer to my screenshot?
03-22-2018 05:57 AM
I mean that where you currently use 'i', you could instead connect the slider.
Something like this (code modified from crossrulz's snippet above)
You'd probably want to make sure that the slider had an integer representation, but otherwise this should allow you to move back and forth.
An improvement would be to use an Event Structure, but as I mentioned, this has additional complication if you use a slider.
03-22-2018 06:12 AM
Okay, I got what you meant now. But the problem is, my horizontal pointer slider has 2 pointers.
The slider is a cluster of 2 elements (long data type) and the array subset (sink) only accept long. How do I fix this error?
03-22-2018 06:54 AM