LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unit change problems

Solved!
Go to solution

Hello, how can I do to make the number 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. 😞

0 Kudos
Message 1 of 18
(3,057 Views)

Take a look at Event structures, too.

 

unit%20change[1].png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 18
(3,042 Views)
Solution
Accepted by topic author Angkrit

Doh! 

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 18
(3,020 Views)

Your solution would only work one time. If you change the untis more than once it would not give you the correct answer. I will have to be slightly more complicated than this to work properly.

Tim
GHSP
0 Kudos
Message 4 of 18
(3,017 Views)

In my haste, I only corrected the issue the OP had with updating the control.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 18
(2,998 Views)

How did you get the last block diagram on the right? What is that? I couldn't find it. I can create only the indicator which make another data mainstream array appear that I don't want. Which fucntion did you use so that the user can change the unit value in the same array?

0 Kudos
Message 6 of 18
(2,977 Views)

That's a local variable.  Right-click on the control, then Create then Local Variable.  Right-click on the variable and change it to writeable.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 18
(2,966 Views)
I tried to use an event structure but it didn't give me the correct values as I tried to change the units for the second times. Any ideas?
0 Kudos
Message 8 of 18
(2,950 Views)

here is the attachment

0 Kudos
Message 9 of 18
(2,943 Views)

You're going to have trouble because you can't have different units for the same control with an array of clusters.  Another issue is that you're storing flow and pressure in the same array, so you'll have incompatible units which will break your code.  Your approach of using unitless numbers is fine until, as you've seen, you attempt to change something a second time.

 

I think you'll need to detect which element in the array changed, then update the value for only that element.

 

See if this makes sense:

unit%20change[1].png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 10 of 18
(2,907 Views)