LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Restricting Mouse Usage

I have two questions for everyone: Is there a way to prevent the mouse from clicking while a vi is running and more importnantly is there a way to restrict mouse movement so if it the mouse goes too high or too low along the y axis it will reach a barrier?

"There will be water if God wills it"
0 Kudos
Message 1 of 10
(2,769 Views)

bump and additional question: is there a way to get a file to load in Run Mode? I'm trying to get it so the people in my lab can simply open my file and have it instantly be in run mode to prevent them from accidentally editing something and screwing the program up.

"There will be water if God wills it"
0 Kudos
Message 2 of 10
(2,752 Views)

@Nproach wrote:

is there a way to get a file to load in Run Mode? I'm trying to get it so the people in my lab can simply open my file and have it instantly be in run mode to prevent them from accidentally editing something and screwing the program up.


Yes - set the VI to "Run when opened" in the VI properties.

0 Kudos
Message 3 of 10
(2,745 Views)

I dont want it to actually start running when they open the file because they need to select parameters that dictate how the program runs before they start using the program. What I want is for the front screen to appear in run mode, as in the view style it goes to when one presses Ctrl+M on the front panel. It doesnt allow you to edit anything other than values in inputs. Thats what I'm going for.

"There will be water if God wills it"
0 Kudos
Message 4 of 10
(2,740 Views)

You can use Win32.dll to "lock out" the mouse - disable that and the keyboard entirely if you want.  Alt-ctrl-delete will still bust out of it, but the rest of the input will be ignored.

 

Message 5 of 10
(2,736 Views)

@Nproach wrote:

I dont want it to actually start running when they open the file because they need to select parameters that dictate how the program runs before they start using the program. What I want is for the front screen to appear in run mode, as in the view style it goes to when one presses Ctrl+M on the front panel. It doesnt allow you to edit anything other than values in inputs. Thats what I'm going for.


The right way to do this is to make your code wait for the user to push a button that starts the experiment (process, measurement, whatever).  Then your code can start running immediately when loaded, but won't take any action until the user specifically initiates it.

 

For locking the mouse, consider the "Set Busy" and "Unset Busy" VIs in the Dialog and User Interface -> Cursors palette.  I don't know of any way to restrict the range of mouse motion.

Message 6 of 10
(2,730 Views)


@SnowMule wrote:

You can use Win32.dll to "lock out" the mouse - disable that and the keyboard entirely if you want.  Alt-ctrl-delete will still bust out of it, but the rest of the input will be ignored.

 


Would that have to lock out the keyboard too or could I be selective about it? Also how might I go about doing that?
"There will be water if God wills it"
0 Kudos
Message 7 of 10
(2,729 Views)

The "right" way to do that is to flow the advise from Nathand but mod your code to include a while loop that runs first (with all configurable controls in the while loop or read imediately after). As long as the while loop runs they can edit the setting then they can stop the while loop by hittng a GO button. Provided your data flow is correct it will do exaclty what you are asking for without trying to twist LV around inside out. even if you figured it out, few LV developers would have an idea how.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 10
(2,726 Views)
nathand wrote
The right way to do this is to make your code wait for the user to push a button that starts the experiment (process, measurement, whatever).  Then your code can start running immediately when loaded, but won't take any action until the user specifically initiates it.

 

For locking the mouse, consider the "Set Busy" and "Unset Busy" VIs in the Dialog and User Interface -> Cursors palette.  I don't know of any way to restrict the range of mouse motion.


That sounds reasonable.... I'll give that a shot... Thank You

"There will be water if God wills it"
0 Kudos
Message 9 of 10
(2,723 Views)

@Nproach wrote:

I have two questions for everyone: Is there a way to prevent the mouse from clicking while a vi is running[...]


Example_VI_BD.png

 

Here's a thread with an example using the ClipCursor function to restrict the mouse movements.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 10 of 10
(2,691 Views)