LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting 2D string array

Solved!
Go to solution

Hi, I need to create a xy-graph that plots a 2D string array.  The first - and every other entry is a timestamp.  Each timestamp must plot (in sequence) along the x-axis.  Each constant that follows cooresponds to the preceeding timestamp and must be plotted accordingly along the y-axis labelled 'Counts'.  Keep in mind I will also need to expand this to allow multiple spreadsheets with the same format to be plotted on the same graph.  Please, see attached and thank you for your help!

 

John

0 Kudos
Message 1 of 19
(4,181 Views)

I am currently running LabVIEW 2011. FYI

0 Kudos
Message 2 of 19
(4,179 Views)

Are you  going to be reading this from a file or real time? Are you going to get a time stamp and a number or a 1D array like you have now out of a file? It will make a difference on how you process this data.

Tim
GHSP
0 Kudos
Message 3 of 19
(4,177 Views)
Solution
Accepted by topic author Newton2this

Are you trying to generate a graph that looks like this? If so, see attached code (VI is saved for 2011 to match your upload, but the snippet is in 2012).

XY graph with time on X axis.PNG

XY graph with time on X axis.PNG

0 Kudos
Message 4 of 19
(4,165 Views)

To answer your first question. Yes, each text file will be read from a file.  To answer the second part - actually, I am starting from a 2D string array and trying to produce the xy-graph using only the contents of each text file.  Thank you for your reponse.

0 Kudos
Message 5 of 19
(4,163 Views)

Thank you,  I had actually tried using decimate 1D array and a for loop previously.  I was missing the scan from string idea however - and running out of time!. 🙂

0 Kudos
Message 6 of 19
(4,158 Views)

Hi again,  I will need to sort a folder list by .txt file extensions. What is the best way to accomplish this?  Please see attached.

0 Kudos
Message 7 of 19
(4,112 Views)

Use the pattern input to the List Folder function; set it to "*.txt" (no quotes). That will get you a list of only the files with txt extensions.

0 Kudos
Message 8 of 19
(4,103 Views)

I tried both .txt and \.txt neither worked sorry.

0 Kudos
Message 9 of 19
(4,099 Views)

Try it with an asterisk (*) like I suggested: *.txt

0 Kudos
Message 10 of 19
(4,094 Views)