From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the input from the keyboard and convert it to a number between -1 and 1?

Hi everyone,

 

There's a program which when you press the right arrow key on the keyboard, I should get a one; and when you press the left arrow key, I should get a -1. I cannot figure out how to use keyboard in labVIEW and also, how to convert the output of the keys pressed.

Any helps appreciated since I have a little time for doing this.Thanks.

0 Kudos
Message 1 of 5
(4,151 Views)

Look in the examples for event structure. You can use the Key Down or Key Up event, depending on what you're trying to do. The VKey and Char are available to you to tell you what key was pressed.

0 Kudos
Message 2 of 5
(4,149 Views)

Thanks for your reply.

This may be a stupid question, but since I'm new here, I dont know what you mean by "event structure"

0 Kudos
Message 3 of 5
(4,146 Views)

Have you done any of the LabVIEW tutorials? To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.

 

With respect to event structures: http://www.ni.com/white-paper/3331/en

0 Kudos
Message 4 of 5
(4,137 Views)

If you only have an older version of LabVIEW base, you won't have the event structure. You need LabVIEW full or higher.

 

(LabVIEW 2012 is the first version that includes the events structure in the base version.). 

0 Kudos
Message 5 of 5
(4,114 Views)