Hello Guest it is March 28, 2024, 01:47:33 PM

Author Topic: I NEED ''Enable'' an ''Cycle Start'' scripts for activating with a ESS input  (Read 4664 times)

0 Members and 1 Guest are viewing this topic.

I HAVE TRIED to activate cycle start with a script i got from joe average but we just cant get it to work, i know my input is working we have it activating the diagnostic led but cant seem to get it to activate Cycle Start when you trigger that input #1
 
Cycle Start()
[mc.ISIG_INPUT10]=function(state)
   if state==1 then
      CycleStart()
   end
end

i have put it in the left down script, the left up script i have put the left up an left down actions  to cycle start with an without the code installed in the  clicked boxs, not sure what the exact scenario is that i need to have them installed an what order needs to be on an off with the left dwn/up clicked act/srpt/ boxs,... 

im trying to get all my main screen buttons onto external buttons or either have them where they can be triggered by key strokes an use a macro keyboard to activate them, i dont care which way but this was suppose to be the easiest way to do it an its not been easy to figure out,... i have tried some of the scripts in another post similar to what im trying but those didn't work either,...so im tryn to determining if its in my inputs or in the scripts,...
Hi,
Quote
i have put it in the left down script, the left up script i have put the left up an left down actions
Wrong, that code needs to go in the SigLib table at the top of the screen load script.

Craig
« Last Edit: July 01, 2018, 04:52:29 PM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
jbraddock

Notice that individual table entries are separated by a comma , so be sure to include one after your code unless it is the final entry in SigLib{}.

Allan
Hi,
Quote
i have put it in the left down script, the left up script i have put the left up an left down actions
Wrong, that code needs to go in the SigLib table at the top of the screen load script.

Craig you posted screen shots with them circled to where they go..? or atleast thats what i understanded you were saying to put them, now your saying they dont go inside the script boxs?
if so im confused as to where this sig lib is?
Hi,
I am at work and so can't show you at the moment.

Open the screenload script and near the very top you'll see:

SigLib{

which is the start of the signal library table. You just need to put another entry in it.
It tell Mach 'this is the signal I'm interested in....and this is what I want you to do...'

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Open the Screen Load script in the screen editor and find the line:

    SigLib = {

This is the beginning of the signal table. Now try inserting the following between 2 existing entries:

Code: [Select]
--AW: Set cycle start if user presses key assigned to Input0
[mc.ISIG_INPUT0] = function (state)
    if (state == 1) then
        CycleStart()
    end
end,

--AW: Set feed hold or stop if user presses key assigned to Input1
[mc.ISIG_INPUT1] = function (state)
    if (state == 1) then
        local hSig = mc.mcSignalGetHandle(inst, mc.OSIG_RUNNING_GCODE)
        local codeRunning = mc.mcSignalGetState(hSig)
        if (codeRunning  == 1) then
            mc.mcCntlFeedHold(inst)
            --CycleStop()
        end
    end
end,


Use your own inputs instead of inputs 0 and 1. That's all there is to it.

Allan
Open the Screen Load script in the screen editor and find the line:

    SigLib = {

This is the beginning of the signal table. Now try inserting the following between 2 existing entries:

Code: [Select]
--AW: Set cycle start if user presses key assigned to Input0
[mc.ISIG_INPUT0] = function (state)
    if (state == 1) then
        CycleStart()
    end
end,

--AW: Set feed hold or stop if user presses key assigned to Input1
[mc.ISIG_INPUT1] = function (state)
    if (state == 1) then
        local hSig = mc.mcSignalGetHandle(inst, mc.OSIG_RUNNING_GCODE)
        local codeRunning = mc.mcSignalGetState(hSig)
        if (codeRunning  == 1) then
            mc.mcCntlFeedHold(inst)
            --CycleStop()
        end
    end
end,


Use your own inputs instead of inputs 0 and 1. That's all there is to it.

Allan

thank you,..ive been in the wrong place all day,
Hi,
I am at work and so can't show you at the moment.

Open the screenload script and near the very top you'll see:

SigLib{

which is the start of the signal library table. You just need to put another entry in it.
It tell Mach 'this is the signal I'm interested in....and this is what I want you to do...'

Craig

ok
Hi,
the signal library takes a little bit of 'getting your head around' however when you do
you'll soon realize that this method is light years ahead of Mach3 which polls its inputs.

Further now that you have that one example under your belt you'll be able to repeat it with
all manner of variations...and so simple!

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
its not easy for me apparently,.... ive tried numerous ways an it keeps
 Saying...

 LUA  SYNTAX ERROR DURING PRE COMPILATION UNEXPECTED SYMBOL NEAR =