I need to use LV to send keystroke to an external executable program that controls an old lab instrument. Basically, I need LV to send a number (let’s say 123.45), a tab, another number and enter.
I tried to use this example https://forums.ni.com/t5/Example-Code/Using-LabVIEW-to-Simulate-Keyboard-Events/ta-p/3996210?profile... based on User32.dll but here both the comma and the period character are not enabled.
I tried also this example (https://labvolution.com/labview-simulating-keyboard-events/) but I was only able to input letters, numbers, tab, and carriage return. When I input the ASCII code for decimal separator (I have tried both 44 and 46) I get no results.
Is this a limitation of windows? I am running LV2019 on Win10 and 10 I have tried both Italian and English language option.
If so, what alternative method is the best option for my need?
Thanks for your help.
Solved! Go to Solution.
Did you try 190 (period)?
This may not be the same as for User32.dll but it does appear to have similar functionality. Might be worth a shot 😕
This is perplexing. Do you have any documentation on the messages?
I did not look into the examples, but I think, they use the keybd_event() function from user32.dll
You have to use the virtual key code (not the ascii code) and thats 0xBC or 0xBE
See this webpage for a complete list of the virtual key codes:
This might help you for period.
0x6E is the hex value for this
And you can use 188 or 0xBC for comma
the link you provided is the correct reference.
For my purpose also 110 (decimal) and 188 (comma) are working.
Thank you very much.
The link you reported with HEX values it is useful and correct,
the linked example that I am using it is with decimal input so I just have to convert from HEX to DEC.