LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Forcing an asterisk *

Solved!
Go to solution

I'm working on a tool that makes modifications to VIs.  But the nature of the modifications doesn't result in the VI getting an asterisk * (mods bit set), despite the fact that I'm opening the VIs with the options set to 5.  So I need to have my code explicitly set the VI mods.

I found this, but not enough documentation to know what I should feed it.

paul_a_cardinale_0-1695242020064.png

I could just add something to the BD, then delete it; but is there a better way to force an asterisk on a VI?

0 Kudos
Message 1 of 4
(592 Views)

8

try & error

 

George Zou
0 Kudos
Message 2 of 4
(580 Views)
Solution
Accepted by paul_a_cardinale

Method "Set VI Mod" has a bit of documentation:

 

raphschru_0-1695249205608.png

 

 

By testing, all powers of 2 work from 2^3 to 2^30 included.

 

Regards,

Raphaël.

Message 3 of 4
(575 Views)

The fact that the VI must be opened with flag 0x1 is a bit annoying. There are cases where the VI is already open, e.g. the "User VI Ref" in the "Execute" VI of a right-click plugin.

 

I currently need to force an asterisk because of a bug in the right-click framework of LV2016 (apparently fixed at least since LV2021). When executing the "Execute" VI of a plugin, the User VI is not marked as modified (missing asterisk next to the window title). As a consequence, when closing the VI manually, LV does not prompt the user to save it, so modifications are lost.

 

Attached is a simple plugin called "Test RC Plugin Asterisk" that just deletes the selected objects. With that plugin installed, if you right-click an object and choose "Test RC Plugin Asterisk", the object is deleted without marking the VI as modified. If you then close the VI and reopen it, the deleted object will be back as if nothing happened.

 

I've tried some workarounds such as closing the User VI Ref and reopening it with the flag 0x1 in the "Execute" VI. It indeed gets the asterisk, but now the asterisk does not go away when undoing the action. Any idea to make the plugin work correctly on LV2016?

0 Kudos
Message 4 of 4
(137 Views)