05-09-2018 05:44 AM
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
Solved! Go to Solution.
05-09-2018 06:09 AM
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!
05-09-2018 06:21 AM
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.
05-09-2018 07:02 AM
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
05-09-2018 07:06 AM
@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
05-09-2018 07:13 AM
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!
05-09-2018 07:32 AM
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
05-09-2018 07:41 AM
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).
05-09-2018 07:51 AM
05-09-2018 07:53 AM
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