I believe it is quite straightforward
You need to use the PLC script and monitor the input signal. eg see the code below
local Button_Input= mc.ISIG_INPUT1 --define the variable for the input
local output_1 = mc.OSIG_OUTPUT1 -- define variable for output
-- get handles and states (states will be helpful to check if inputs outputs are active, use a message box, make it a comment )
local hsig_input = mc.mcSignalGetHandle(inst, Button_Input) --
local Button_Input_State= mc.mcSignalGetState(hsig_input )
local hsig_output = mc.mcSignalGetHandle(inst, output_1)
local output_1_State= mc.mcSignalGetState(hsig_input )
if (Button_Input_State== true) then
mc.mcSignalSetState(hsig_output ,TRUE)
end
I think that will do it, maybe someone else have a better way. Maybe the PMC would be faster.
Check the documentation for scripting and PMC