01-03-2013 09:26 AM
I have this small pieceofcode ,nowi want to replace this small code of mathscript with for loop/(any other way also if possible)
How should i do
01-03-2013 09:31 AM - edited 01-03-2013 09:36 AM
It looks like it is creating an array of values from 0 to 1 with a step of .005. Is that correct?
Take a look for the "Ramp Pattern" function. It will do the same thing.
To do it with a loop ...
01-03-2013 11:14 AM - edited 01-03-2013 11:36 AM
I agree that the ramp function would be best.
If you want to use a loop, Typically a FOR loop is best. With the while loop you might get some surprises due to the limitations of floating point.
You should also make yourself more familiar with the basic labview palettes. Your (value times -1) and (zero minus value) can both be replaced by a "negate" function. These operations are commutative, so it is more efficient to negate the multiplier instead of the large array, right?
You also need to learn the difference between a graph and a chart. In my opinion, a chart is not the correct choice here. Use a waveform graph. I would also recommend to keep consistent front panel style. Don't randomly mix classic and modern controls.