Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save text data in png form in measurement studio 8.1 for visual basic 2005?

I am using measurement studio 8.1 and I am devoloping program in vb 2005. I wanted to save 2D array (Double data type) to hard disk. I converted this numeric data to string and saved as a text file. But it takes lot of disk space. I had solved this kind of plroblem in Labview by using "write to PNG" vi. Is there any such functionality available in measurementstudio?

Please help me...

Thanking you..
0 Kudos
Message 1 of 6
(4,236 Views)
Hello Alavu,

One of the methods that the National Instruments Graph provides is the ToFile method.  You can use this method to write an image of the Graph control to a file.  I have included a simple code snippet below that demonstrates how to use this functionality to export a PNG file.  This example assumes that you have a Graph control named myGraph created and populated with the data that you would like to export to your image file.

myGraph.ToFile("C:\\test.png", ImageType.Png)

Please let me know if this does not answer your question!
0 Kudos
Message 2 of 6
(4,220 Views)
But this function just saves the screen shot of the display. I want to retreive the saved data from the image file. I am looking for visual basic component equivalent to "Read PNG.vi" and "Write PNG.vi" in LabView.

expecting your valuable suggetion....


Thanking you
0 Kudos
Message 3 of 6
(4,215 Views)
Hello Alavu,

The "Read PNG.vi" and the "Write PNG.vi" VIs are simply converting the PNG image file to a pixmap.  The "Read PNG.vi" does not read the PNG in and convert that to it's original data, it only converts the PNG into a pixmap that is suitable for drawing in a picture control.  This pixmap is a set of data that describes the graphic, not of the data that is represented by the graphic.

This pixmap simply contains information such as the color depth, an array representing the physical pixels in the image (not the data), etc...  This does not in any way describe the actual data that is represeneted by the graphic.  There is no straight forward way to embed the data into a PNG, in either LabVIEW or in Measurement Studio.  If you are simply looking for a way to store your data in a binary representation in order to preserve disk space, you might look into using the TDM file format instead.


0 Kudos
Message 4 of 6
(4,194 Views)
Thank you Mr. Jonathan C for your kind reply

Can you explain more about TDM file format?


0 Kudos
Message 5 of 6
(4,185 Views)
Hi Alavu,

NI TDM (Technical Data Management) file format is a structured, search-ready format that utilizes XML to manage a wide range of attributes associated with each data file. The TDM format is designed to capture and manage all the important information surrounding a measurement or simulation, assuring that the data is self explanatory, reusable, and requires no additional explanation to recreate the conditions in which it was captured.

The TDM file format specifies that descriptive information such as comments, units, and channel names are saved in a header file with the extension TDM, while the measurement, simulation or analysis results are saved in one or more binary file(s). The TDM and binary files are linked through references that are created automatically when using the LabWindows/CVI DIAdem Connectivity Library, LabVIEW Data Storage VIs, or programmatically when using the TDM Header Writer C API.

I have included a few links below that discuss TDM in more depth.  In order to leverage the TDM file format in Visual studio, you will need to utilize the TDM C-DLL that is linked at the bottom of the first page listed below.

0 Kudos
Message 6 of 6
(4,165 Views)