03-28-2012 10:23 AM
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. 😞
Solved! Go to Solution.
03-28-2012 12:06 PM - edited 03-28-2012 12:08 PM
03-28-2012 02:45 PM
03-28-2012 02:54 PM
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.
03-29-2012 05:25 AM
03-29-2012 04:46 PM
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?
03-29-2012 07:07 PM
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.
03-30-2012 07:14 AM
03-30-2012 08:06 AM - edited 03-30-2012 08:10 AM
here is the attachment
03-30-2012 02:41 PM
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: