05-20-2019 11:22 AM
@Sable wrote:
Like this? (please refer to the attached vi done on LabVIEW 2013).
Looks good to me.
0xDEAD
05-20-2019 01:51 PM
@Sable wrote:
Like this? (please refer to the attached vi done on LabVIEW 2013).
That's it!
I'd make a nice VI for it, maybe make the input rect -1,-1,-1,-1 default, and if the input is default call the null pointer. That way, you have one VI to set\remove the region. Two VI's works too of course.
You can put the clfn to "run in any thread". It's a tiny bit faster, as the clfn doesn't have to wait before execution.
05-20-2019 07:48 PM
Could you please elaborate "You can put the clfn to "run in any thread". It's a tiny bit faster, as the clfn doesn't have to wait before execution."?
05-21-2019 01:18 AM
My objective is to confine the cursor within the left pane of the front panel.
I am having some difficulty to do it with my vi. (please refer to the attachment done in LabVIEW 2013).
Can anyone please advise me what am I doing wrong?
- Sable
05-21-2019 09:15 AM
You need to use the Method "Convert Pane to Panel Coords". Also, make sure that you close the pane references. There is probably still something wrong because I had to subtract 50 pixels from the Panel top position but otherwise it works as you want I think. I attached the VI in 2013 format.
05-21-2019 11:41 AM
Concerning the "Run in any thread", you can configure the Call Library Function Node by right-clicking and selecting "Configure...". In the Function tab, you can select "Run in UI thread" or "Run in any thread". By default, "Run in UI thread" is selected.
If the dll needs to occupy a constant memory space (non-thread safe), you should use "Run in UI thread". Problem is that the UI thread is used for UI operations so it gets called all the time, so the dll call might have to wait for the UI thread to be available, and the dll call might also interrupts another UI operation. There is also the switch time between the current thread and the UI thread.
So when the dll is thread safe, it is better to use "Run in any thread". When the dll is called in the UI thread, the node header is orange and when "Run in any thread" is used, the node header is yellow (see below).
05-21-2019 07:49 PM
Thank you very much Marc. Really appreciate thehelp.
I changed the clip cursor code a little to get it to work without the minus 50 pixels.
Let me know if this makes sense (please refer to the attached vi).
05-22-2019 08:01 AM
It seems that you got it. You still need to close all the Pane references from the array, even if you don't use them.
05-22-2019 11:13 AM
@MarcDub wrote:
It seems that you got it. You still need to close all the Pane references from the array, even if you don't use them.
Closing a Pane, or any descendant of the GObject class, does nothing and is unnecessary.
07-15-2020 02:37 PM
Thanks a lot for your solution - excellent! It helped me to move the mouse only in a sub-panel and not risk clicks outside of it. Within the sub-panel was a dynamically called vi. Thanks again, Peter