May 14, 2004

Making images from labview charts

I had a hard time figuring out how to generate an image from a chart in Labview. The supplied help pages were seemingly helpful, but difficult to decipher once you really try to read it. So, my pain, your gain, here's a tutorial.

Let's start with an arbitrary waveform, say sine.

  1. Open a new vi and right click on the block diagram. Choose Input and then Simulate Signal. Accept the default.
  2. Right-click at the Sine output terminal and then select Create followed by Graph Indicator. You'll generate the graph icon.
  3. Right-click the graph, and then select Create followed by Reference. This is the key.
  4. Right-click on the reference, and select Create, then Method, then Get Image. You'll generate a box labeled "WFGraph". Note that it isn't connected to anything.
  5. Connect the WaveformGraph to the upper-left hand corner of WFGraph.
  6. Connect the Error Out of Simulate Signal with the Error In of WFGraph. This is needed so that the image is generated after the sine is made, not before.
  7. Right-click on blank area and select All Functions, Graphics & Sound, Graphics Formats, and then your choice of graphic formats to write in. I prefer PNG myself. (Yes, it took a while to find these...)

    making_images.PNG

  8. Finally, hook up the image data terminals together, and you should be ready to go. Here's what the finished diagram should look like:

    making_images_block.PNG

Run it and you should be able to save something that looks like this:

making_images_sine.png

Beautiful, no? Size is dictated by the front panel size.

Posted by torque at 4:05 PM | Comments (4) | TrackBack