Event structure with unit change problems

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

Event structure with unit change problems

Сообщение Bombbooo »

Hello, how can I make the value change corresponding to the changed unit in the array?

For example, when I change the unit of "flow" to be L/hr, the value should appear from 4 to 240 in the data mainstream without adjusting the value manually. It should pop up automatically. I know how to change the unit but don't know how to make it appear in the data mainstream with the same numeric control block.

I tried to use an event structure but don't know exactly how to work around it.
Вложения
unit change.vi
(13.49 КБ) 301 скачивание
Аватара пользователя
IvanLis

Activity Professionalism Tutorials Gold Man of the year 2012
Автор
guru
guru
Сообщения: 5462
Зарегистрирован: 02 дек 2009, 17:44
Награды: 7
Версия LabVIEW: 2015, 2016
Откуда: СССР
Благодарил (а): 28 раз
Поблагодарили: 86 раз

Re: Event structure with unit change problems

Сообщение IvanLis »

Bombbooo писал(а):Hello, how can I make the value change corresponding to the changed unit in the array?
Снимок.png
Снимок.png (3.38 КБ) 8751 просмотр
Use NewVal and OldVal values ​​to determine at what point the change occurred. If the element is changed, what we need, only then perform the action.
Аватара пользователя
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: Event structure with unit change problems

Сообщение mzu2006 »

You can do it like that:
WhatChanged.jpg
WhatChanged.jpg (3.21 КБ) 8738 просмотров
You will have the index of the first element that has only a unit value changed.
Bombbooo
beginner
beginner
Сообщения: 27
Зарегистрирован: 19 мар 2012, 16:03
Версия LabVIEW: 2010
Контактная информация:

Re: Event structure with unit change problems

Сообщение Bombbooo »

There are 4 different units in the data mainstream. How can you program the specific units for each value? for example; volume- l/hr or l/min
and pressure - bar or pascal.
Аватара пользователя
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: Event structure with unit change problems

Сообщение mzu2006 »

This construct will give you the old and new changed values:
WhatChanged1.jpg
WhatChanged1.jpg (4.69 КБ) 8722 просмотра
What do you mean by
Bombbooo писал(а):How can you program the specific units for each value?
Try to articulate it differently, please.
Bombbooo
beginner
beginner
Сообщения: 27
Зарегистрирован: 19 мар 2012, 16:03
Версия LabVIEW: 2010
Контактная информация:

Re: Event structure with unit change problems

Сообщение Bombbooo »

There are 4 different units for flow and pressure, as you can see in my attached vi. However I put every unit in the same array which I think it isn't a good idea, but I already did it :cantbe: . Anyway how can you limit the user to be able to adjust the right unit for each value? For example, limit the user to have only L/min and L/hr for Flow, bar and pascal for Pressure. I know it sounds complicated but I need to work around this seriously. I got headache now :bae: Could you please help me??? plz Thanks
Bombbooo
beginner
beginner
Сообщения: 27
Зарегистрирован: 19 мар 2012, 16:03
Версия LabVIEW: 2010
Контактная информация:

Re: Event structure with unit change problems

Сообщение Bombbooo »

This is what I have got. It's partly working but it doesn't give me the corrects values if I try to adjust the units more.
Вложения
unit change.vi
(15.37 КБ) 286 скачиваний
Аватара пользователя
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: Event structure with unit change problems

Сообщение mzu2006 »

You can use this as a template:
CorrectUnit.png
Вложения
unit change.vi
(10.82 КБ) 308 скачиваний
Bombbooo
beginner
beginner
Сообщения: 27
Зарегистрирован: 19 мар 2012, 16:03
Версия LabVIEW: 2010
Контактная информация:

Re: Event structure with unit change problems

Сообщение Bombbooo »

Thanks for helping. I got it already :)
Ответить
  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

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