03-24-2011 05:50 AM
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?
03-24-2011 06:02 AM - edited 03-24-2011 06:03 AM
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.
03-24-2011 06:06 AM
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
03-24-2011 06:21 AM
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.
03-24-2011 06:30 AM
@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.
03-24-2011 06:51 PM
then just include the "seconds" . 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.