DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Data points "dropped" by DPlot when passed from Ex

 
Post new topic   Reply to topic    DPlot Forum Index -> Excel
View previous topic :: View next topic  
Author Message
eha



Joined: 07 Jul 2010
Posts: 2

PostPosted: Wed Jul 07, 2010 4:27 pm    Post subject: Data points "dropped" by DPlot when passed from Ex Reply with quote

I am sending 3D data points to DPlot from Excel using DDE. Perhaps it has something to do with the fact I'm using the trial version, but every now and then some of the data points that are passed from Excel do not get picked up by DPlot. This is especially mysterious because between executions of the Excel macro I'm not changing any of the source data or any other input since right now I'm just testing the functionality. When some of the data is lost, DPlot does not display the plot as commanded by the macro - only a blank window. But if you go to "Edit Data", then click "OK", then the plot of the remaining data magically appears, though all of the customized display paramters set by the macro are disregarded and are back to the defaults.

While troubleshooting, I noticed that if after all the data is passed I delay the display of the plot for long enough for me to click "Buy Later" on the trial version pop-up, then data is almost never lost. If there is no delay to allow the user to kill the pop-up the results vary from run to run.

I had a co-worker use the same Excel file and his own trial version of DPlot, but no matter how much time he allowed to kill the pop-up, at least some data points would always get dropped, though the number varied somewhat between attempts. We tried many different techniques to see what was happening, but all we know for sure is that all the data IS getting passed from Excel each time, but for some reason between getting passed to DPlot and displayed by DPlot something is cutting out data points and killing the command to display the plot.

Any idea why this data loss issue is occuring? Might this go away if the licensed version is used?

Here is the source code in question:

Sub ContPlot3D()
' This macro uses DDE to automate generation of a 3d contour plot from Excel data

Dim Channel As Long
Dim Col As Integer
Dim q$
Dim Sel As Object
Set MacroDoc = ThisWorkbook
Dim nrows As Integer
Dim row As Integer

nrows = 308
'hard coded in number of rows

Set Sel = MacroDoc.Worksheets(6).Range("F2:H" + CStr(nrows))
'Selects the cell range in columns F thru H with number of rows equal to nrows

Call StartDPLOT
Channel = DDEInitiate("DPLOT", "System")
DDEExecute Channel, "[FileNew(3)][PostponeRedraw()]"
DDEExecute Channel, "[Caption(" & Chr$(34) & "Test for Indifference Curve Output" & Chr$(34) & ")]"
DDEExecute Channel, "[GridLines(2)]"
DDEExecute Channel, "[NumTicks(1,20,20,20)]"
DDEExecute Channel, "[TextFont(1,10,100,0,255,255,255,Arial)]"
DDEExecute Channel, "[BkColor(00000000)]"
DDEExecute Channel, "[BkPlotColor(0x333333)]"

q$ = Chr$(34)

For row = 1 To nrows
DDEExecute Channel, "[XYZEx(0,1," + Str$(Sel.Cells(row, 1)) + "," + Str$(Sel.Cells(row, 2)) + "," + Str$(Sel.Cells(row, 3)) + ")]"
Next row

Application.Wait (Now + TimeValue("0:00:03"))
'delay added to allow user to kill dialog box in trial version that creates data loss issue

DDEExecute Channel, "[XYZRegen()][ViewRedraw()]"
'Displays the plot
DDEExecute Channel, "[ContourLevels(41,0,1)]"

DDETerminate Channel

End Sub
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Wed Jul 07, 2010 5:28 pm    Post subject: Reply with quote

First things first:

Quote:
Application.Wait (Now + TimeValue("0:00:03"))
'delay added to allow user to kill dialog box in trial version that creates data loss issue


I'm not sure what your StartDPlot function does, but if you add /nonag to the command line then the trial version dialog will not be displayed. (Not to be pushy, but the Add-In DPlot_Start command handles this automatically.)

Quote:
Might this go away if the licensed version is used?


Using /nonag on the command line (or the Add-In DPlot_Start function) might fix the problem, but to answer your question there are no functional differences between the trial and licensed versions - at least not any that apply here. The only reason for dropping points in a surface plot is if DPlot finds two (or more) points with identical X & Y values. My guess is that adding /nonag will solve the problem. If you were using DPlot_Command and a dialog box was being displayed in DPlot, you'd get a "Busy" error. Using DDEExecute I think, though I'm not sure, that Excel will continue to march on and not offer any error messages in the same circumstances. You can test this by moving your Application.Wait line to immediately after your call to StartDPlot.

If none of this helps, you are welcome to send me your spreadsheet and I'll tear into it.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Excel All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group