Hello Guest it is November 08, 2024, 09:16:26 PM

Author Topic: Input = high if user is pressing key  (Read 4814 times)

0 Members and 1 Guest are viewing this topic.

Input = high if user is pressing key
« on: April 11, 2009, 04:15:07 AM »
Hi there.

I know how to turn on an input using a keyboard key and emulation under the config/ports and pins. This works, and when I press that key the input goes hi, press it again goes low.

My objective still different form that scenario: is to have the input hi during the time the user is pressing the key. If the user stops pressing the key it should go straight to low.

Is this possible?
Thank you.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: Input = high if user is pressing key
« Reply #1 on: April 11, 2009, 05:24:07 AM »
Not sure if that would be possible, you could have it timed within the code to switch on and off with a delay but the time would be constant. Suppose you could vary the time by inputting to a User DRO the time you wanted the delay to be but I suspect this is not what you are looking for. Maybe a Brain with a timer  would work but think you would have to do a lot of messing and a lot of funny workarounds to get close.
Hood
Re: Input = high if user is pressing key
« Reply #2 on: April 11, 2009, 05:31:42 AM »
Do not seam reasonably in that way.
This is for a safety measure, so that a user can only jog the machine if it have both hands on the keybard (one for pressing a key and the other for jog on the direction keys).

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: Input = high if user is pressing key
« Reply #3 on: April 11, 2009, 06:00:10 AM »
You might be able to do that via your drives, if they have an enable signal you could fit a physical momentary switch. You would need to Make sure however that Mach got a signal back on InPut 1 telling it that the drives were disabled.
Hood