Google Answers Logo
View Question
 
Q: Opening NetCDF Data File from Visual Basic. ( Answered,   3 Comments )
Question  
Subject: Opening NetCDF Data File from Visual Basic.
Category: Science
Asked by: chemguy-ga
List Price: $25.00
Posted: 29 Nov 2002 17:06 PST
Expires: 29 Dec 2002 17:06 PST
Question ID: 116569
I want code that will open CDF files (the type used for large
scientific data transfer) from VB. I am not interested in translating
any code (JAVA, PERL or otherwise). Acceptable answers could include a
DLL and instruction on how to properly access it from Visual Basic
(not JAVA, Perl, or other languages).

Request for Question Clarification by mathtalk-ga on 13 Dec 2002 21:29 PST
Hi, chemguy-ga:

I posted a comment a week ago, pointing out some contact information
for someone offering a trial version of an "ActiveX" DLL.  Have you
checked this out for yourself?  Also, does Visual Basic in this
context mean VB6?

thanks,
mathtalk-ga

Clarification of Question by chemguy-ga on 15 Dec 2002 18:57 PST
Hey Mathtalk,
I posted a comment but wasn't sure that you would get that so I am
adding the same info as a clarification.

I can't use the software you pointed out as I will be in competition
with him or his brother. I am really wanting something that is open
source. I am just not proficient enough in Java to use the stuff I
have found but would go for well documented C or .Net.

Regards,

chemguy

Request for Question Clarification by mathtalk-ga on 16 Dec 2002 09:10 PST
Hi, chemguy-ga:

Thanks for the clarification.

Unidata provides both source code/makefiles for a Microsoft VC 6.0
implementation, and a binary (DLL) for version 3.5.0 (beta 3.5.1):

http://www.unidata.ucar.edu/packages/netcdf/faq.html#win  

If you are planning to incorporate NetCDF functionality into your own
commercial products, these would seem to be the right building blocks.
 Unidata appears committed to supporting the format in a forward
compatible manner (future software will read existing data files
provided you use their interfaces).

I'm not sure how to help without knowing more about the intended
application.

I would be interested to know more about your intended application,
e.g. the balance of data versus metadata required to support it,
whether you plan to be gathering data or analyzing it, etc.

Perhaps I could be of assistance in explaining how to make calls from
Visual Basic into DLL entry points written in C?  I could post some
examples of making these calls, but it would probably be better if you
identified some specific interface routines that you want to use.

You should also decide whether VB 6.0 or VB.Net is your target because
of the yawning chasm between these platforms.  So far there is very
little in the way of .Net libraries for NetCDF.

Nonetheless, if I were designing new software for the Windows
platform, the VB.Net stuff and an XML format would be attractive.  For
some work on transitioning from NetCDF to XML, see:

http://www.vets.ucar.edu/luca/netcdf/

best wishes, mathtalk-ga

Request for Question Clarification by mathtalk-ga on 16 Dec 2002 12:17 PST
Hi, chemguy-ga:

Google Answers objects on general principles to direct contacts
between clients and researchers.  If I post an answer, you will be
able to request clarifications to it for at least 30 days (actually,
indefinitely as things currently stand).  However if your concern is
to have confidential discussion of your software design, then this
forum would not be appropriate; see:

https://answers.google.com/answers/termsofservice.html

and esp. point 4. listed there.  See also:

https://answers.google.com/answers/faq.html#postemail

If you would like to request clarifications here, this is a non-issue,
but if you would like to correspond with me privately, you should
contact the editors at Google, explain the situation, and ask them to
supply me with the contact information.  The email address is:

answers-editors@google.com

regards, mathtalk-ga
Answer  
Subject: Re: Opening NetCDF Data File from Visual Basic.
Answered By: mathtalk-ga on 16 Dec 2002 16:28 PST
 
Hi, chemguy-ga:

The NetCDF library (source code and binary) is freely available for
downloading at Unidata, a multidisciplinary program center sponsored
by the National Science Foundation.  Software developed by Unidata is
licensed "as is" under the Lesser GNU Public License (LGPL) or similar
model:

[Unidata Participation Policy: Provision of Software]
(about 2/3rds of the way down the page)
http://my.unidata.ucar.edu/content/legal/participation.html

The NetCDF application is "copyrighted by UCAR and [is] intended to be
freely available with very minimal restriction."

[Unidata netCDF Copyright Notice]
http://www.unidata.ucar.edu/packages/netcdf/copyright.html

[NetCDF Copyright Agreement
http://my.unidata.ucar.edu/content/software/netcdf/copyright.html

Only limited support can be provided to individual developers, mostly
in the form of FAQs, mailing lists, and support archives (see
Participation Policy above).

As previously mentioned, I would start here for both source
code/makefiles to a Microsoft VC 6.0 implementation, and a binary
(DLL) for version 3.5.0 (beta 3.5.1):
 
http://www.unidata.ucar.edu/packages/netcdf/faq.html#win   
 
To build the library yourself, get the makefile:

ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-3.5.0.win32make.VC6.zip

and the source code:

ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.zip

First unzip the source code where you want it, preserving the
subdirectory structure.  Then copy netcdf-3.5.0.win32make.VC6.zip into
the netcdf-3.5.0/src directory, and unzip it from there. Read
WIN32_INSTALL.txt for directions on the commandline (nmake) build
process.  No Visual Studio project is provided because of
incompatibilities with directory structures for UNIX makefiles.

To use the pre-built binary, get the file:

ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-3.5.0.win32bin.zip

Of the online documentation links:

[NetCDF (Network Common Data Form)]
http://www.unidata.ucar.edu/packages/netcdf/docs.html

the most useful for C applications is this:

[NetCDF User's Guide for C, ver. 3]
http://www.unidata.ucar.edu/packages/netcdf/guidec/

There is Appendix C, Summary of C Interface, which shows the library
function declarations at a glance.  The single biggest difficulty in
making these calls from Visual Basic is dealing with the lack of a
pointer among Visual Basic datatypes.  The workaround techniques are
somewhat well known:

[HOWTO: Write C DLLs and Call Them from Visual Basic]
http://support.microsoft.com/default.aspx?scid=KB;en-us;q106553

[Passing VB Strings to a DLL Procedure]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconpassingstringstodllprocedure.asp

[HOWTO: Pass a String between Visual Basic and Your C DLL]
http://support.microsoft.com/default.aspx?scid=KB;en-us;q187912

The general idea is that Visual Basic tries to pass most things "by
reference" to an external routine, and so passes a pointer.  However
the String datatype in Visual Basic is already a pointer, so these are
to be passed "By Val".

Callback functions would be another "imponderable" but I didn't spot
anything in the user's guide that looked like one to me.

For more specific approaches we should probably pick a library
function or two to discuss in depth.

regards, mathtalk-ga


Search Strategy

Keywords: NetCDF copyright
://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=%22NetCDF%22+copyright&btnG=Google+Search

Keywords: NetCDF "source code"
://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=NetCDF+%22source+code%22&btnG=Google+Search

Keywords: "Visual Basic" "C DLL" pointer
://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=%22Visual+Basic%22+%22C+DLL%22+pointer&btnG=Google+Search
Comments  
Subject: Re: Opening NetCDF Data File from Visual Basic.
From: mathtalk-ga on 05 Dec 2002 14:08 PST
 
Hi, chemguy-ga:

Here's a thread from this past February:

http://www.unidata.ucar.edu/projects/coohl/mhonarc/MailArchives/netcdf/msg04031.html

which has a paragraph from Tom Grills about an NetCDF ActiveX
interface he's developed, usable from Visual Basic.  He invites
interested parties to contact him (by email, address given there) for
a trial version of the software.  You'll probably want to contact him
directly, although if you wish me to act as an intermediary, I would
be happy to do so as an "answer" to your question.

regards, mathtalk-ga
Subject: Re: Opening NetCDF Data File from Visual Basic.
From: chemguy-ga on 15 Dec 2002 18:53 PST
 
Hey Mathtalk,
Sorry about the delay. I cann't use his software as we will probably
be in competition with him or his brother. Unless he is offering this
with no strings attached.

 As to VB 6 or .net, either would work. I would even go for a variety
of C. I am just not proficient enough in Java to pull this off.
Subject: Re: Opening NetCDF Data File from Visual Basic.
From: mathtalk-ga on 16 Dec 2002 09:32 PST
 
Hi, chemguy-ga:

My impression is that the ActiveX interface is offered on a trial
basis for evaluation.  It may be that the software could be licensed
for use in a larger software application, but I don't get the idea
that it is offered without strings.

The C implementation of the NetCDF interface seems to be the benchmark
by which all other implementations are judged.  For documentation, see
here:

http://www.unidata.ucar.edu/packages/netcdf/docs.html

regards, mathtalk-ga

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy