From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY graph problem!

Hi,
I allready sent an e-mail to this newsgroup but no one could really help
me yet.
I want make a realtime presentation of an XY graph with some sort of
buffer of at least 100 XY positions: a trail, i'm aquiring data of
eye-movements and i want to display each eye in a XY-graph X =
horizontal movement and Y is the vertical movement but i don't want just
one dot on my graph but a trail of 100 points that fades out i do can
build it with a while loop and a shift register with 100 elements but i
think there is a better way but don't know which??

Any one!
Best regards Thijs
0 Kudos
Message 1 of 6
(2,887 Views)
I replied to this and suggested using a while loop with a single shift
register and an array of 100 points, rotating the array and adding the
latest point to the end of the array to create a buffer of as many points as
you initialise the array to, yet only using one shift register. What is the
problem with this approach?

If you really want it to fade out, rather than simply vanish after n points,
you have to be slightly more sophisticated than the XY graph and use a
picture indicator, but the buffering remains the same.

Thijs Boeree wrote in message
news:3A0FA763.D06FE6C3@amc.uva.nl...
> Hi,
> I allready sent an e-mail to this newsgroup but no one could really help
> me yet.
> I want make a realtime presentation of an XY graph with some sort o
f
> buffer of at least 100 XY positions: a trail, i'm aquiring data of
> eye-movements and i want to display each eye in a XY-graph X =
> horizontal movement and Y is the vertical movement but i don't want just
> one dot on my graph but a trail of 100 points that fades out i do can
> build it with a while loop and a shift register with 100 elements but i
> think there is a better way but don't know which??
>
> Any one!
> Best regards Thijs
>
0 Kudos
Message 2 of 6
(2,887 Views)
Hi Thijs,

I would like to let you know a way to use "Replace Array Elements".
You can set two initialized arrays involving 100 elements for
X and Y axis at the initial step before a while loop will begin
using "Initialize Array" and in every steps in the while loop
have these replaced by decreasingly indexing and put current
values into the last index of 100. And then, these two arrays
will be better input to XY-graph after changed to clusters.

Thijs Boeree wrote:

> I want make a realtime presentation of an XY graph with some sort of
> buffer of at least 100 XY positions: a trail, i'm aquiring data of
> eye-movements and i want to display each eye in a XY-graph X =
> horizontal movement and Y is the vertical movement but i don't want just
> one dot on my graph but a
trail of 100 points that fades out i do can
> build it with a while loop and a shift register with 100 elements but i
> think there is a better way but don't know which??

Hopefully has effects of your purpose.

Thanks,
--Tomoya ITO
--ito@rd.fujitec.co.jp
0 Kudos
Message 3 of 6
(2,887 Views)
There is an example that does all of this in a subVI. Its in the
Examples/General/Graph/Charts/XY Charts. There is a reusable subVI that
you can wire to any XY graph and make it a pretty good chart as long as
you have a reasonably small number of points and its bounded. In the
case where its not bounded and you want to keep the traces for a really
long time, the picture control offers a higher performance solution.

Greg McKaskle

> I would like to let you know a way to use "Replace Array Elements".
> You can set two initialized arrays involving 100 elements for
> X and Y axis at the initial step before a while loop will begin
> using "Initialize Array" and in every steps in the while loop
> have these replaced by decreasingly indexing and put current
> val
ues into the last index of 100. And then, these two arrays
> will be better input to XY-graph after changed to clusters.
>
> Thijs Boeree wrote:
>
> > I want make a realtime presentation of an XY graph with some sort of
> > buffer of at least 100 XY positions: a trail, i'm aquiring data of
> > eye-movements and i want to display each eye in a XY-graph X =
> > horizontal movement and Y is the vertical movement but i don't want just
> > one dot on my graph but a trail of 100 points that fades out i do can
> > build it with a while loop and a shift register with 100 elements but i
> > think there is a better way but don't know which??
>
> Hopefully has effects of your purpose.
>
0 Kudos
Message 4 of 6
(2,887 Views)
Mr.McKaskle,

I know there are probably appropriate examples in the library.
Every experimental VIs can be quickly built or revised
and tested on my PC. Any way, thank you so much for your
advises.

Greg McKaskle wrote:

> There is an example that does all of this in a subVI. Its in the
> Examples/General/Graph/Charts/XY Charts. There is a reusable subVI that
> you can wire to any XY graph and make it a pretty good chart as long as
> you have a reasonably small number of points and its bounded. In the
> case where its not bounded and you want to keep the traces for a really
> long time, the picture control offers a higher performance solution.
>
> Greg McKaskle
>
> > I would like to let you know a way to use "Replace Array Elements".
> > You can se
t two initialized arrays involving 100 elements for
> > X and Y axis at the initial step before a while loop will begin
> > using "Initialize Array" and in every steps in the while loop
> > have these replaced by decreasingly indexing and put current
> > values into the last index of 100. And then, these two arrays
> > will be better input to XY-graph after changed to clusters.

Thanks in advance,
--Tomoya ITO
--ito@rd.fujitec.co.jp
--mechanical engineer
0 Kudos
Message 5 of 6
(2,887 Views)
The attached .vi is a chart buffer that I use in my programs. You can set as many points as you want. You can also update it one point at a time or all at once. A true boolean expression will clear it.
Message 6 of 6
(2,887 Views)