Define axis names by programming

Post beginners questions here. Don't be ashamed starting stupid topics.
Ответить
Bombbooo
beginner
beginner
Сообщения: 27
Зарегистрирован: 19 мар 2012, 16:03
Версия LabVIEW: 2010
Контактная информация:

Define axis names by programming

Сообщение Bombbooo »

Hello. It's me again. Sorry for asking you too much :(. I tried to define the axis names with different units by programming instead of doing in the graph properties. In my vi, I wired each axis name corresponding to the unit input to the graph property node, but it didn't come out correctly. I can't even see all graphs in the waveform chart which I defined each graph name already. How can I work around it?
Вложения
Values Measurement 1-main.vi
(43.44 КБ) 278 скачиваний
selecting data to plot.vi
(30.39 КБ) 273 скачивания
unit selection.vi
(18.1 КБ) 275 скачиваний
selecting data to save.vi
(30.41 КБ) 271 скачивание
value sending desicion.vi
(25.36 КБ) 272 скачивания
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Define axis names by programming

Сообщение mzu2006 »

This should work. But why are you setting Y axis label multiple times?
Bombbooo
beginner
beginner
Сообщения: 27
Зарегистрирован: 19 мар 2012, 16:03
Версия LabVIEW: 2010
Контактная информация:

Re: Define axis names by programming

Сообщение Bombbooo »

There are 4 different axis names I want to have depending on the unit adjusted at the beginning. However it didn't come out right. I can't even see all lines in the chart (don't know why!!). Could you please take a look at my code to see what's wrong with it?
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Define axis names by programming

Сообщение mzu2006 »

Look at this property node:
AxisNames.png
AxisNames.png (2.96 КБ) 10468 просмотров
You set ActivePlot, then adjust name and the Y scale it belongs to. OK.
Then you set the label of the current YScale. So whatever YScale has been selected current, will get its label; changed multiple times. Are you sure this is what you want?
Bombbooo
beginner
beginner
Сообщения: 27
Зарегистрирован: 19 мар 2012, 16:03
Версия LabVIEW: 2010
Контактная информация:

Re: Define axis names by programming

Сообщение Bombbooo »

No. So how can I define the axis names to different axis at the same time?
Вложения
Values Measurement 1-main.vi
(45.87 КБ) 263 скачивания
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Define axis names by programming

Сообщение mzu2006 »

I would do it in two separate property nodes:
Clipboard03.png
Clipboard03.png (2.98 КБ) 10434 просмотра
Using first one, for each plot you assign plot name and Yscale index this plot belongs to.
Using second one, for each scale you assign the scale label
Bombbooo
beginner
beginner
Сообщения: 27
Зарегистрирован: 19 мар 2012, 16:03
Версия LabVIEW: 2010
Контактная информация:

Re: Define axis names by programming

Сообщение Bombbooo »

Thank you. It worked!! However, the lines in the chart don't correspond with the values changed. When I tried to adjust the values in the data mainstream, the graphs didn't change along with the change of values. Why is that?
Вложения
Values Measurement 1-main(1chart).vi
(46.48 КБ) 276 скачиваний
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Define axis names by programming

Сообщение mzu2006 »

This is better, but still some work is required.
1.
2PropertyNodes.png
2PropertyNodes.png (9.01 КБ) 10412 просмотров
So in each iteration of the cycle you update scale labels. Moreover, you have 2 values for scale #0 "Flow(L/min)", "Flow(L/hr)" and for scale #1 "Pressure (bar)", "Pressure (pascal)". Now the latest used got actually set. Create new for loop:
Clipboard04.png
Clipboard04.png (3.17 КБ) 10412 просмотров
2. Now I do not get what you mean by " the lines in the chart don't correspond with the values changed." Can you provide an example?
Bombbooo
beginner
beginner
Сообщения: 27
Зарегистрирован: 19 мар 2012, 16:03
Версия LabVIEW: 2010
Контактная информация:

Re: Define axis names by programming

Сообщение Bombbooo »

Ok As you can see in my VI, when you run the vi, the data will be plotted in the chart. However, when you try to change to value in the main array, nothing happens in the chart even though the value has been changed. So the plotted lines don't follow the change of the values in the data mainstream.

Your suggestion is to create a new for loop for Yscale name label. You mean I should create another for loop inside the for loop I already have,especially for this y scale label property? or another for loop outside the big for loop. Why did you remove the sub vi "unit array" out from the big for loop? Can you fix it in my vi?

Thanks
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Define axis names by programming

Сообщение mzu2006 »

It is extremelly hard to fix code in your :vi: , because some sub :vi: s are missing. My attempt is attached.
WholeVI.png
WholeVI.png (9.16 КБ) 10402 просмотра
Вложения
Values Measurement 1-main(1chart) (2).vi
(28.03 КБ) 262 скачивания
Bombbooo
beginner
beginner
Сообщения: 27
Зарегистрирован: 19 мар 2012, 16:03
Версия LabVIEW: 2010
Контактная информация:

Re: Define axis names by programming

Сообщение Bombbooo »

Thanks for adjusting my code but I still can't have the correct plots in the chart when you try to change the values in the data mainstream. Nothing happened in the chart when you adjust the values. Do you know what is going on with my code?
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Define axis names by programming

Сообщение mzu2006 »

Do you want to have the graphs changed when you adjust the data? Then move the graphing part
This.png
inside the while loop with event structure.
Here.png
Ответить

Вернуться в «For beginners»