LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

changing axis data(other than time in x-aix)

requirement is to plot a graph with voltage in x-axis and counts in y-axis. I have formed a 2-d array and fed as input to graph.

Could you please guide me in changing the axes accordingly.

Krithika
0 Kudos
Message 1 of 8
(3,234 Views)

Hi Kriti,

 

your JPG seems to hide a real RubeGoldberg: first you convert your file content to a 2D array, but just to use the size information to convert again to vectors. Doh...

 

- You can change axes by right-clicking them and set their properties.

- Do you need a histogram plot ("counts in y-axis")? Do you get "counts" from the file?

- Have you tried a "real" XY-graph instead of the waveform graph?

- Attach a real VI instead of a JPG to get detailed help.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,229 Views)

Thanks for the response Robot Happy

 

Ok, let me be more clear in my requirement.

 

sample data i want to plot:

 

Vol         Counts

16           16.25
22           63.25

 

I have attached the vi now :womanhappy: and the graph displays 2 plots ( red and white). The white plot is the 1st col in the aray built ( vol value) and i am not sure what is the red plot and i want to change the graph properties in such a way that vol values are on X-axis and counts values are on Y-axis.

i am beginner in using labview, kindly bear with me... :womanwink:

 


 

Krithika
0 Kudos
Message 3 of 8
(3,223 Views)

Hi Kriti,

 

Your code is doing the following:

 

1) Opening a file to read.

2) Finding the number of lines there are, in a very complicated way.

3) Reading each line, and finding before and after matches with tab as a delimiter: (But your code does not have a tab delimiter, so it is producing a logical error)

4) Ouputting these into a graph, which is working as expected, except for the above error.

 

The error in 3 is because between your values you have spaces, and not tabs. Tabs are represented by \t, so you'll have to give that in your data file.

To see the error, expand your indicator size (the indicator coming out of the "before match" of regular expression. It is taking both values and not the first value like you expect.)

 

Regards,

Prashanth N
National Instruments
0 Kudos
Message 4 of 8
(3,215 Views)

Hi Kriti,

 

you should learn the basics of graphs and plots and how to set their properties...

 

See attachment...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(3,210 Views)

GerdW's VI does a good job in explaining the correct way to get your output. However, it uses a predefined input instead of a file. Make sure you use tabs correctly in the file. Between each column you must use the tab key. Vol<tab>Counts, 16<tab>16.25, and so on). That, combined with the corrected VI shown by GerdW should solve your problem completely.

 

Thanks

 

Prashanth N
National Instruments R&D 

Prashanth N
National Instruments
0 Kudos
Message 6 of 8
(3,206 Views)

Thanks GerdW, that was very useful... :womanvery-happy:

brushing up on the charts, graphs and XY....

Krithika
0 Kudos
Message 7 of 8
(3,190 Views)

Thanks for the suggestions Prashanth :womanhappy: indeed useful.... i have taken care of the input data format..

Krithika
0 Kudos
Message 8 of 8
(3,188 Views)