03-16-2009 09:28 AM
Hi All!
I need an help with the XY Graph component.
Let me explain my problem.
I have a VI that replicate on an XY graph the reading from a small touchscreen.
Basically, what is draw on the touchscreen appear on my VI.
I was able to do it by combining the X and Y readings into a single graph by means og a "Build XY Graph Express VI".
Also, through the enable pin of the Express VI, I can allow the XY graph to update only when a control signal for the touchscreen (think of it as
a sort of pen detect) is active.
Since everithing is done in a while loop, I used a linea interpolation for the graph.
Here it comes my issue: after plotting one curve on the graph, starting point of the next one is automatically connected to the last of the previous one by an interpolation line.
Is there some way to temporarily disable the interpolation, maybe just for one point?
I already tried
- using single point without interpolation, but the result is lousy since I see dicrete points that correspond to timed reading from the touchscreen.
- using property node to change the interpolation method depending on the pen detect signal. This does not solve since the previous plot disappear when the detect is 0 but
it reappers together with the next one when the detect is high again.
I hope I was clear enough..
any suggestion is really appreciated since this, apparently, simple problem is driving me crazy.
Thanks!!
Francesco
03-16-2009 09:35 AM
03-16-2009 09:50 AM
Sorry but I don't understand..
let's try: do you mean that there is the chance that NaN values are entering the graph?
Well, I guess that when the Build XY graph is not active, there are no data entering the graph.
Francesco
03-16-2009 09:51 AM
fradep wrote:...
Here it comes my issue: after plotting one curve on the graph, starting point of the next one is automatically connected to the last of the previous one by an interpolation line.
...
Expanding on Ravens Fan suggestion.
Append one additional value to the end of each of your plots that contians the value "NaN". A "NaN" can not be plotted (since its not a number) so the plotting code will "left the pen" for lines assocated with that value.
Just trying to help,
Ben
03-16-2009 09:53 AM
fradep wrote:Sorry but I don't understand..
let's try: do you mean that there is the chance that NaN values are entering the graph?
Well, I guess that when the Build XY graph is not active, there are no data entering the graph.
Francesco
No.
You should add a "NaN" to the end of each plot to froce the graph to lift the pen.
Ben
03-16-2009 10:07 AM
Hi Ben,
sorry my misunderstanding..
I am going to try as soon as my collegues will release the PC 😄 and I'll let you know..
thanks a lot
Francesco
03-17-2009 03:08 AM
Hi Ben!
I tried your suggestion, but it did not work.
I have made a conditioning on the pen_detect signal and when "true" I just pass the read value (it means that the pen was not raised up) while when "false" I pass a NaN constant to the Build Graph Express VI (both for X and Y values). Did I make something wrong??
thanks for the help
Francesco