05-12-2021 07:51 AM
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
Solved! Go to Solution.
05-12-2021 08:12 AM
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.
05-12-2021 08:16 AM - edited 05-12-2021 08:19 AM
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…
05-12-2021 08:46 AM
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!