Hello Guest it is March 28, 2024, 02:03:11 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - danilo93

Pages: 1
1
CS-Lab / CSMIO IP/A and CSMIO IN/OUT MACH4 ISSUE
« on: April 10, 2018, 02:25:01 PM »
Hi guys,
I would need advice:
I have an IP / A and two input output modules that work with mach4.
the inputs do not have any kind of problem and they work correctly but I can not make the outputs work:
I mapped the outputs from 1 to 7 in mach 4 with the respective 1/7 of csmio in.0.
through M function the mach 4 out is active on a regular basis but the physical relay in csmio in / out does not activate.
Do you have any advice for me?
sorry for my bad english
Thanks in advance to everyone

2
Mach4 General Discussion / output on/off from same button
« on: April 07, 2018, 02:55:21 PM »
Hello everyone. I ask for help because I've lost the last two days trying to make a button work to turn the OUTPUT on or off, now I've built two simple M functions, which work individually but I can not combine them. can someone give me help or tell me why these two tests do not work that I attach below? I'm not a programming expert but I would like to be able to have this function on my machine. thank you all and sorry for my bad english.

first test

function M101()

    local inst = mc.mcGetInstance()


hReg, rc = mc.mcIoGetHandle(inst, OSIG_OUTPUT0);
BoolPointValue = mc.mcIoGetState(hReg);


    if (OSIG_OUTPUT0 == 0) then  ---- SE è SPENTO
        mc.mcCntlMdiExecute(inst, "M15") ---ACCENDI POMPA
    else
    mc.mcCntlMdiExecute(inst, "M16")   ----SPEGNI POMPA
     
           end
       
end

if (mc.mcInEditor() == 1) then
    M101()

end




second test



function M101()

    local inst = mc.mcGetInstance()



    mc.mcSignalGetHandle (inst, OSIG_OUTPUT0) --- LEGGI STATO OUTPUT 0
 mc.mcSignalGetState (inst, OSIG_OUTPUT0) --- LEGGI STATO OUTPUT 0
    if (OSIG_OUTPUT0 == 0) then  ---- SE è SPENTO
        mc.mcCntlMdiExecute(inst, "M15") ---ACCENDI POMPA
    else
    mc.mcCntlMdiExecute(inst, "M16")   ----SPEGNI POMPA
     
           end
       
end

if (mc.mcInEditor() == 1) then
    M101()

end

Pages: 1