Hello Guest it is March 28, 2024, 05:43:09 PM

Author Topic: How to use the keyboard ESC key to stop all movement.  (Read 3122 times)

0 Members and 1 Guest are viewing this topic.

How to use the keyboard ESC key to stop all movement.
« on: May 22, 2017, 03:08:26 AM »
The Feed Hold does work when I press the Space bar. Using it as an example I tried to make the Esc key do the stop function but it errors out on me. Below is the code...
Any suggestions will be greatly appreciated.

--this works for the Feed Hold
if mc.mcSignalGetState (mc.mcSignalGetHandle (inst, mc.ISIG_INPUT63) == 1 then
     mc.mcCntlFeedHold (inst)
else
     --  Do something else
End

_________________________________________________________________

--This errors out
if mc.mcSignalGetState (mc.mcSignalGetHandle (inst, mc.ISIG_INPUT623) == 1 then
     mc.mcCntlcycleStop (inst)
else
     --  Do something else
End
Re: How to use the keyboard ESC key to stop all movement.
« Reply #1 on: May 22, 2017, 07:31:12 AM »
Check your capitalisation in mcCntlCycleStop. Upper and lower case C look similar.

Allan
Re: How to use the keyboard ESC key to stop all movement.
« Reply #2 on: May 22, 2017, 11:21:01 AM »
Thanks, but i do have with as mc.mcCntlCycleStop with the capital C's in the code I was trying. I just didn't get it right when I typed my question in the forum.
Dave

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: How to use the keyboard ESC key to stop all movement.
« Reply #3 on: May 22, 2017, 02:55:09 PM »
Check your INPUT number mach4 doesnt have 623 inputs..

DazTheGas
New For 2022 - Instagram: dazthegas
Re: How to use the keyboard ESC key to stop all movement.
« Reply #4 on: May 22, 2017, 04:11:50 PM »
Another error when entering message. The actual code does use input 62 not the 623 that I show above.
I have to learn to type more accurate and reread my messages.
Below is a copy and paste of what is in Mach4

if mc.mcSignalGetState (mc.mcSignalGetHandle (inst, mc.ISIG_INPUT63)) == 1 then
    -- mcSignalWait(inst, ISIG_INPUT63, WAIT_MODE_Low, 0)
    mc.mcCntlFeedHold (inst)
else
    --   Do something else
end

--------------------------------------------------------------------------------------

--if mc.mcSignalGetState (mc.mcSignalGetHandle (inst, mc.ISIG_INPUT62)) == 1 then
--    mc.mcCntlCycleStop (inst)
--else
--    --   Do something else
--end
Re: How to use the keyboard ESC key to stop all movement.
« Reply #5 on: May 22, 2017, 06:02:30 PM »
Why  are you showing the second section as  all commented  out? What code are you actually using?

Allan
Re: How to use the keyboard ESC key to stop all movement.
« Reply #6 on: May 22, 2017, 06:21:57 PM »
The first one is for Feed Hold which works, the commented out one is for the stop which does not work when the comments are removed.
Re: How to use the keyboard ESC key to stop all movement.
« Reply #7 on: May 23, 2017, 10:48:21 AM »
OK.  I can't see a problem with the script itself. Let's go to the next step.

Have you set up an entry (or checked that one exists) in the Keyboard plugin and assigned this to Input 62 in Mach4's Input Signals tab?

Allan
Re: How to use the keyboard ESC key to stop all movement.
« Reply #8 on: May 23, 2017, 11:12:56 AM »
Yes, they seem to be correct. Checked the keyboard inputs and Mach input signals.

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: How to use the keyboard ESC key to stop all movement.
« Reply #9 on: May 23, 2017, 01:31:47 PM »
Have you tested with some key other than esc. ?
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!