Time and date

Q&A for Visual Basic, Visual Basic .NET, and PowerBasic developers using DPlot
Post Reply
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Time and date

Post by Jens Andenaes »

Hi David,
I am trying to make plots with time and dates on the x-axis but fir some reason I cant get DPlotJR to accept the format commands when I add the format command to the format string. The command I try to add is:

cmds = cmds & "[NumberFormat(0,5)][TimeFormat(HH:mm:ss)]"

But I get error message back. Where am I wrong?
I am making real time plots and I would ideally have the grid slide with the data and have tickmarks at intervals of minutes to days dependent on the timescale of the data. Do you see any problems in this?
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

The time formatting string must itself be surrounded by quotation marks. Use

cmds = cmds & "[NumberFormat(0,5)][TimeFormat(""HH:mm:ss"")]"

You'll run into this with any command that takes a character string argument.
Visualize Your Data
support@dplot.com
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Post by Jens Andenaes »

Thanks David,
I tried to surround them with single quotation marks but didn't think of using double marks.
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Post by Jens Andenaes »

Is there a bug in the time formatting for negative hours?
I have a 24 hour time span formatted as HH:mm. Xmax is set to Now, Xmin is Now-24 hours. According to the documentation, -1 should be formatted a 23 hours, -2 as 22 hrs etc. However, the wrap around does not seem to work, -1 is displayed as 1, -2 is displayed as 2 instead of 22 etc.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Is there a bug in the time formatting for negative hours?
Yes, there is. Will have this fixed next release, thanks for pointing out the problem.
Visualize Your Data
support@dplot.com
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Post by Jens Andenaes »

Do you have a schedule for when that will be?
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

No later than June 26.
Visualize Your Data
support@dplot.com
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Post by Jens Andenaes »

Thanks David, thats great - Jens
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Jens,
The executable is ready to go but there are a few issues to work out with the installation and the update wizard that I don't want to rush. I'll most likely be posting an update Monday night (Jun 27).
Visualize Your Data
support@dplot.com
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Post by Jens Andenaes »

Hi David,

Is there a new date for the release as I see we have passed the 27/6 with a good margin. Also, will this release have fixed the 20s lockout on busy as described in the next posting.

Jens
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

New release was posted last week. If you currently have the licensed version 1.9.9.9 you can get it by clicking Help>Check for Updates.

Unfortunately no, I did not have time to look into the problem you found with the 20 sec delay.
Visualize Your Data
support@dplot.com
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Post by Jens Andenaes »

:oops: Oooops, sorry I missed that. Have downloaded the newest release and testing that now.
Do you have any idea when you will look into the 20 sec busy blocking.

Jens
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Do you have any idea when you will look into the 20 sec busy blocking.
With any luck, by the end of the week. I think the problem most likely lies in DPLOTLIB.DLL rather than DPlot.
Visualize Your Data
support@dplot.com
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Post by Jens Andenaes »

Thanks David, I'll test it as soon it is available (and check the download page more thoroughly)
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Post by Jens Andenaes »

Hi David,
I have tested the new release regarding the time/date problem but you are not out of the forest yet it seems. The x-axis labelling is now correct but the plotted points are still wrapped around 00:00 value so if I am plotting values vs timestamps (in real time) from lets say 20:00 to 04:00, it looks ok until I reach 00:00. Then all values are plotted from 00:00 so I get two sets of value plotted from 00:00 to 04:00 instead of a continuous set of values from 20:00 to 04:00. It seems that the x-axis labelling was fixed but not the underlying geometrical relationship between x and y values, when wrapping takes place it takes all previous values and shifts them to the right of the wrapping point.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Jens,
That's not the result I'm getting. I changed the VB demo btest3 to use a time scale and start plotting time at X=-4 (20:00), and it works as expected. Exactly how are you sending data to DPlot?
Visualize Your Data
support@dplot.com
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Post by Jens Andenaes »

Hi David,
I do quite a bit of processing on the time values involving conversions and operations when rolling over the date. Since you are getting correct results in a straight forward case I think I shall go back and go over the code again and look for potential bugs in my own code first. I'll get back to you when I have a conclusion.
Thanks
Jens
Jens Andenaes
Posts: 19
Joined: Fri Apr 29, 2005 9:10 am

Post by Jens Andenaes »

:oops: Hi David,
I found the problem which was caused by a misinterpretation I made on how the timescale operation worked. I made a bit of code handling the 00:00 rollover that was not only wrong but totally unnecessary. Just removed the code line and it worked perfect.
Thanks - Jens
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

No need for the :oops: , but thanks for the reply.
Visualize Your Data
support@dplot.com
Post Reply