03-22-2006 01:00 AM
03-22-2006 01:34 AM
You can detect which buttons were clicked by using the Key Down event in an event structure, but I believe you'll run into a problem - as far as I know, there are no ASCII characters for those buttons, so they're not non-displayable characters. If you're using another program to send commands through the serial port and you're using those buttons to simulate some characters, you will have to find out what those characters are. You can do this, for example, by going through the documentation for the program or by using programs like Portmon or by seeing if you copy the created string into LabVIEW.
Once you know what the characters you need are, you can add them to your string by using the Byte Array to String function, which takes an array of ASCII characters and turns it into a string. If you managed to copy the string mentioned earlier, you can use the reverse function to find out what the ASCII characters you need are.
To learn more about LabVIEW (and specifically the event structure), I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with and here are some tutorial videos. 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).
03-22-2006 01:38 AM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
03-22-2006 03:40 AM
03-22-2006 03:45 AM
03-22-2006 03:59 AM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
03-22-2006 06:39 AM
03-22-2006 07:50 AM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
03-22-2006 08:29 AM
You can definitely use the input VIs to read the keyboard state, but in general, the event structure is preferable and I think the only cases in which the input VIs are necessary are if you want to capture the clicks even when your program doesn't have focus and when you want to detect clicks on more than one key (not including modifiers). Which problems do you have with events?
@i wrote:
Here I am using Initalize Keyboard.vi and Acquire Input Data.vi together to read key board(LabVIEW 8.0). Is it ok?Key press event I cannot use because of someother problems..
03-23-2006 01:13 AM
Hi tst,
I need to change a lot of code in my existing program to implement in that way. That is why.
I need perform some actions as long as the key is pressed.Say, if Left arrow key is keep pressing, i need to keep sending a particular char to a External device.
Also key focus is given to Buttons, which are already handled by event cases.
Regards
SajK
**************************
tst wrote:
You can definitely use the input VIs to read the keyboard state, but in general, the event structure is preferable and I think the only cases in which the input VIs are necessary are if you want to capture the clicks even when your program doesn't have focus and when you want to detect clicks on more than one key (not including modifiers). Which problems do you have with events?
*************************