Overview
Shove-me Game
Description:
Here's an interesting example I made last year. It can be opened using LabVIEW 7.1 and up. In "Shove_me", 4 instances of a sub-VI are opened programmatically. Each of these sub-VIs is minimized and its window is hidden so all you see is a small square of its background which is painted yellow. Each of these sub-VIs only contains an event structure to catch a mouse-move event which turns an indicator called "ouch" to TRUE
Back to "shove_me" - each "ouch" that turns TRUE triggers a move of the sub-VIs panels - so the yellow squares move. The squares appear to move as a result of the mouse shoving them around.
From this VI you can learn how to open multiple instances of a subVI, how to access its variables, how to use mouse events plus some tricks in hiding front panels of VIs and minimizing their appearance.
A note about multiple instances of a subVI. I used a template VI (suffix .vit) which in default opens as reentrant (that you can open additional unconnected instances of the VI). Another option is to use a regular .vi, but to add an option Hex 8 to the "Open VI Reference" option node. To add a hex number, place a regular numeric constant, right click and make its radix visible, click the radix and choose Hexreentrant.bmp
Enjoy!
Instructions:
To implement this example:
- Run VI
To execute this example:
- Install the required software.
- Open the VI and refer the Implement Steps
Requirements
Software
LabVIEW 2012 or compatible
Hardware
-
**This document has been updated to meet the current required format for the NI Code Exchange.**