Hello Guest it is January 26, 2020, 11:12:51 PM

Author Topic: Assign input to the controller, CICLE START button  (Read 292 times)

0 Members and 1 Guest are viewing this topic.

Assign input to the controller, CICLE START button
« on: November 07, 2018, 01:57:22 AM »
Hello to the whole forum.
I'm italian, I use google translate.
I would like to assign an external key to the SINGLE BLOCK function, then an Input for the controller.
how can I do?
I own CSMIO-IP / S
thank you.
Re: Assign input to the controller, CICLE START button
« Reply #1 on: November 07, 2018, 08:41:12 AM »
daniba73,
Once you map a button to an input in Mach4 then you  can put this script into the signal library in the screen load script. 
I have this example mapped to input 5

 
[mc.ISIG_INPUT1] = function (state)
     if (state == 1) then --
   --Single Block Toggle Test
   local inst = mc.mcGetInstance()

   local SBMode = mc.mcCntlGetSingleBlock(inst)
   if SBMode == 1 then
      mc.mcCntlSetSingleBlock(inst, 0)
    else
      mc.mcCntlSetSingleBlock(inst, 1)
    end
    end
end,
Chad Byrd
Re: Assign input to the controller, CICLE START button
« Reply #2 on: November 07, 2018, 05:09:56 PM »
Hi,
Yes, it works
part immediately active.
can you do it reverse?
« Last Edit: November 07, 2018, 05:18:49 PM by daniba73 »
Re: Assign input to the controller, CICLE START button
« Reply #3 on: November 07, 2018, 07:33:32 PM »
Daniba73,
It toggles correctly? 
You can reverse the logic, yes.

[mc.ISIG_INPUT1] = function (state)
     if (state == 1) then --
   --Single Block Toggle Test
   local inst = mc.mcGetInstance()

   local SBMode = mc.mcCntlGetSingleBlock(inst)
   if SBMode == 0 then
      mc.mcCntlSetSingleBlock(inst, 1)
    else
      mc.mcCntlSetSingleBlock(inst, 0)
    end
    end
end,
« Last Edit: November 07, 2018, 07:35:31 PM by Cbyrdtopper »
Chad Byrd
Re: Assign input to the controller, CICLE START button
« Reply #4 on: November 08, 2018, 05:54:56 AM »
Hi,
toggles correctly.
thanks you have been very kind!!
« Last Edit: November 08, 2018, 05:59:13 AM by daniba73 »
Re: Assign input to the controller, CICLE START button
« Reply #5 on: November 08, 2018, 04:00:21 PM »
So it works like you want now?
Chad Byrd
Re: Assign input to the controller, CICLE START button
« Reply #6 on: November 09, 2018, 01:35:15 AM »
Yes,Yes!
Very good!
thank you again!

P.S. I would like to add some sounds to Mach4, but I open a dedicated topic.
Re: Assign input to the controller, CICLE START button
« Reply #7 on: November 09, 2018, 04:07:49 AM »
Note:
with the second code, it did not work for me.
I'm using the first one.
Mach4 boot active part, but it is not a problem.