12-22-2005 12:45 AM
12-22-2005 01:05 AM
Dear Giriraj,
Here is your solution, put ur mechenical action to the Latch when released and see, ithink thats wat u want?? i ve attached the vi.
if it isnt, com back to me...
Thanks,
Nishant
12-23-2005 12:42 AM
12-23-2005 05:30 AM
12-23-2005 05:56 AM - edited 12-23-2005 05:56 AM
Tried to do what you are doing (set boolean to 'switch until released' and assign key ) and observed the same
since yesterday, I did try some logics to make 'switch until released' happen with a keyboard sync , but none came upto my own satisfaction
so, as tst has already suggested, post your code and we may to think of a workaround for achieving what you want to
Regards
Dev
Message Edited by devchander on 12-23-2005 05:58 AM
Message Edited by devchander on 12-23-2005 06:00 AM
12-23-2005 06:22 AM - edited 12-23-2005 06:22 AM
Hi Giridhar,
The mechanical action of switch when selected as 'switch until released' Keeps the boolean ON till you keep the mouse's left click 'pressed'.
In other words, It goes ON when u press the click button and returns to OFF when u release the click button of the mouse.( so you do two events- press and release)
When you assign a key for it, pressing once is equivalent to pressing the left click on your mouse.
So you have to hit the same key again to initiate the release action.
You might not be happy with this kind of switching once you assign a key to the boolean, but i guess this is how this option works.
regards
Dev
Message Edited by devchander on 12-23-2005 06:24 AM
12-23-2005 10:23 PM
Hi all,
Thanks for your valuable suggestions. Can someone tell me how can I read keystrokes in labview. For example, if I press the <enter> button in the keyboard, how can labview get to know that <enter> has been pressed. If I can get the status of the enter key, then I can implement a switch untill pressed mechanical action using case structures by making it switch to true and then immediately back to false. My code is at customer site and hence cant be brought to the discussion forum. Thanks again.
Regards,
Giridhar Rajan
Automation Engineer
Cruiser Controls
Mumbai, India
12-23-2005 10:43 PM - edited 12-23-2005 10:43 PM
Hi Giridhar,
Ok, that is quite easy.
This VI should do the Job
Modify and use it in your VI for realising your logic.
Regards
Dev
Message Edited by devchander on 12-23-2005 10:47 PM
12-23-2005 10:54 PM
Hi,
This Vi is just to optimize on my answer!
Hope this helps
Regards
Dev
12-24-2005 10:30 AM
Dev's method is very general and is only recommended if you really have to read the keyboard in every situation (for example, if your application window isn't in focus). Usually, the simple, more elegant, approach would be using the event structure, as you can see in the attached example. Event driven programming is a very powerful tool and you can search for tutorials on the site and for exampls to see more on how to use it.
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).