LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Swapping x and y axis in a chart

Solved!
Go to solution

Good Day!

Using LV2015 Base Dev System, I created a six sensor temperature logging vi.  I would like to swap the x axis so that it shows each sensor's temperature value in a bar chart.  Attached is an excel chart showing what I am trying to accomplish along with my vi.  I have tried using the property nodes to flip the axis, but this does not work.  I have searched the community forum as well as other blog sites with little success.  Any suggestions?

Cheers!

 

Download All
0 Kudos
Message 1 of 10
(4,829 Views)

Hi Onjal,

 

no, you cannot swap axis on a chart.

 

Use a graph instead:

check.png

 

And PLEASE replace this silly sequence structure by a FOR loop to read the values of your 6 sensors…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(4,824 Views)

At this point, I am not able to "clean up" the vi.  I did wire a waveform graph out of the combined signals function and still cannot get it to display a vertical bar for each sensor.

0 Kudos
Message 3 of 10
(4,795 Views)

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 10
(4,789 Views)

Okay that helps.  Now I have bars but they are all superimposed on each other at x value of 0.  I changed the scale range to 0 - 8, with no change.  Any thoughts on how to show each sensor 1 through 6 along the x, as in the xcel pdf I posted?

0 Kudos
Message 5 of 10
(4,780 Views)
0 Kudos
Message 6 of 10
(4,773 Views)
Solution
Accepted by topic author Onjai

If you just want to show a bar graph of the current reading, it has nothing to do with a "chart".

 

A simple solution would be to use an array of clusters, each containing a tank and a string, for example. Here is a quick draft.

 

 

 

(On a side note, your sequence structure is not needed. There is also way too much duplicate code (You could do the scaling in a FOR loop or subVI, for example).

 

 

Download All
Message 7 of 10
(4,763 Views)

Thank you Altenbach for the insights.  The vertical bars are just was I was looking for as a visual.

I used the sequence structure because each sensor receives a VISA write in hex to a specific address with a command (B101, B201, etc..) and I was not sure how to reduce that down to just a For Loop. 

Cheers!

0 Kudos
Message 8 of 10
(4,610 Views)

Onjai wrote:

I used the sequence structure because


Execution order is fully determine by dataflow and the order things are wired. Nothing would change if you would simply delete that sequence structure.

 


@Onjai wrote:

... because each sensor receives a VISA write in hex to a specific address with a command (B101, B201, etc..) and I was not sure how to reduce that down to just a For Loop. 


The only thing different between the duplicate code segments is the value of the string. So all you need is one copy of the code in a FOR loop, autoindexing on an array of strings.

(see image for some ideas. You might also want to define a finite loop rate. Don't forget to set the cluster size for "array to cluster").

 

 

I would also strongly recommend to NOT use periods in file names. They should be reserved as a delimiter before the file extension.

 

 

 

Message 9 of 10
(4,600 Views)

Altenbach, Thank you for the ideas, these will work just fine!

All the best!

Cheers.

0 Kudos
Message 10 of 10
(4,594 Views)