11-18-2014 05:17 AM
Hello
I want lock my program in running mode. can you help me to know how it is possible?
when we design a program for a user, maybe a child or ane person change the program or stop it, or change the value like an array. is it possible to lock the progran in running mode?
thank you
Best Regards
11-18-2014 05:24 AM
Can you please elaborate your use case?
Otherwise the answers might be very general like "Lock controls you don't want to be changed" or "Build an executable"
11-18-2014 07:30 AM
@behzad1 wrote:
Hello
I want lock my program in running mode. can you help me to know how it is possible?
when we design a program for a user, maybe a child or ane person change the program or stop it, or change the value like an array. is it possible to lock the progran in running mode?
thank you
Best Regards
I have attached a primitive example, it should give you some idea, maybe it helps. Of course i put it together quick, so the style is not nice 🙂
The password is a string, visible on the block diagram, so password protect the block diagram via the "VI properties". Also, change the "Window appearance" to custom, where the closing "cross" is disabled ("Allow user to close window"), and you also hide the abort/pause buttons...
Of course if you build an exe, the story is different...
These steps should give a minimal protection against children and evil colleagues 🙂
11-18-2014 08:10 AM
Attached is a version that I think does what you want. It gets a reference to all front panel controls and then uses those references to enable or disable controls. I changed the window appearance to allow closing. I thought it was pretty annoying when I ran the VI locked it, then couldn't unlock it because I didn't know the password. (it is 1111 by the way). So now you can at least close when you can't unlock.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-18-2014 08:17 AM - edited 11-18-2014 08:20 AM
yes, sorry about that! 🙂
I forgot to write the password in the post...
And to get all the references in the VI is more sophisticated, as Hooovahh did. But be careful, since you do not want to disable that single button which prompts you the password input!
edit.: it is ok in Hooovahh's VI, he enables the unlock button back, after disabling all FP objects...
11-18-2014 10:46 AM
Normally the way you'd solve this is to create an application from your VI, then it is absolutely impossible for the user to make changes. Do you have the application builder, or a version of LabVIEW that includes it?
11-18-2014 11:04 AM
change the program or stop it, or change the value like an array
Even if you have an application the user can stop it, or change a control value. But an exe would be the best including password protection.
11-18-2014 02:01 PM
Another way that might be easier, depending on the number of controls you want to disable, would be to use a transparent tab control as a shield. Lock the panel by making the tabs "visible". Clicking the pane would bring up a password prompt to turn it off.
11-18-2014 02:29 PM
also an elegant solution!
11-18-2014 11:08 PM
thank you all friends
actually, I want monitor some water tank and temperature. but, these tanks have some properties like heigh,area, activation and so on...
some of them should be changeable by operator every time, like: is it active or not? and some of them shouldnt changeable by operator and need pasword or like this. your suggestion is very good but lock all of page. by the way, may be some of monitoring be unchangeable, but user should be click on to watch them(and not change it). have you new or complementary suggestion?
-> I want make an installer of my code in Labview program.
Best Regards