开发者

LabVIEW: Have multiple indicators (different styles) for a single variable

A variable gets changed throughout the VI several times. I would like to display it in on two di开发者_开发知识库fferent tabs in the front panel, in different styles (thermometer, numeric indicator).

This answer does not work for me, since there is no "digital display" available if the variable is already displayed elsewhere.

Thanks!


You can wire any number of indicators to the same data source. Just use the wiring tool to link up the terminals on the block diagram.

If you're writing data to a local variable of one indicator and you want the second one to update at the same time, you have a few options:

  • Just wire the same data to a local variable of the second indicator in each place. This is the easiest option if your VI is relatively simple.
  • Place a while loop on your diagram that reads a local variable of the first indicator every 100 ms (say) and updates the second one.
  • Instead of writing to a local each time, send the data to a notifier. Place a while loop on your diagram that waits for a notification and each time it receives one, updates both indicators.
  • If you have the Full or Professional development systems, you can probably do something similar with a user-defined event structure.

If you choose one of the options with a while loop, you'll need to figure out how to stop the loop when the rest of your program is finished. Notifiers are handy because when you release the notifier with 'force destroy' True, any wait on notification operations will stop waiting and return an error value which you can wire to your loop terminal.


You can disconnect the front-panel from the actual code. There is a very throughough how-to written here.
Basically you control (and react to) the front panel by references, so you'll pass a cluster of references to a handler VI that actually performs stuff. By doing that it's quite easy to switch UIs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜