LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Represent single and multiple values in a Chart

Solved!
Go to solution

Sorry I didnt understand the plot legend thing. Anyway that is not what I want. Think of me as the user and not the programmer. I select a value, I need to see it in the waveform chart or any kind of chart. Then I select another value I see them both. Since I am the user and not the programmer, I should able to work on the inputs and not on the waveform chart. 

0 Kudos
Message 11 of 25
(581 Views)

just check this image. you can understand clearly. 

 

 

Capture.PNG

0 Kudos
Message 12 of 25
(576 Views)

@govindsankar wrote:

Since I am the user and not the programmer, I should able to work on the inputs and not on the waveform chart. 


The visibility checkbox is for the user, not the programmer. Have you tried?

 

The code you have posted earlier is plain silly and shows a basic lack of understanding of dataflow. Your FOR loop will run exactly once before the while loop and then the while loop will continuously show the same data over and over. Changing the numeric at runtime does not do anything. If you want to update the graph with new data, the FOR loop and numeric control belongs inside the while loop. (It is also extremely annoying if you maximize the front panel and diagram to the screen. Why would you do that??)

 

So we have two different problems and it is still not clear what you want:

  1. Do you have a fixed number of traces, but want to be able to hide some of them at run time?
  2. Does the number of traces actually change because the acquisition changes?

For (1), the visibility checkbox is all you need. For (2) we need more information, for example what is the maximum number of channels, etc.

 

Note that your array indicator is pointless. Charts have digital displays that you can show.

 

Here is a quick rewrite using the visibility checkbox. See if this is sufficient. If not describe one more time what you want to do. Where does the data come from?

 

Charting2.png

0 Kudos
Message 13 of 25
(572 Views)

Data comes from a thermal board. There are like 32 thermal readings. But that is not the point. Right now I need to create one for myself. As far as the for loop outside the while loop, I did it like that because I only want 1 reading. I know waveform chart is showing that varies over time, so if it is just one reading then there is no variation. But that is not important. I did the array thing just to get some random values. So forget about that as well. Just think that there are 5 readings coming from a board. There is a graphical user interface that will let the user select one or multiple readings to be shown in the waveform. You can use anything like a button or create clusters from the 5 or something. Anything can be done. It doesnt have to be arrays. I just need to represent one or more of those 5 values in the waveform by clicking on something but not on the waveform. Click on something in the GUI: 

0 Kudos
Message 14 of 25
(564 Views)

@govindsankar wrote:

 Click on something in the GUI: 


As we said, click on the visibility checkbox! 😄

In what way does this not solve your problem?

0 Kudos
Message 15 of 25
(559 Views)

It doesnt solve my problem because that is not what I want. Ok how about another way. Forget about the waveform chart. There are 5 values and I need to insert this 5 values into an array. How I insert is I click on one value it gets inserted into the array and I click another value it gets inserted into the array at the next position. I unclick it then the corresponding value is removed from the array. I have been trying to do this for a long time. But the problem is first of all I have not done the delte from array. I just have done add into array and every time I run the program the values before ending the program last time still stays in the array. So i thought i create a local variable and initialised the array to a 0 value array in the beginning before the loop starts. But then nothing is happening with the array. I cannot insert values into the arry when I do that. Please help me with this question. 

0 Kudos
Message 16 of 25
(566 Views)

You need to keep the array in a properly initialized shift register. There are plenty of forum examples for exactly that.

 

(Sorry, posting by phone)

0 Kudos
Message 17 of 25
(560 Views)

Hi govind,

 

how often have you heard about those FREE TRAINING resources offered in the header of the LabVIEW board?

How often have you taken those trainings?

 

How I insert is I click on one value it gets inserted into the array and I click another value it gets inserted into the array at the next position. I unclick it then the corresponding value is removed from the array.

Simple:

check.png

(Ofcourse it would make sense to put those values and buttons in arrays.)

 

So i thought i create a local variable

Wrong.

Whenever you think "I create a local variable" you should THINK DATAFLOW and find a different way!

 

But then nothing is happening with the array. I cannot insert values into the arry when I do that. Please help me with this question. 

So you did "something". Your "something" doesnt work (as expected).

And you want us to help you with this "something" but you hesitate to attach this "something" to your message!?

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
0 Kudos
Message 18 of 25
(543 Views)

Sorry I am not hesitant to attach something. I will attach it first thing on Monday. Thank you

0 Kudos
Message 19 of 25
(539 Views)

@govindsankar wrote:

It doesnt solve my problem because that is not what I want. Ok how about another way. Forget about the waveform chart. There are 5 values and I need to insert this 5 values into an array. How I insert is I click on one value it gets inserted into the array and I click another value it gets inserted into the array at the next position. I unclick it then the corresponding value is removed from the array. I have been trying to do this for a long time. But the problem is first of all I have not done the delte from array. I just have done add into array and every time I run the program the values before ending the program last time still stays in the array. So i thought i create a local variable and initialised the array to a 0 value array in the beginning before the loop starts. But then nothing is happening with the array. I cannot insert values into the arry when I do that. Please help me with this question. 


Yes, please attach your code on Monday, because none of this makes much sense, probably mostly because of the terminology you are using.

  • Is a "0 value array" an "empty array" or an array containing 5 zeroes?
  • What is the "next position"? Where is that? Are you trying to append at the end?
  • What function do you use to "insert"? Insert implies that you have an existing array coming from somewhere based on the already existing elements. (I mentioned shift registers already, do you use them?)
  • Should the order of elements in the new array be in the original order or in the order of insertion?
  • What is your definition of "ending the program"?

Gerd's solution will just build a new array from the selected values and that seems all that's needed to create the reduced array from selected elements. Obviously you have something else in mind.

0 Kudos
Message 20 of 25
(531 Views)