Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you control the slide with keyboard ?

I would like to control the slide with keyboard the following picture with the increment and decrement function.
 
Thank you.
0 Kudos
Message 1 of 6
(4,153 Views)
Hi water2006,

A way to do this would be to use an event structure to detect when the arrow keys are pressed.  I have attached links to two different example programs.  The first shows how to detect key downs with an event structure and the second uses this concept to jog the axis of a motor depending on mouse click.  You can hopefully use these two examples to create what you are wanting to design for your system.  Good luck.

Using the LabVIEW Key Down Event  http://zone.ni.com/devzone/cda/epd/p/id/3924

Forward Reverse Interactive Jog http://zone.ni.com/devzone/cda/epd/p/id/2952

Regards,
Vu D
Applications Engineer
0 Kudos
Message 2 of 6
(4,108 Views)

Dear Vu D,

 

I cannot download them because I use the LAN network, please help me to ZIP them and send to my email td2006@sanook.com

 

Thank you very much for your help.

 

0 Kudos
Message 3 of 6
(4,104 Views)

Dear Vu D,

 

When I copy the code (keydown.vi) that it use the event for capture the key to my main program, the keydown program works but my main program no work, please suggest me about this problem.

 

Thank you very much

0 Kudos
Message 4 of 6
(4,088 Views)

Hello water2006

If you are able to get the keydown program to work, the next step would be to incorporate it into your VI.  The basic concept of this example is to show how various events trigger depending on the key stroke.  You can use this basic concept to create a similar event structure for your main program to trigger motion depending on which arrow key (Vkey) is pressed (that is, include the motion actions you are trying to run within the event triggered).  I hope this helps.


Regards,

Vu D

0 Kudos
Message 5 of 6
(4,070 Views)
Thank you,
0 Kudos
Message 6 of 6
(4,066 Views)