From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY multiplot cluster and shift register

I have the structure that is shown in the figure. (only main structure of the program, nothing inside it).

 

I want to make a multiplot by making several xy point cluster indexed in a for loop, this plots are obtained in the main program )outside the for loop shown in the figure). Once I haver those plots, i want to send them all to the next iteration in orter to stop xy grahp re-plots if ther are no changes to be ploted  (by indexing the clusters in the for loop). My problem is that the starting constant of the shift register wont let me execute the for loop, what am i doing wrong?

 

If I direcly wire the new generated plots in every iteration, it does not matter if they have new information or if they remain the same, the xy grahp does a replot and slows down the program. How can I stop they xy grahp from updating without passing the last values throug a shioft register??

0 Kudos
Message 1 of 9
(3,060 Views)

Please attach your VI. Pictures are pretty useless.

 

Your descriptions is not clear at all.

 

You seem to autoindex on an empty array. That won't get you anywhere. (FOR loop will iterate zero times)

What data is contained in the local variable? Where does it come from?

What's in the FALSE case?

0 Kudos
Message 2 of 9
(3,048 Views)

The vi is big and prty hard to folow rigth now.. that´s why I made that structure. But yes, my basic problem is that for loop iterates 0 times. In the false case we select the other wire to xy grahp 2 (wich simbolize new plots coming from main program that we want to plot or not to plot depending on case structure, so when true = pass value of shift register to xy grahp. True case would be "do not re-plot" and false case would be "re-plot" (inside false case there is a lot of decimate array by max min alorigthm stuff).

0 Kudos
Message 3 of 9
(3,032 Views)

@u4847 wrote:

The vi is big and prty hard to folow rigth now.. that´s why I made that structure. 


Then attach the smaller VI you just made. I would recommend you stat with a few basic LabVIEW tutorials. I don't understand the purpose of the FOR loop and  why you are even autoidenxing on it?

0 Kudos
Message 4 of 9
(3,021 Views)

You have not said why you want a for loop that iterates zero times. Be aware that when a for loop iterates zero times the outputs are all set to default values. So the output will be an empty array of XY plots. Thus on the next iteration and on all following iterations the result will be exactly the same.  So, this loop will do nothing forever. 

 

Please show us the real program.  

 

Possibly you need to initialize the shift regsiter wit an array of the largest size you expect and use Replace Array Subset inside the loops to avoid the zero iteration issue.

 

Lynn

0 Kudos
Message 5 of 9
(3,007 Views)
0 Kudos
Message 6 of 9
(3,005 Views)

I want to do this thing, but with multiple plots (see .vi on this post, this time its eassy to folow it xP)

0 Kudos
Message 7 of 9
(3,000 Views)

Forgot to upload

0 Kudos
Message 8 of 9
(2,999 Views)

- Local variables can lead to race conditions and it very likely that your VI has some. Use wires and shift registers.

 

- Value property nodes are slow and force operation in the UI thread.  Since the terminals are on the same block diagram (BD), just wire the values. You will have much less code.

 

- Excess bends in wires and wires running behind other objects make it very difficult to read code.

 

- Style guidelines recommend keeping the size of the block diagram to one screen. Scrolling around to find things wastes programmer time, makes the code difficult to read and can make troubleshooting very hard.-

 

- Sequence structures are rarely needed in well-written LabVIEW code. Most of yours appear to be unnecessary. Use dataflow to determine the order of operation when needed.

 

- Use subVIs for repeated code. It reduces the size of the block diagram, makes testing code as you develop subVIs easier, reduces the chances of making mistakes when duplicating and connecting the repeated code, and makes it much easier to make changes or to fix bugs.

 

I removed all the G1 Buffer local variables. I used shift registers on the loops to pass the values. The connection to the code at the bottom of the BD is wired to the left terminal of the shift register.  This may produce different performance than the original due to the race conditions. There is no way to tell whether the globals in that section are read before or after some of the other globals were written.  This version clearly defines which values are used.  I do not have the database VIs so I cannot test anything.

0 Kudos
Message 9 of 9
(2,938 Views)