LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Turn on Scripting programatically

I'm creating a plugin for selecting properties and methods, and I need to have the plugin create helper files with property and method info for the plugin to use on subsequent runs. I would like these files to contain private and scripting properties and methods, even if those are not turned on in the user's ini file and preferences. (Thus, the file will have the properties available if the user turns on those features)

 

I think I can turn on private methods programatically by temporarily modifying the LabVIEW ini file. However, I can't figure out how to temporarily turn on scripting. 

 

I did find a private application method called Allow Scripting, but when I run it it gives me Error 1036:

 

Capture.PNGCapture1.PNG

  

Any ideas how I might accomplish this? Or should I simply rebuild the files in the event that the user turns on these options?

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 8
(3,144 Views)

There is

server.viscripting.showScriptingOperationsInEditor=True

in the LabVIEW ini file.

Message 2 of 8
(3,105 Views)

Thank you. I see it now. There was a long gap in my ini file, so I didn't see the settings at the end. 

 

This should help me write my function. Now I need to know if it's possible to alter the ini file, save it, and refresh LabVIEW to use the new settings programatically. It appears that the "Refresh Menus" Application method does not do this.

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 3 of 8
(3,048 Views)

@littlesphaeroid wrote:

Thank you. This does not show up in my ini file for LV2019, which is why I did not find it. Perhaps I'm looking at the wrong ini file...


It's not there. You have to put it in.

 

The default value (when it's not there) is false. For obvious reasons they choose to not put in the file.

 

Never mind. You edited that while I was typing. I think it was off anyway.

0 Kudos
Message 4 of 8
(3,042 Views)

Good point. I had scripting on but couldn't find that line in the ini file. Appreciate your help!

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 5 of 8
(2,996 Views)

There are LabVIEW.exe export functions to read\write from\to the internal ini file. IIRC, there are even VIs to interface with them. Couldn't find them in a quick search though. The problem with this interface is that you can set the value, but that might not trigger the internal mechanisims. So the value will be set, but won't be used until you restart LabVIEW.

0 Kudos
Message 6 of 8
(2,988 Views)

wiebe@CARYA wrote:

There are LabVIEW.exe export functions to read\write from\to the internal ini file. IIRC, there are even VIs to interface with them.


Are you refering to the VIs in "..\National Instruments\LabVIEW 20xx\resource\dialog\lvconfig.llb"?

Message 7 of 8
(2,977 Views)

@UliB wrote:

wiebe@CARYA wrote:

There are LabVIEW.exe export functions to read\write from\to the internal ini file. IIRC, there are even VIs to interface with them.


Are you refering to the VIs in "..\National Instruments\LabVIEW 20xx\resource\dialog\lvconfig.llb"?


Yes! If you leave the input path empty, those function should use the LabVIEW.ini file that is in memory.

0 Kudos
Message 8 of 8
(2,947 Views)