- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am calling a Fortran dll from C#.
The dll is called from a single function call in C# (dllimport ...)
The dll produces data, which I want to access in real-time as and when it is generated in C#. However, the single function call will obviously only return the final answer.
How can I setup either the dll or the C# to give me data as I require? Do I need to make an additional function call in C# that gives me access to the dataor will the dll have to setup to send data back periodically? If so, how can I do this?
Your help is appreciated.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A somewhat novel approach you may wish to consider is to use Array Visualizer. AV can be used to handle hierarchal data collections and has bindings for both C# and Fortran. One advantage for your application is that you wouldn't need to pass the data from Fortran to C# (or vice-versa).Instead you would have the Fortran dll create a named data object ("foo" lets say). The C# code can then open "foo" and access the data.
An additional benefit of using AV to manage your data is that you can save the data hierarchy to a file (XML or HDF5) with one call. The file can be viewed with the Array Viewer program.
You could even have the Fortran code running on a separate thread (or even process) and have the C# code examine the data while the Fortran code is running in the background.
Anyway, if you are interested in this approach please post something on the Array Visualizer forum. It shouldn't be too hard to come up withC#/Fortran example program.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page