Jump to content

Uneven strip chart


Recommended Posts

QUOTE (Raymond Tsang @ Aug 20 2008, 06:23 PM)

I'm making a strip chart (actually consists of 3 overlaid strip charts) which has uneven time intervals between data points. That means the 1st and 2nd points may be separated by 2 sec, but the 2nd and 3rd by 1 sec, and so on.

I have been exploring XY graphs, but it seems I can't overlay graphs.

Any suggestions?

Thanks in advance!

Ray

If you turn on context help Ctrl-H and hover over the BD icon for the XY graph it will show you the data structure needed to produce multiple plots on one XY. graph.

Link to comment

QUOTE (mross @ Aug 21 2008, 06:36 AM)

If you turn on context help Ctrl-H and hover over the BD icon for the XY graph it will show you the data structure needed to produce multiple plots on one XY. graph.

Thanks! Got it.

But... because I'm taking data every second (or 0.1 sec), so every second, I have to pass a huge array through shift register, and put in one new entry. Is there a function in XY graph, where I can add a new point in every iteration?

Ray

Link to comment

QUOTE (Raymond Tsang @ Aug 21 2008, 08:53 AM)

Thanks! Got it.

But... because I'm taking data every second (or 0.1 sec), so every second, I have to pass a huge array through shift register, and put in one new entry. Is there a function in XY graph, where I can add a new point in every iteration?

Ray

The default buffer for a strip chart is 1024. That is hardly huge.

I have tried passing 50-100K pts without struggling.

Obviously the user can only see so much resolution anyway!

What is your definition of huge?

Sample rate x "time needed to be displayed" = on-screen buffer size

Do you need to write a point at a time to the screen or can you update the screen in chunks?

Do you need to write every point to the screen or can you decimate the array?

Link to comment

Just use a Waveform Chart.

When you present data as a Waveform datatype the chart looks at the "t0" value to determine where to plot the point.

It allows you to plot multiple traces all having differnt "t0" values that are not periodic.

Gotchas?

Changing the number of plots shown will reset the chart.

Present data that is earlier than data already plotted will reset chart.

History is in units of WFs not data points (in the event you have WF's with multiple "y" values).

Try it, you'll like it.

Ben

Link to comment

If you want to avoid having memory problems, you need to replace and rotate the array. There is actually a shipping example of this, but it's not very nice (it uses a local variable), so I created a quick one myself once and you can find it here. Just for the fun of it, here's another version of it which creates a vertical chart.

Link to comment

QUOTE (Yair @ Aug 21 2008, 10:30 PM)

The first didn't work, broken arrow. The second one is fine but this is just doing what i called "manipulations of a huge array".

QUOTE (neB @ Aug 21 2008, 07:56 PM)

Just use a Waveform Chart.

When you present data as a Waveform datatype the chart looks at the "t0" value to determine where to plot the point.

It allows you to plot multiple traces all having differnt "t0" values that are not periodic.

Gotchas?

Changing the number of plots shown will reset the chart.

Present data that is earlier than data already plotted will reset chart.

History is in units of WFs not data points (in the event you have WF's with multiple "y" values).

Try it, you'll like it.

Ben

I'm not sure if i understand your suggestion correctly... Are you saying that I can treat individual points as separate plots with different t0?

Afaik, there is only one t0 value for each plot, right? May I have a screenshot?

Ray

Link to comment

QUOTE (Raymond Tsang @ Aug 22 2008, 12:46 AM)

The first didn't work, broken arrow.

So? Just fix it. It's a simple enough example.

In any case, both cases were just quick examples and quite possibly have bugs, etc.. I can't look at the code for either at the moment, but they should demonstrate how to handle the array "in place" by replacing and rotating. This should have good performance, as you're only allocating the memory once (or twice, since it's also going into the indicator, but you can't avoid that).

Link to comment

QUOTE (Raymond Tsang @ Aug 21 2008, 05:46 PM)

The first didn't work, broken arrow. The second one is fine but this is just doing what i called "manipulations of a huge array".

I'm not sure if i understand your suggestion correctly... Are you saying that I can treat individual points as separate plots with different t0?

Afaik, there is only one t0 value for each plot, right? May I have a screenshot?

Ray

When you get a broken arrow you need to investigate its cause and see if you can fix it. Pick on the broken arrow and you get an error summary. If you pick on an error in the summary it will take you to the instance and location on the BD where the error occurred. The summary will provide information about what is wrong and ways to fix it.

This is a very good system and you must try to use it. If you have trouble fixing a particular error. At least copy the information in the error summary and describe the step you took to try and resolve the problem.

You will find that this a very instructive way to learn the proper use of LabVIEW.

Mike

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.