LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reset graph

Solved!
Go to solution

Hi everyone! 

I am in an internship and I have to do a program for them. One part of this program is about being able to see a shot of pulses that we characterize on my program and each time a pulse time is changed, the visual has to be modified.

The numeric command you see here should work like this: TonX is a True in boolean and a ToffX is a false in boolean. A Ton and a Toff with the same number are forming a pulse.

Each shot of pulses contains ten pulses, so twenty numeric command.

I create a boolean array that get the state at a time, here each µs.

Then I send this to a graph with a maximum value in X as the sum of every numeric command to only see one shot of pulses.

An event structure help us to see when one of he timing is changed.

The problem I have in my program is that when I try to change the value of one Ton or one Toff, the graph attached to this program does not reset, so we saw the first shot of pulses generated and not the last one like I would like.

I have tried to set an empty array into the graph but it hasn't changed anything and I don't see any property node that could help me.

Does anybody have an idea on how I could be able to make this?

Thanks

0 Kudos
Message 1 of 4
(217 Views)
Solution
Accepted by topic author Murew

You are very close for what you are trying to do. You missed a couple of things. You need to initialize the inner for loop so that it clears every time when generating the 0 and 1 for the graph. You also need to change the tunnel on the outside for loop to concatenating. See the snip it below.

 

Example Graph.png

 

Tim
GHSP
Message 2 of 4
(191 Views)
Solution
Accepted by topic author Murew

Hi Murew,

 


@Murew wrote:

Each shot of pulses contains ten pulses, so twenty numeric command.


Simplified to just 2 controls:

You can also use a 2D array as input…

 

No need for all those local variables!

No need to use DBL datatype to set the number of loop iterations!

No need for the inner loop when there is InitArray!

You can also remove that "20" constant as we use autoindexing at the loop input tunnel…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 3 of 4
(185 Views)

Thanks @aeastet and @GerdW the two solutions works!

For now I would use aeastet solutions because I need to understand it well and have something that work and it will go perfectly fine and the value of Ton and Toff are used everywhere in my program for now but in a future, if I have time to change each bits of my program you can be sure that I will implement your solutions GerdW since it is drastically smaller. Thanks you two!

0 Kudos
Message 4 of 4
(156 Views)