LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong plot when plotting data with timestamp from AM - PM or clockwise !!

Solved!
Go to solution

Hi to all Programmers.

 

I got attached Datafile. Can some one tell me how to plot this right ! I need all data plotted right  and the x-axe with its date and timestamp.

I understand that the graph cant understand that after the time:  12:59:59.999, it is 01:00:00.000 afternoon .

 

Using Labview 7.1

Regards

HFZ

HFZ
0 Kudos
Message 1 of 18
(3,876 Views)
How are you reading the file and how are you plotting it?
0 Kudos
Message 2 of 18
(3,859 Views)

I think its easyer to see the .VI

The Data file has an ID Top Sequence so the :VI can read the file and plot it. :

 

# t[s]                 flow  [ul/min] 
14-05-2009 10:20:56,076     54,714
14-05-2009 10:21:05,717     54,857
14-05-2009 10:21:05,997     54,857
14-05-2009 10:21:06,325     54,714

 

Copy and paste it to the top of the data file to be able to read it by the program.VI

 

I've tried to Convert the date and the time stamps for each data point to a Large Number (time since ...1940...) And then feeds it to a XY- graph. But still the same result.

Try to read the Data file by the program and you can see whats wrong.

 

Regards

HFZ

 

 

HFZ
0 Kudos
Message 3 of 18
(3,850 Views)
Solution
Accepted by topic author HFZ

Aside from some code which can be simplified by the use of other functions, what I see is that the file you provided does not match the format the VI is expecting.

 

Other comments:

  • I don't understand why you're going to all the trouble of changing the time string when all you need to do is this:

  • All the way at the beginning use the Strip Path function to get the name of the file rather than the gymnastics that you're currently doing.
  • Your while loop should be an auto-indexed for-loop.
  • I can't quite figure out what you're trying to do with all those cursors.
Message Edited by smercurio_fc on 05-14-2009 12:19 PM
Message 4 of 18
(3,844 Views)

Thank you for these advice i apreciate that a lot..

The Coursers features is to start with the Point cursors in the middel on the graph... or so..

 

I'm glad that you can tell me that this can be done easyer . But it really dont help me with my problem.

I can see that in your output cluster you have a character more (The -ABC-) For the AM and PM string notes. But they can not be used to pas over to the time converter.

The graph can not see differens between AM and PM and that it is the same date.

 

About the data format from the file I don't understand what u mean exactly ! Can you meaby give me the point where.. i'll be thanksfull.?

 

 

HFZ
0 Kudos
Message 5 of 18
(3,832 Views)

Hi HFZ,

 

what a about a simple construct like:IF string="PM" THEN hours:=hours+12 ? That's the usual way to convert to a 24hour format...

 

I would prefer to use a 24h scheme when generating the data (as you already noted it's hazzle-free Smiley Wink) but that may be my European kind of view on using SI units and "standard" date/time strings :smileyvery-happy:

 

In addition to the comments given before:

- I would really appreciate when you could attach vis that aren't "run when opened". You never know what happens in the vi before opening it (and I seldomly load them as subvis...).

- I also would suggest not to hide block diagram objects in small structures (sequence in the middle, small cluster in the lower right,...). Use subvis when the diagram gets to big!

Message Edited by GerdW on 05-14-2009 09:11 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 18
(3,825 Views)

HI GerdW and smercurio...

There must be a conversation method or icon that can convert that timeformat :  2-/4/2009 10:21:48,442 AM into a big time number in seconds from 1940,

so the graph can understand a time jump from:  

2/4/2009 12:59:59.785 AM   to  2/4/2009 1:00:00.098 AM     

 

 

 

 

HFZ
0 Kudos
Message 7 of 18
(3,802 Views)

The graph cant understand a time stamp change from :  1/4/2009 11:59:59.918 PM  to  2/4/2009 12:00:00.246 AM     

neither a change from :                                                      2/4/2009 12:59:59.785 AM  to  2/4/2009 1:00:00.098 AM

The graph jumps front and back to place the time stamps for the data .

 

I tried to set some timeformat up in the Graph proberties, but it seems to be ignored some how !

 

HFZ

HFZ
0 Kudos
Message 8 of 18
(3,794 Views)

HFZ wrote:

HI GerdW and smercurio...

There must be a conversation method or icon that can convert that timeformat :  2-/4/2009 10:21:48,442 AM into a big time number in seconds from 1940,

so the graph can understand a time jump from: 


There is "conversation" method or icon. You have to parse the date yourself given your format. Search around on this forum and you will find this comes up a lot.

 

As for the graph, it can understand time jumps just fine:

 

0 Kudos
Message 9 of 18
(3,774 Views)

Hi Smercio....

Thanks for the advice... it was the format string that has a wrong code when reading an American date format because it is with the ´DOT  ".", and my PC- System is set to the europaen format  Comma " , " !

Thanks for all that help Folks!  Apreciated!

But now when this is done,  I cant get the format changed due to the plotting Data on the Data Window in the Cursor legend palette window.

 

HFZ

 

HFZ
0 Kudos
Message 10 of 18
(3,742 Views)