09-17-2009 06:23 PM
09-17-2009 07:51 PM
Have you considered using ini files? LabVIEW's built in functions make these easy to manipulate... You could make two different versions of the ini file, each one included in a different build spec. Your app could check the ini at startup to determine which indicators to show. Better still, if your user needs more functionality, it's very easy to edit an ini in the field.
Jason
09-18-2009 02:49 AM
Hi there
Try this:
1. Pack the switches for the two distributions in a single VI (e.g. a boolean constant). Create to versions of the VI, one with switch == TRUE and one with switch == FALSE
2. Take a look at the example shipped with LV "..\LabVIEW 8.6\examples\project\programatically build\Build Targets Programmatically.vi". This VI builds a given build spec in a given project.
3. Replace the switch.vi inside the project path with version one of step1, run he build specification (step 2) and save the binaries to a different location
4. repeat step 3 for the second version of switch.vi
09-18-2009 01:01 PM
Ya I do see that there is generated an .ini file when generating the exe from the top level vi, I was just looking at that. The default entries contained in it are:
server.app.propertiesEnabled=True
server.ole.enabled=True
server.tcp.serviceName="My Computer/VI Server"
server.vi.propertiesEnabled=True
WebServer.TcpAccess="c+*"
WebServer.ViAccess="+*"
DebugServerEnabled=False
DebugServerWaitOnLaunch=False
Do these proporty paths correspond to properties which labview can programmatically access? I imagine if I added one to the end, say "ViewerOnly=True", is there an ini function somewhere in labview which will read this file, and look for a boolean control in my code labeled "ViewerOnly" and manipulate it? Or would I need to code my own parser to do this?
Thanks
Dave
09-21-2009 02:29 PM
david_jenkinson wrote:Ya I do see that there is generated an .ini file when generating the exe from the top level vi, I was just looking at that. The default entries contained in it are:
server.app.propertiesEnabled=True
server.ole.enabled=True
server.tcp.serviceName="My Computer/VI Server"
server.vi.propertiesEnabled=True
WebServer.TcpAccess="c+*"
WebServer.ViAccess="+*"
DebugServerEnabled=False
DebugServerWaitOnLaunch=False
Do these proporty paths correspond to properties which labview can programmatically access? I imagine if I added one to the end, say "ViewerOnly=True", is there an ini function somewhere in labview which will read this file, and look for a boolean control in my code labeled "ViewerOnly" and manipulate it? Or would I need to code my own parser to do this?
Thanks
Dave
I think what Jason P was talking about is creating your own .ini file where you could control which user sees what. Maybe a key like:
user = x where x represents a type of user, or for readability maybe use a string instead: user = "Admin"
Bill
09-21-2009 02:55 PM
I see. Ya that would definitely be a way to do it. I guess I was hoping there would be an established "built-in" way, but coding my own wouldn't be too difficult. If NI only included the ability to include command line arguments in shortcuts when building the installer, that would pretty much do it, because I can get at the command line argurments using the applications property in code, and could then just have a few case structures. Would be kind of a cool way to do it. Perhaps in some future revision.
Thanks
David J.
09-21-2009 03:01 PM
09-21-2009 03:06 PM
Hmm no I had not considered that, but I will. I have never played around with OOP in labview, or any other language, but have read about it. I have a birds eye view of the concept, about objects and instances of objects, I will need to dive deeper to understand and apply. But this may be the time to do that. Are there any sources/examples you would recommend for becoming familiar with LVOOP?
Thanks
David J.
09-21-2009 03:52 PM
09-21-2009 03:52 PM
If you are somewhat familiar with OOP and want to learn LVOOP, I'd start with this:
http://zone.ni.com/devzone/cda/tut/p/id/3574
Then I'd go through the included help examples, especially the one that deals with dynamic dispatch. That, plus lurking here and on LAVA was all I needed to get started. There's plenty of stuff out there, and it is worth learning. Having said that, it really seems like overkill for the problem you are facing. My guess is that you could spend several hours trying to learn enough LVOOP to make it work, or less than an hour making an ini file that does the same thing. The ini isn't as extendable, but the problem you are trying to solve sounds like it is pretty well defined as is and won't be changing much...
-just my 2 cents,
Jason