Need a simple AV sample for windows

Need a simple AV sample for windows

9 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

If you're looking to display the Avis2D control in a dialog window, there's a certain amount of complexity that comes from using an ActiveX control with Fortran. Of course, since you are creating your own dll you'll just need to deal with the ActiveX control issues once.

On the other hand, if you want to display the Viewer (rather than a control in a dialog), you should be able to use the same fagl/fav calls that a console app would use.


I tried putting together a simple app by converting the sample ANIMWIN32 into a plain static plot. started with a simlpe dialog project template, and added the necessary calls from ANIMWIN32. Things went smoothly in construction but in the end I could not get it to show the data, only the coordinate axes.

If you or anyone else cares to help, this very simple project is at:

The AV doc's are rather terse. I was baffled by a number of things:
1.What is the diffrence between FAGL and FAV?

2. Why does ANIMWIN32 uses some calls to FAGL and some others to AVIS2D Activex? e.g. FAGLstartWatch and FAGLendWatch, are these redistributable? if not what are the equivalents in the activex?

3.Do $DAvis2D_Update(hAvis2D1, status) !faglUpdate(dataArray, status) do the same thing? ANIWIN32 calls both of them to get an update.

4. and MOST impostantly why does the data not show up in my super simple app?

Any help will be most appreciated.

Hi Tim,

I think the problem is due to some odd property values for the control that were initialized from the resource file. I added a couple of lines in your setup routine to set the graphtype and graph style correctly:

if(AUTOSetProperty(hAvis2D1, "FileName", sharename)  /= 0) return
if(AUTOSetProperty(hAvis2D1, "GraphType", 1)  /= 0) return
if(AUTOSetProperty(hAvis2D1, "GraphStyle", 1)  /= 0) return

Try it out with this change, it seems to work ok.

In answer to your other questions:
1) The FAGL routines provide a set of basic functions that provide the bare minimum for getting some data on the screen. The FAV routines are for the most part wrappers to the Avis2D properties/methods. The FAV routines are only used when Array Viewer is invoked, so don't pertain to your program.

2. The fagl calls are used to manage a list of arrays that can be viewed using Avis2d (or AvisGrid, or the Array Viewer). If you use the Avis2D.CopyArrayData() method, you don't need to use the fagl calls, but then you'll need to do a data copy everytime the array is updated (which might be some overhead for a really large dataset). The fagl/fav library is redistribututable (i.e. AVIEW160.dll).

BTW, in AV2.0 I've done away with this dll. There is still a set of library routines, but it is a static lib, so they get linked in with your application.

3. Avis2D_Update tells the control the data has been modified and it needs to update its display.
faglUpdate is used to copy the array data to a shared-memory area accesible to the control. Since you are declaring your array with the array_visualizer attribute, i.e.

real(4), allocatable,public :: dataArray(:, :)
!DEC$ATTRIBUTES array_visualizer :: dataArray

you don't need to call faglUpdate.


Well, I hate to be a pest, esp if you say it should work. But since I do not know what settings you determined to be "odd" I have to ask again.

I added the 2 lines
if(AUTOSetProperty(hAvis2D1, "GraphType", 1) /= 0) return
if(AUTOSetProperty(hAvis2D1, "GraphStyle", 1) /= 0) return

But it still does not plot anything. just the axes.
The changed project (including the new lines) is at the same spot as before:

btw if it is a hint, the app does not recognize clicking on the X-close button which also baffles me.

Will appreciate your looking at it again.

I downloaded your program again, and it worked fine after a re-compile. I've attached a screen shot.

I did notice in your wintestSub routine, you are calling AV_allocateArray, AV_setup on dlg_destroy. You should add a return after PostQuit, i.e.:

if (callbacktype == dlg_destroy)   then
call PostQuitMessage(0)	

Not sure why the X button doesn't work. It works fine in the AnimWin32 sample.

Looking at your exe, I see you are linking against aview120.lib. Please upgrade to AV1.6 and see what effect that has.


Thanks John,
Is there an easy way to upgrade from v 1.5 to 1.6?

Also why are there no labels on the x or Y axes?
They should range from 1 to 30.


I don't know of any easier way to upgrade to 1.6. Steve will be able to help you with that.

For axis labels set the XNumMajorTickmarks and YNumMajorTickmarks properties to something other than 0. 30 might be too crowded, but 15 works well.


The CVF 6.5 to 6.6 upgrade also upgrades AV to 1.6.


Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today