10-08-2018 05:12 AM
Here is my attached VI. I have an array of elements which I get with some random numbers in the beginning since I am lazy to create one myself, so that part is not important. The part that is important is what comes next. When I select a value from the array using the index and click add element it adds to an array that will show in the waveform graph. Similary when I press delete then it deletes the value which we have selected. My program is currently working as I wanted and I have used your suggestions to create this code. Now please go through it and see if anything is wrong with the code or whether anything can be done to make it better. Currently I am able to add and remove elements according to my wish, which is what I have been trying to do. But I see there is another problem, i.e the array of elements are shown as 1 in the waveform chart. Is there any way where I can show different values of the array as different waveforms in the waveform chart. Thanking You.
10-08-2018 05:33 AM
10-08-2018 05:49 AM
attached as requested
10-08-2018 07:49 AM
Hi govind,
- when you want to prepend a new element to your array you should use the BuildArray function instead of InsertIntoArray!
- what's the point of that inner FOR loop? Remove it!
- I recommend to use a shift register in favor of the feedback node to get a better overview (aka THINK DATAFLOW) of your block diagram. (Using the shift register you don't get backward wires…)
- it would help to initialize the array shown on your chart…
- it would help to use an event structure instead of your polling loop…
Some of those suggestions:
10-08-2018 08:16 AM
Thank You very much