From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph from Array

Solved!
Go to solution

Hi,

I have problem with my program.
I can't create a Graph from my Array...

Firstly i read valuse from my file which it looks like:

Power	Density Power	Frequency	Voltage	Current
25,334650E-6	36,900306E-6	190,825684E+0	862,942045E-9	864,983974E-9
24,206653E-6	35,157042E-6	190,825684E+0	827,446001E-9	882,577353E-9
25,580297E-6	36,612237E-6	190,825684E+0	851,907600E-9	863,375192E-9
25,898957E-6	36,910784E-6	190,825684E+0	824,207802E-9	829,508508E-9
26,401393E-6	34,364417E-6	190,825684E+0	807,872595E-9	821,918377E-9
25,830897E-6	34,823581E-6	190,825684E+0	813,358895E-9	836,582956E-9
24,849543E-6	35,491383E-6	197,160889E+0	813,544546E-9	880,989262E-9
25,744268E-6	34,769462E-6	197,160889E+0	826,847838E-9	837,655477E-9

Next i want to create a Graph from the first column. But it didn't work...

What can i change in my program to solve my problem?

 

Regards

img.jpg

 

0 Kudos
Message 1 of 4
(2,753 Views)
use Spreadsheet String To Array Function
for plot
0 Kudos
Message 2 of 4
(2,736 Views)
Solution
Accepted by topic author piotrek1349

Hi piotrek,

 

why do you read "String" when you need numbers for a graph?

And what's the problem in not using Autocleanup before posting your  block diagram?

It could be as nice as this:

check.png

Your VI tells us: you need to learn about AutoIndexing with loops, using efficient functions (like "+1"), and reading the LabVIEW help on each function!

 

After reading the LabVIEW help yu could simplify your VI to this:

check1.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 4
(2,725 Views)
Solution
Accepted by topic author piotrek1349

I would do something like this.  Use Read From Text File with the right-click option to read lines to read the first line (the header).  Then another Read From Text File to read the rest of the file as a single string.  Then use Spreadsheet String To Array to parse the file data into a 2D array.  To graph just the first column, use Index Array with a 0 wired to the "Col" index.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 4
(2,715 Views)