may be a bug

Found a bug? Tell us about it here

Moderator: DPlotAdmin

Post Reply
AWaterman
Posts: 52
Joined: Sun Jan 08, 2006 7:25 pm
Location: Canberra, Australia

may be a bug

Post by AWaterman »

David

In a VB routine, I execute the code shown below (Dplot not running). Intermittently, this produces a blank plot called plot1. Executing this code again (same data in the arrays, without terminating dplot) results in plot1 having a curve on it (note - not plot2). I wonder if there is some sort of timing error. Dplot version 2.0.4

Const nfdefault = "0"
Const nfcalendardate = "6"
If (J < 2) Then
MsgBox ("No data for this variable - No Plot")
Exit Sub
End If
d.version = DPLOT_DDE_VERSION
d.DataFormat = DATA_XYXY
d.MaxCurves = 1
d.MaxPoints = J + 10
d.NumCurves = 1
d.ScaleCode = SCALE_LINEARX_LINEARY
d.LegendX = 0.05
d.LegendY = 0.05
d.NP(0) = J - 1


d.LineType(0) = LINESTYLE_SOLID
d.Title1 = "Time series plot"
d.Title2 = ""
d.XAxis = "Date" & Chr$(0)
strunits = " "
d.YAxis = strunits & Chr$(0)
nf = nfcalendardate

d.Title3 = ""

cmds = cmds & "[ClearEditFlag()][DocMaximize()][NumberFormat(0," & nf & ")]"
DocNum = DPlot_Plot(d, X(1), Y(1), cmds)
ret = DPlot_Command(DocNum, "[Legend(1,""" & gfilenameforplot & Lstvars.Text & """)]")
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Several questions:
How many points are you typically trying to plot?
What version of Windows are you running?
What version of VB?
What's your processor speed?
Visualize Your Data
support@dplot.com
AWaterman
Posts: 52
Joined: Sun Jan 08, 2006 7:25 pm
Location: Canberra, Australia

Post by AWaterman »

39000 + points

XP 2002 SP2

VB6 SP6 version 9782

Dual processor 2 * 3 GHz P4 504MB
AWaterman
Posts: 52
Joined: Sun Jan 08, 2006 7:25 pm
Location: Canberra, Australia

Post by AWaterman »

XP version details Version 5.1.2600 Service Pack 2 Build 2600
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Sorry for the tardy reply. The short version is... I don't know. At first glance it would appear to be a timing problem, but I can't see how that could be it. If DPlot isn't running before you use DPlot_Plot (or any other function that would result in launching DPlot) then the DLL launches it and does a WaitForInputIdle before doing any DDE magic. WaitForInputIdle basically waits until the launched application is ready to accept user input, which means it is also presumably ready to accept DDE commands. The DLL waits up to 5 seconds, which should be plenty of time on the system you described. (That is, unless you're using a really old version of DPLOTLIB.DLL. Please check the date of that file.)

You mentioned VB: does this problem occur in a compiled application, or only within the VB environment? This shouldn't make a difference, but I've been wrong before.

I'll be happy to send you a DLL that waits longer, but honestly I can't imagine that 5 seconds wouldn't be enough time on your system. If you want to try a new DLL let me know. I'm on the road this weekend so it will be late Sunday night before I can send you anything.
Visualize Your Data
support@dplot.com
AWaterman
Posts: 52
Joined: Sun Jan 08, 2006 7:25 pm
Location: Canberra, Australia

Post by AWaterman »

Monday was a public holiday here.

When I send (successfully) a 39000 pt plot, it takes about 7 seconds elapsed before something appears, but I presume most of that is passing the data across. For a smaller plot (2000 pts) it seems almost instant, so I guess that is a truer indication of the startup time of the dplot application.

I will query the other user re nature of machine, OS etc. The problem here is almost not reproducible. When I did get it to happen, it was within the VB environment (because I wanted to use the debugger on it) but the other user is using a compiled version.

My gut feeling is that a dll with a bigger acceptable delay won't fix it.

dll version is 1.9.9.6
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

My gut feeling is that a dll with a bigger acceptable delay won't fix it.

From your description that's probably correct. But please try this one anyway; it will at least eliminate one possibility. At your convenience try this version: http://www.dplot.com/beta/dplotlib.dll
Visualize Your Data
support@dplot.com
AWaterman
Posts: 52
Joined: Sun Jan 08, 2006 7:25 pm
Location: Canberra, Australia

Post by AWaterman »

1) The dll didn't fix it for my user.

2) The system there is as follows

OS Name Microsoft Windows 2000 Professional
Version 5.0.2195 Service Pack 4 Build 2195
OS Manufacturer Microsoft Corporation
System Name 00079777BA
System Manufacturer Hewlett-Packard
System Model HP Compaq dc7100 CMT(DX438AV)
System Type X86-based PC
Processor x86 Family 15 Model 4 Stepping 1 GenuineIntel ~3391 Mhz
Processor x86 Family 15 Model 4 Stepping 1 GenuineIntel ~3391 Mhz
BIOS Version 06/16/04
Windows Directory C:\WINNT
System Directory C:\WINNT\system32
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Bah. Not a big surprise, but bah, anyway.

If there isn't an error in your data, I just don't know. (And I wouldn't think that would be it or the problem would presumably be repeatable.) You're welcome to send me your project files and I'll take a look. Other than that I'm not sure what to do at this point. I can plot half a million points from the VB environment on my old Windows 95 system with no problem, so I don't think this is a performance issue.
Visualize Your Data
support@dplot.com
AWaterman
Posts: 52
Joined: Sun Jan 08, 2006 7:25 pm
Location: Canberra, Australia

Post by AWaterman »

I'll get back to the other user and see if we can make it reproducible here where I can get at it. She has it as a solid problem. Thanks
AWaterman
Posts: 52
Joined: Sun Jan 08, 2006 7:25 pm
Location: Canberra, Australia

Post by AWaterman »

Just had an idea for a workaround. Call dplot start in the form load routine. Maybe that will get out of the way whatever is happening.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

From what you described it should. But don't think I've given up on the problem. If that doesn't work or if you find any other clues, let me know.
Visualize Your Data
support@dplot.com
AWaterman
Posts: 52
Joined: Sun Jan 08, 2006 7:25 pm
Location: Canberra, Australia

Post by AWaterman »

Hah!! The report from my user, who tried the fix:

just put the fix in and it plotted first time. Closed dplot and then tried plotting again and got same problem. Closed both mplot and dplot and reopened and plotted fine. So I guess I just don't close dplot half way through!

OK. My fix moved the problem, so it does appear to be some weird thing to do with the start up of dplot. Curious eh? So my user now has a fairly solid workaround.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Thanks for the information. And I'm glad there's a fix but I'd like to really fix whatever is going wrong. At the moment, though, I'm out of ideas.
Visualize Your Data
support@dplot.com
AWaterman
Posts: 52
Joined: Sun Jan 08, 2006 7:25 pm
Location: Canberra, Australia

Post by AWaterman »

Know the feeling, but at least it is Friday here.
Post Reply