Event structure with unit change problems

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. :confused:

I tried to use an event structure but don’t know exactly how to work around it.

unit change.vi (13.5 KB)


unit change.vi (13.5 KB)

See if this helps.

By the way, this isn’t a NI or LabVIEW help site. This website is for the FIRST Robotics competition. For help with NI and LabVIEW help, please check out:

http://www.ni.com/

http://lavag.org/

We’re here to help anyone, but with questions outside of FIRST, the responses will be slower.

unit change.vi (14.2 KB)


unit change.vi (14.2 KB)

As Ryan said, this forum is mostly for the FIRST Robotics Competition, but you are more than welcome to join us. Just be warned that you might have to start a robotics team if you stick around. :slight_smile:

It looks like the VI you attached is pretty close - the event structure is firing on the value change. However, the logic inside of it performs a unit conversion on all of the items in the array without paying attention to what the old units were.

To show this, set the unit to L/hr, type in a value, and hit enter. The value entered is mis-converted and replaced.

One way to work around this is with the “OldVal” node on the side of your event structure. This can help you find what the old unit was and convert (or not) as appropriate.