LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting 2D string array

Solved!
Go to solution

Sorry, my bad!  it works.

0 Kudos
Message 11 of 19
(890 Views)

Hi again,

 

I have another question.  How could I adjust the x-axis timestamp programmically?  I will need to adjust the range from say 12:40:00 AM, 05/07/2011 to 12:50:00 AM, 05/07/2011.  My customer has requested a separate control cluster for this.  I am looking at property nodes for doing this but I am not sure which one to use.  Thank you for all your help!  🙂

0 Kudos
Message 12 of 19
(877 Views)

Hi Newton,

 

using the X axis properties (like range.min and range.max) would be a good decision...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 19
(866 Views)

How would this work?  The x-axis is timestamped.  A range min and max property node is a dbl precision number format! 😞

0 Kudos
Message 14 of 19
(863 Views)

You can convert a timestamp to a double-precision value using the To Double Precision Float function in the Numeric->Conversion palette.

0 Kudos
Message 15 of 19
(858 Views)

Hi again,

 

I will have to make some changes to my code.  The format of the text/speadsheet files has changed.  Instead of a timestamp followed by a single count value I will need to read in a timestamp followed by 4096 count values!  I will need to total all the count values at once or from a selected range - say channels 30 - 73 for example.  Please see attached.  Any suggestions would help!  Thank you.  John

0 Kudos
Message 16 of 19
(854 Views)

Hi Newton,

 

- Read in as 2D array of strings, when you need the timestamp. Convert rows/columns as needed to numbers or timestamps. Do your calculations as needed.

- When timestamps do not convern you can read in the file as 2D array of DBL. Do your calculations as needed...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 19
(848 Views)

Hi again,

 

The formating of the text file I am reading is inconsistent and must remain this way.  See the attached example.  What would be the best way to sort this data (in other words: delineate between timestamp and numeric data)?  As you can see the timestamp data is in chronological order by row ,but with duplicate entries for some of the timestamps.  I have tried transposing 2D array but it is not helping much.

0 Kudos
Message 18 of 19
(830 Views)

A Word document is a poor choice of format for posting a screenshot. Consider using PNG (on Windows, run mspaint, paste the screenshot, save as PNG). Even better would be a to upload a section of the raw data file, since we don't know what you did to read the file before putting it in the array indicator.

 

Do you care about the rows duplicate timestamp rows? If not, you could write some code that goes through each row and attempts to interpret the first column as a timestamp. If that succeeds, check the next row for data, and if there's data, combine the timestamp and data and append it to a new array. At the end you'll have an array of just the useful data. If the array is huge, there might be a more memory-efficient approach depending on what you need to do with that data afterwards.

0 Kudos
Message 19 of 19
(821 Views)