Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do page faults occur when plotting data using CWGraph3D?

When plotting data using the Plot3DCurve method, page faults occur for my application. The arrays passed into this function are fairly large

Shown below is the VB code I use for plotting the data



ReDim LambdaArray#(1 To 22500)
ReDim iBackArray#(1 To 22500)
ReDim iFrontArray#(1 To 22500)


CWMirror3DGraph.Plot3DCurve iFrontArray, iBackArray, LambdaArray
0 Kudos
Message 1 of 3
(3,666 Views)
Have you tried the "Simple 3D Graph.vbp" example project in your C:\Program Files\National Instruments\MeasurementStudio\VB\samples\3DGraph\Simple 3D Graph directory? Does this example exhibit the same behavior? There shouldn't be a problem with using the size of arrays you have, if you modify the Simple 3D Graph example to use the same amount of indices it works fine.

Looking at the code you submitted, it appears as though you haven't initialized the arguments to Plot3DCurve, not that this is a problem but will in all actuality plot garbage on the graph. With this, I kind of question if there is something else in your program that is abnormal, because the code you posted doesn't really do much. Is the call to Plot3DCurve the line that the page fault occ
urs on? You might want to double-check just to see if there is anything abnormal happening with array manipulations, this is a common cause for page faults in any language.

So give the example I mentioned a try and narrow it down to some specific behavior that causes both this and your program to error out, and then post your conclusive results.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 3
(3,666 Views)
I actually did use the Simple 3D Graph sample to kick start my application. I do intialize the arguments and also set each array item in a loop. I did not show this code.

If you take the Simple 3D Graph sample and modify the Sub PlotCurve_Click() arrays xData, yData, ans zData to be Dim (0 to 20000) and run the exe, you can watch page faults occur every time you click the Plot Curve button. You can view page faults by viewing the Processes tab in the Windows Task Manager. You may have to add Page Faults in the View|Select Columns menu item.
0 Kudos
Message 3 of 3
(3,666 Views)