Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: archerks 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
-
Check your capitalisation in mcCntlCycleStop. Upper and lower case C look similar.
Allan
-
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
-
Check your INPUT number mach4 doesnt have 623 inputs..
DazTheGas
-
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
-
Why are you showing the second section as all commented out? What code are you actually using?
Allan
-
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.
-
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
-
Yes, they seem to be correct. Checked the keyboard inputs and Mach input signals.
-
Have you tested with some key other than esc. ?
-
Try using the siglib in the Screen Load Scipt instead of the PLC as this works absolutely fine on my machine.
DazTheGas
-
I suggest you substitute mc.mcCntlCycleStop (inst) for mc.mcCntlFeedHold (inst)
in the code for Input63. If this works then something must be mismatched in the Keyboard plugin / Input Signals area for Input62.
By the way, Daz is right, though either way should work .
Allan