文档库 最新最全的文档下载
当前位置:文档库 › 怎么在labview界面上做动图

怎么在labview界面上做动图

怎么在labview界面上做动图
怎么在labview界面上做动图

How to edit a dynamic image change on labview

Question:

I want the image to change when I click on a button on the labview interface. How can I achieve this ?

Answer:

In the Front Panel

- Create a "Numeric Control": Right click -> Modern -> Numeric -> Numeric Control.

- Right click the "Numeric Control" and select properties.

- Check “Visible” and give a label starting by @_ to keep control of the value while running.

(When no signal is assigned to a block, it is blocked on the interface unless there is the @_ in its name)

For more information about the @_, click here

- Click ok.

- Create a "Pict Ring": Right click -> Modern -> Ring/Enum -> Pict Ring.

- Right click the block and select “change to indicator”.

In the Block Diagram

- Create a "While Loop": Right click -> Programming -> Structures -> While Loop.

- Right click on the red dot on bottom right of the while a nd click “Create constant”.

- Create an "Event Structure".

- Right click -> Programming -> Structures -> Event Structure.

- Right click on its label and select “Edit Events Handled by this case”.

In “Event Source” select the "Numeric Control" with the name @_

In “Events” select “Value Change”

- In the "Event Structure", link “NewVal” with the Ring you created before

Example of the Block Diagram:

Back to the Front Panel

- Drag and drop the pictures in the ring in the order you want them to appear.

Example of the Front Panel:

Then, by running the model, you should be able to change the image on the right by clicking on the button on the left.

KB_Pic2.pngKB_Pic1.pngBasic_Picture_Changer.vi

相关文档