Jump to content

Modern(-ish) picture plots


Recommended Posts

I have an application that records video and DAQ data at the same time. The user clicks the record button, then does their stuff, then clicks the stop button.

 

Now I want to generate an output AVI that displays the graph data side by side with the recorded video. (I have the DAQ data in a TDMS and the video saved in a temp AVI). My problem is, how do I get an image of the graph?

 

Here are the solutions I've come up with:

1. Have a graph control in a separate VI. Set the graph to the DAQ output, then use the "Get Image" invoke node to get an image

Pros: Looks great. Easy

Cons: Heavily uses the UI thread.

 

2. Have a graph control in a separate VI. Set the graph to the DAQ output, then use the "Export Image" invoke node to get an image

Pros: Slightly faster than option 1. Easy

Cons: Heavily uses the UI thread, Doesn't look particularly great (but not bad). Only slightly faster than option 1

 

3. Use the Picture plot toolkit

Pros: Does not use the UI thread

Cons: Looks terrible. A lot of work to get looking decent. Looks like no one at NI has looked at these in a long time (they use deprecated subvis).  VIs aren't reentrant so cannot parallelize.

 

Here's what I want:
A decent looking plotting package that I can run in a paralleized for loop.

 

I'm currently using option 1, and it takes forever to generate the video (2x-3x the length of the video @ 15 FPS). I can't paralellize it because it uses the UI thread. It also noticeably affects the program when running in the background.

 

Does anyone know of another LabVIEW way to accomplish this? My only other idea would be using the .NET, which would step up the difficulty significantly, but maybe get me the performance I need.

Link to comment

Have you looked at using a 3D Picture control?  It shouldn't be too hard to set up a 2D graph using it, and it has a "Render To Image" method which seems very fast.

 

Overall I agree, graphical output in LabVIEW is fragmented and inconsistent (and ultimately frustrating).

Link to comment

That performance is worse than I'd expect. Yes, LabVIEW is terrible at image manipulation, but I don't quite expect that level of awfulness.

I do something similar to your first two options but rather than generating a video I make a (large) collection of images to disk. I've never timed it but it can dump a few hundred PNG files in a reasonable amount of time (a few seconds maybe?). This includes the LabVIEW logic to render the picture layers with the native picture API (*cough*).

What dimensions are we talking about?

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.