List readers


This is something that we have all had to put up with for many years and I don't see NI solving it in the future. Surely the most popular plotting technique is with an XY graph as we all don't simply plot against time. I am guessing there is a fundamental problem with only adding one extra point at a time - although maybe Greg Mc will let us in on the secret.

Alvin is correct the LV2 style global is the way to go and I have successfully been using it for many years now. It is really up to the programmer to limit the number of points on the screen to a realistic number - this will I'm sure be able to be plotted by modern pc's (or mac's) without any grief. If you need more historical data then simply write to another buffer an average of 10points (100 points etc) in history to show in conjunction to your current high resolution data.

Craig - below is an email reply I received from Greg McKaskle a few years back with regard to transparent objects.

If anyone wants a copy of a circular LV2 style global buffer, it is most probably on NI's site or email me and I'll forward. (I did not write it - only a grateful user of it)

wayne

-------------------------------------------------
From Greg McKaskle

Maybe I can explain it. When LV controls or indicators change their
value, the objects, like the Boolean are messaged with the old and
new value and told to update the screen. So, as quickly as possible,
turn yourself from the old data value to the new data value.
Now a little tangent that may be obvious to some, but I suspect it is
new to at least some people. LV panels, and computer windows in
general work like a painter's canvas. You can only work on top of
what is already there. Painters typically paint a scene from front
to back because that is the way paint, chalk, and most art materials
work. It is hard or impossible to paint the mountain range behind
the trees, then the sky behind the mountains. Instead you paint the
farthest object and work your way forward overlapping things in front
on top of the background. Computer graphics at the fundamental level
work the same way. If I place a red circle on top of a green square,
then it becomes pretty difficult to change the color or location of
the square without painting over the circle. There are some tricks
dealing with regions or flood-fill algorithms which will work in
specific instances, but in the most general case, what you do is
redraw the square, then put the circle back on top by repainting
it too.

This repainting of other objects is where the extra exense comes from
and is what slows down the updates. If an object is pretty much on
its own and can draw straight to the screen during this message,
things work fine and the drawing is fast.
There are two things that can slow this down. One is overlapping
controls, the other is transparency, or more generally, controls that
are not opaque.

Overlapping causes problems when the object on the bottom gets the
value change message. If it were to draw straight to the screen, it
will burn through, drawing on top of the other object. So instead,
the object beneath has to arrange for itself and all objects above it
to be redrawn. This takes more time in general, and depends on what
is above it as all controls do not draw at the same speed.
Transparency and non-opaque controls are slower when they have to
erase things. It is easier to look at a slider as an example here.
When the value changes on a slider, it has to move its thumb from
the old position to the new. If the thumb of the slider is totally
contained by what we call the housing, the colored background portion
of the slider, then the slider can always redraw a portion of the
housing to erase the old thumb position and then draw the new thumb
position in its new location. Now what about a thumb that extends
beyond the housing. If the housing looks like a small groove that
the thumb is sliding in and the thumb is a bigger pointy triangle,
then redrawing the housing doesn't erase the thumb. You now have
to know what is behind the slide and redraw that in order to erase
the thumb. Similar to the overlapping, getting multiple objects
to redraw is slower than drawing a portion of one object.

The transparency case is similar to the non-opaque slider. If a
numeric or string is transparent, then the text is drawn on top of
whatever is behind. The numeric or string has to ask those objects
to redraw since it isn't able to know what they drew.
So in general, overlapping objects is cool, and transparency is cool,
but it does complicate the graphics when things need to animate.
If the things you are overlapping are static, they are cheap. When
they need to redraw, such as when a value changes, you have to pay
the price.




At 05:02 PM 11/05/2004 -0400, [EMAIL PROTECTED] wrote:





John, and the list.
      There is a pretty good workaround for achieving this, I think it was
originally from Gary Johnson and was one of the example vi's in his first
book. Basically you create a buffer in a LV2 style global, and initialize
the buffer to either all NaN values (which don't show on a plot) or all to
the first data point. Then, as new points come in (in typical usage you use
two loops - acquire and write to the buffer in one loop, and read from the
buffer and display in another), you replace points in the buffer and rotate
the new points to the end. The end result is you replot your entire buffer
each time (not what you want) but it looks like you are just adding points
as new data comes in. It gives you an xy plot that acts like a strip chart,
with points being added in, and you have access to the "history" because
that is the data in the global. So, if it's asthetics you are after, this
helps. If raw speed is the goal, then maybe not. Maybe faking it with a
picture control is the better option there.
Hope this helps,
Alvin

Alvin W. Moore Jr.
Measurement Systems Programmer
Research, Development, and Engineering
Corning Cable Systems
Hickory, NC



---------------------------------------------------------------------- Wayne Galbraith School of Civil and Resource Engineering The University of Western Australia 35 Stirling Highway Crawley 6009

Tel - (08) 6488 3788
email - [EMAIL PROTECTED]
www.civil.uwa.edu.au/nata
----------------------------------------------------------------------







Reply via email to