LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add points on graph from a text File (Date and time include in the file)

Can anybody help me? Please?

Has anybody got a solution/Vi?

 

What I want to do is to draw a Graph with 2 curves.

 

Input data (I have got a file and a constant as input):

- Data from a text file (example: Pression.txt) with the following format (value of data +date.):

1044.25            23/03/2011 17:31:00

(The file is updated by an another computer on the network with new values (only one pressure value and one date on the file) and the time step (interval between date is not a constant))

- The other data on the graph is a constant 1013.24 (for example)

 

Output data (What I want to display with LabVIEW)

I want to add the new data I read from the file (Pression.txt) on the graph. (I read the file each 20 second or 1 minute for example)

On the Y axis I want data value from file (example:1044.25) and the constant value 1013.24.

On the X axis I want to display the date I got from the text file (example: 23/03/2011 17:31)

 

=> refer to the graph below for visual example:

   

Questions, remarks and problem I have got:

1) Is the text file format (Pression.txt ) compatible with the input of the graph command?

I do not find a LabVIEW function which convert the “date” from the text file (example:23/03/2011 17:31:00) into a compatible format for X axis for the graph.

(Conversion from string format => into a “date and time” format)

 

2) Which LabVIEW graph can I use?

(For me, I should use a XY GRAPH as the time step between different data is not a constant)

Is it right? Is there other compatible graph?

0 Kudos
Message 1 of 6
(4,330 Views)

This should do the trick.  If you have any question, just ask.  The only thing you need to do is do something with the time maybe.

 

XY.png

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 2 of 6
(4,325 Views)

I don't know how your time looked like, so I just implemented a double.  But if your time is just a string you might want to do a little bit more.  Maybe your time is in the third column.  If you have any problem with converting that, please let me know.  Send me the text file and I will do it for you

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 3 of 6
(4,322 Views)

you can use "scan from string" or "format to string" function to convert text files (string - either its your data or your date/time) into numeric and time stamps. and feed to your graph.

 

7.jpg

Ivel R. | CLAD
0 Kudos
Message 4 of 6
(4,317 Views)

 


@ivelson wrote:

you can use "scan from string" or "format to string" function to convert text files (string - either its your data or your date/time) into numeric and time stamps. and feed to your graph.

 


 

 

That does not work if you're having a plot where the X points are not equally far away from each other.

 

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 5 of 6
(4,314 Views)

then just include the "seconds" Smiley Wink. i think it is rare to acquire data every milliseconds. btw, my wrong, we can only use "scan into string" and NOT the "format into string" function for converting timestamps.

 

8.jpg

Ivel R. | CLAD
0 Kudos
Message 6 of 6
(4,303 Views)