ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DateTime String array in Graph

Solved!
Go to solution

Greetings.

 

I tried to plot DateTime string array VS Numbers array with no success in the XY Graph object.

 

I even converted the DateTime string array to DateTime type using the VI called "Convert_String_to_TimeStamp.vi" with also no success as the X (Time) is just very big numbers and a datetime format.

 

Please check the attached shot, it will describe the situation clearly.

 

Thanks in advance

 

Ayman

-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 1 of 11
(5,469 Views)

 

are you tring to do this in real time? Do you have a copy of the data that you are trying to plot?

Tim
GHSP
0 Kudos
Message 2 of 11
(5,463 Views)

The data is loaded from a txt file.

-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 3 of 11
(5,456 Views)

You need to set the display format for the X-axis to be time rather than a number or automatic format.  Right click on the graph and go to properties.  Go to the Display format tab.

Message 4 of 11
(5,453 Views)
Solution
Accepted by Ayman_Metwally

You have the data correct just not the display format for the time axis!

Login.PNG

Just open the property wizard for the graph and select Display format- x axis and set up however you want to show the display.

 

Edit- Yeah what Raven's fan said!


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 11
(5,451 Views)

Perfect ... Many thanks 

 

 

 

-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 6 of 11
(5,444 Views)

Oops ... Sorry I overlooked your reply ...

 

Thanks a million,

-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 7 of 11
(5,438 Views)

Hello, 

 

Does anyone know a quick way to convert a string array in Time format to a timestamp without having to put the whole format through a for loop (I have 1.2 million samples each time) and its taking a while. Does anyone know a quick algorithm or something similar to speed it up?

String is in the following format  00:00:00.726     and I have also have the date string available eg.   01/03/2011  but has to be a string as I am geting it from a txt file.

 

Any help would be appreciated. 

Thanks 🙂

0 Kudos
Message 8 of 11
(5,273 Views)

You could read the file line by line and use the scan from sting function to convert to a timestamp.

 

Scan Timestamp from String.png

0 Kudos
Message 9 of 11
(5,265 Views)

Hello,

Thank you for the quick response, what you have there is what I am already doing, I was just wandering if there was a way to convert a full array at a time?

What you are proposing still means I have to do it line by line which takes time, I have an array of 1,000,000 items and just want to avoid doing them line by line or in a single for loop etc.


Just wandering if it was possible?


Thanks


Peter

0 Kudos
Message 10 of 11
(5,254 Views)