LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clear the history of xy graph

Solved!
Go to solution

Hi, 

I am having difficulty to delete/reset the history of xy graph. My VI  and the needed subVI are attached..Any ideas would be appreciated

I tried three different ways: Connect the graph to a constant; Use initialize invoke node, command the reset terminal in the Built-xy-Graph, but none works correctly!!! 

thanks in advance

 

good day

 

Download All
0 Kudos
Message 1 of 10
(4,003 Views)

Hi Abo,

 

I am having difficulty to delete/reset the history of xy graph.

I don't see any place where you even try to delete this history in your subVI!
You need to write empty arrays into those shift registers holding your 1D arrays as they store your data…

 

Main problem here: THINK DATAFLOW!

It doesn't make sense to empty the data sink when the data source still holds the history!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(3,988 Views)
Solution
Accepted by topic author AboHareth

Actually, the initial reset is made three time, but none of them is really needed, as the graph is immediately filled with other data. The problem is that you keep adding elements to the arrays in the shift registers of the sub-vi.

Reset the shift registers content when the sub-vi is executed for the first time.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 10
(3,979 Views)

 

Hi GridW

 

 


You need to write empty arrays into those shift registers holding your 1D arrays as they store your data… 

you notice that the loop inside the subVI  will be executed only once, thus connecting the shift register to a zero would result in not remembering any old values and thus no graph will be shown (if you give it a shot, you will see). I actually need the history when VI is running, I only need to forgot it at the first iteration of the loop in the main VI which would allow the reset. 

 

It doesn't make sense to empty the data sink when the data source still holds the history!.

I see  my mistake, but still I have no idea how to reset the data source 

thanx


 

0 Kudos
Message 4 of 10
(3,967 Views)

@pincpanter

 

 HI, pincpanter,

 

First, I marked you answer as a solution by mistake. I do not know who to cancel that!!

 

Reset the shift registers content when the sub-vi is executed for the first time.

 

As i just said the subVI executes only once allowing us to remember old values. this resetting them result is no output for the VI

 

thanks

 


 

0 Kudos
Message 5 of 10
(3,964 Views)

Hi Abo,

 

I only need to forgot it at the first iteration of the loop in the main VI which would allow the reset. 

Yes, I know this.

You need to put some "reset" code inside this subVI. Whenever a reset-condition is met (either first run or an additional input) you need to write an empty array into the shift register!

A good place would be the case where you output an empty graph from your subVI…

 

As an example you could examine several of those Point-By-Point functions (in signal analysis palette), they most often also have an Reset (or Init) input!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(3,957 Views)

Hi GerdW,

 

I am sorry but I really can not see what you are saying is correct. I think resetting the shift register under any condition is not a solution, since it executes only once then there is no way we get a history if we reset it?!!

 

Can you please examine you idea in the VI?

 

thanks

0 Kudos
Message 7 of 10
(3,954 Views)

It does not execute once. It executes repeatedly until you press STOP.

So, when the sub-vi is called the first time in the While Loop, you need to reset all shift registers.

Add a Reset boolean input to the sub-vi to do this. The input should be true only when the loop index is 0.

In pseudocode: Reset = (Loop index == 0).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 10
(3,952 Views)

Hi Abo,

 

simple like this:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(3,945 Views)

Hi,

 

Thank you for your solution. I also did it in somehow similar way. it is attached for those how might have the same diffeculty

Download All
0 Kudos
Message 10 of 10
(3,942 Views)