Table Of Contents

Previous topic

The File List Window

This Page

netCDF-SDK

This document describes how to read and write nc files with C.

Contents

The following files must be installed with your application. The files can be copied from a UniPlot installation Version R2011 or later. A 32bit and a 64 bit version is available. The file license.txt can be found in the UniPlot\samples\netCDF-SDK directory.

rs_nc.dll
rs_vcrt.dll
rs_updf.dll
rs_xlib.dll
rs_mdf.dll
license.txt

Other files from the UniPlot\samples\netCDF-SDK directory:

ncread.c            - A simple example how to read data.
ncwrite.c           - A simple example how to write data.
rs_updf_nc.lib      - The 32-Bit Import-Library.
x64\rs_updf_nc.lib  - The 64-Bit Import-Library.
up-nc.h             - The Header file.

Some Notes

  • The UniPlot-netCDF-SDK uses the netCDF 2.4 API.

    http://www.unidata.ucar.edu/software/netcdf/old_docs/really_old/guide_toc.html

  • The netCDF data files used with UniPlot can have three different formats:

    1. The original netCDF format as described in the link above. File size is limited to 2 GBytes. The first three characters in the file are “CDF”.

    2. A modified form of the original netCDF format with Intel byte order (Little Endian). These files cannot be read with the standard netCDF library. The file size is limited to 2 GBytes. The first three characters in the file are “CDH”.

    3. A UniPlot format that uses only the API of the netCDF library. The format supports compression and fast delete/add channel and attributes. The first three characters in the file are “UPD”. These files are similar to a file system. The data is saved in sectors.

      The file size is limited to 1 TB. Each channel can contain up to 2^31-1 data points.

  • If you use a Microsoft C-Compiler you can compile the examples with:

    cl ncread.c rs_updf_nc.lib
    

    The path for your C-Compiler must be set.

    Start the program with:

    ncread test.nc
    

    The example prints the first 10 data points of each channel. More test files can be created using UniPlot.

  • Instead of using the Import-Library rs_updf_nc.lib, you can load the functions dynamically using LoadLibrary, (LoadLibraryEx, GetModuleHandle) and GetProcAddress.

  • For some data file formats, for example INCA-MDF, UniPlot saves the data in the netCDF file with a delay. The file contains the complete structure with all attributes and channels. The channel data is saved in the netCDF file, when the channel data is accessed.

    To check if the data is already saved in the netCDF file read the value of the channel attribute _nc_dl_loaded. If the attribute has the value 1 the data is valid.

History

Version Description
1.1 (25.03.2011) Writing added.
1.0 (21.03.2011) First version.

Contact

If you have any questions please contact us:

Uniplot Software GmbH
Am Seekanal 16
15834 Rangsdorf
Germany
Tel.: ++49 (0)33708/73754
Fax: ++49 (0)33708/73755

id-1961936