LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

send out "@", "-"

Solved!
Go to solution

I want to use "Call Library Function Node" to send in command to the Linux. My command has some special character, like "@" and "-", the Call Library Function Node can send most character (like "root") but doesn't send "@" and "-" (are empty). I tried different combination on Parameter type, no luck. Can some one help? Thank you in advance.

I attach my VI. I also tried with System Execution, nothing input to Linux.

0 Kudos
Message 1 of 7
(559 Views)

 


@yuntan wrote:

I want to use "Call Library Function Node" to send in command to the Linux. My command has some special character, like "@" and "-", the Call Library Function Node can send most character (like "root") but doesn't send "@" and "-" (are empty). I tried different combination on Parameter type, no luck. Can some one help? Thank you in advance.

I attach my VI. I also tried with System Execution, nothing input to Linux.


Never saw anything like this. The only reason why the Call Library Node might stop passing string data to the shared library function might be if it contains embedded NULL characters. But even that is actually only happening after the Call Library Node returns, not when passing a buffer to the function.

 

It's also a bit unclear what you actually try to do. Sending commands to Linux is very broad. If you had selected Save for Previous and saved to LabVIEW 2020 or earlier I could look at your VI, but now I just can guess things.

 

System Exec would be indeed the more logical function to call Linux commands. But as you forgot to mention what sort of command you tried this with I can't even start to guess what the problem might be.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 7
(553 Views)

I convert it to version 2019. Just want to know how Function Node can do key board output "@" or "-" to my application. Thanks.

0 Kudos
Message 3 of 7
(528 Views)

Please explain to me where Linux from your first post comes into play. You call keybd_event() which is a Windows API function. There is nothing like that on Linux!

 

Second: check out the documentation for keybd_event. There you have a list of Virtual Key Codes. Ranges 0x3A to 0x40 (58 to 64) are documented to be "undefined". This means Windows is free to do with them whatever it likes including simply ignoring them. Code 0x5F (95) is the SleepKey.

While the VirtualKey codes indeed match the ASCII codes for letters and digits this is not true for the others.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 7
(511 Views)

You are using the keyboard call.  For the two characters you are having problems with (@, _), they require the shift key to be pressed before sending the ASCII codes and released after.  So you need to add the commands for the shift key too.

Randall Pursley
0 Kudos
Message 5 of 7
(439 Views)

Attached is what I got to work.  The only question I have is the keyboard code for the -/_ key.  Wasn't what I expected.

 

Randall Pursley
0 Kudos
Message 6 of 7
(424 Views)
Solution
Accepted by topic author yuntan

Randall,

  Thank you so much for your help. Appreciate it. You have resolved my problem. 

0 Kudos
Message 7 of 7
(380 Views)